Posted: 11th Jun 2007 5:13
http://developer.thegamecreators.com/?f=dbpro_tutorials
the dungeon one

there are two codes the same and i get a error
dont know why

+ Code Snippet
if map$(int(curposx),int(curposz))="#" or
Posted: 11th Jun 2007 7:00
That's only half a statement.

You need the bit that comes after the 'or'. Check the following line in the listing - it may have got separated.

TDK_Man
Posted: 11th Jun 2007 14:35
ty
Posted: 12th Jun 2007 2:38
ya well i check on it grrr
still i delete the or it goes down to a centence with a and at the end
then i delete and
on and on
hole thing


+ Code Snippet
set display mode 800,600,16
rem cls for graphic cards for no flickering
sync on
sync rate 0
hide mouse

backcolor=rgb(0,0,0)

backdrop on
color backdrop backcolor
cls
rem map
mapsize=512
dim map$(mapesize,mapesize)
rem divides map makes map size around player 16x16
maxcubes=200
collisionstep=int(cubesize/10)
rem invirment valuase fog darkness and such :)
fog on
fog color backcolor
fog distance (int(maxcubes)*cubesize)
set camera range 1,(maxcubes*cubesize)
rem read map array ($) saves map
function loadmap (filename$,size)
   open to read 1,dungeon$
   for y=1 to size
   for x=1 to size
       read byte 1,tmp
       map$(x,y)=chr$(tmp)
   next x
   next y
   close file 1
endfunction
rem loading map / medie
loadmap("dungeon.map",mapesize)
load image "wall2.jpg",1
load image "ground.jpg",2
load image "wall.jpg",3
` Wall
   if map$(int(curposx),int(curposz))="#" or
map$(int(curposx),int(curposz))="S"
      show object 100+zzz
      position object 100+zzz,curposx*cubesize,0.0,curposz*cubesize
      ` Collision detection
      if map$(int(curposx),int(curposz))="#"
      if tx#>=((curposx*cubesize)-(cubesize/2))-collisionstep and
tx#<=((curposx*cubesize)+(cubesize/2))+collisionstep and
tz#>=((curposz*cubesize)-(cubesize/2))-collisionstep and
tz#<=((curposz*cubesize)+(cubesize/2))+collisionstep
      position camera oldpositionx#,camera position
y(),oldpositionz#
      oldpositionx#=camera position x()
      oldpositionz#=camera position z()
   endif
   endif
else
   hide object 100+zzz
endif
` Floor
for i=1 to maxcubes*maxcubes
   make object plain 10000+i,cubesize,cubesize
   rotate object 10000+i,90,0,0
   texture object 10000+i,2
next i
` Ceiling
for i=1 to maxcubes*maxcubes
   make object plain 20000+i,cubesize,cubesize
   rotate object 20000+i,270,0,0
   texture object 20000+i,3
next i
rem lights spooky
set ambient light 30
make light 1
make light 2
set point light 1,0,0,0
set spot light 2,45,90
color light 2,rgb(252,216,141)
color light 1,rgb(236,182,100)
color light 0,rgb(0,0,0)
rem respawn point
for z=1 to mapesize
for x=1 to mapesize
   if map$(x,z)="0"
      cx=x*cubesize
      cz=c*cubesize
   endif
next x
next z
position camera cx,0,cz
rem simple colizion :(
oldpositionx#=camera position x()
oldpositionz#=camera position z()
rem mainloop
DO
`movment
if mouseclick()=1 then move camera maxcubes
if mouseclick()=2 then move camera maxcubes*(-1)
ry#=wrapvalue(ry#+mousemovex())
rotate camera 0,ry#,0
` calculate current map 16x16
cx#=int(camera position x()/cubesize)-int(maxcubes/2)
cz#=int(camera position z()/cubesize)-int(maxcubes/2)

tx#=camera position x()
tz#=camera position z()

zzz=0
`
for zz=1 to maxcubes
for xx=1 to maxcubes
   zzz=zzz+1
   curposx=int(cx#)+xx
   curposz=int(cz#)+z
   if curposx<=1 then curposx=1
   if curposx>=1 then curposx=mapsize
   if curposz<=1 then curposz=1
   if curposz>=1 then curposz=mapsize
` Wand
   if map$(int(curposx),int(curposz))="#" or
map$(int(curposx),int(curposz))="S"
      show object 100+zzz
      position object 100+zzz,curposx*cubesize,0.0,curposz*cubesize
   else
      hide object 100+zzz
   endif
   ` Boden
   if map$(int(curposx),int(curposz))=":" or
map$(int(curposx),int(curposz))="D" or
map$(int(curposx),int(curposz))="S" or
map$(int(curposx),int(curposz))="T"
      show object 10000+zzz
      position object 10000+zzz,curposx*cubesize,(cubesize/2)*(-
1),curposz*cubesize
   else
      hide object 10000+zzz
   endif
   ` Decke
   if map$(int(curposx),int(curposz))=":" or
map$(int(curposx),int(curposz))="D" or
map$(int(curposx),int(curposz))="S" or
map$(int(curposx),int(curposz))="T"
   show object 20000+zzz
   position object
20000+zzz,curposx*cubesize,(cubesize/2),curposz*cubesize
   else
      hide object 20000+zzz
   endif
next xx#
next yy#

oldpositionx#=camera position x()
oldpositionz#=camera position z()
`
postion object 100+zzz,curposx*cubesize,0.0,curposz*cubesize
` light effects
position light 1,camera position x(),camera position y(),camera
position z()
position light 2,camera position x(),camera position y(),camera
position z()
color light 1,RGB(200+int(rnd(50)-25),120,60)
rotate light 2,camera angle x(),camera angle y(),camera angle z()






needs lots of help and i told yall what code is messeded up theres 2


Posted: 12th Jun 2007 3:00
DBPro has a symbol ('...' by default I think) that you put on the end of a line telling the compiler that the current line continues on the next line.

You don't have the three full stops on the end of the lines that end in 'or' or 'and' so you could try adding them.

TDK_Man
Posted: 12th Jun 2007 4:24
ya i try that after my head ack
but the thing is this was all typed from the tutorial i dont see why its wrong and what i did got wrong i copy pasted it
Posted: 12th Jun 2007 23:57
http://developer.thegamecreators.com/?f=dbpro_tutorials
plz some one figure whats wrong
its the dungeon one
i swear idk first time dealing with no y axis
in the tutorial

sorry
for my newbyness
trying to figure out this stuff as best as i can i learned somthing very good the player view thing were if gives a certain amount of sight for the map

that help alot i know




but thnx if any one helps



Posted: 14th Jun 2007 4:49
no helps me lol but thnx for help was usfullish

why

idk why it doesnt work
ive added it
to other codes
there isnt

Posted: 14th Jun 2007 5:00
if map$(int(curposx),int(curposz))="#" or
map$(int(curposx),int(curposz))="S"

appears to be the broken line

if map$(int(curposx),int(curposz))="#" or map$(int(curposx),int(curposz))="S"
Posted: 14th Jun 2007 5:02
i can try it
but i thought i allready did but what ever


Posted: 14th Jun 2007 5:05
ya
it worked
but then i forgot to tell thers another problem
the

if tx#>=((curposx*cubesize)-(cubesize/2))-collisionstep and
tx#<=((curposx*cubesize)+(cubesize/2))+collisionstep and
tz#>=((curposz*cubesize)-(cubesize/2))-collisionstep and
tz#<=((curposz*cubesize)+(cubesize/2))+collisionstep
position camera oldpositionx#,camera position
Posted: 14th Jun 2007 5:05
do the same thing or change the and to somthing else
cause i did combine them
Posted: 14th Jun 2007 5:10
i fixed every thing else
and
now up to the and statement

))-collisionstep and


when i press a button it says that one is a problem
its a collision
paremeter type of that
Posted: 14th Jun 2007 5:19
its obvious your not comprehending the commands.

psuedo examples of usage.

+ Code Snippet
if (condition is met) or (condition is met)
do something
endif

if (condition is met) and (condition is met)
do something
endif



you need to group the commands back into one big line of code so the compiler can read the whole chain of commands as a grouped instruction.
Posted: 14th Jun 2007 5:48
position camera=oldpositionx#,camera position
dpositionz#



confuzed
Posted: 14th Jun 2007 17:09
APC,

You definitly need to pick up a book or read the help.
Why don't you download the source files from the tutorial? I checked them out awhile ago and I thought they worked without editing them. (Maybe I am wrong?)
Posted: 14th Jun 2007 17:28
I've encountered a similar problem: for some reason I have problems with 'line break/continues' - if the line breaks over, the compiler spits it out as an error. I don't know why. I simply delete the "..." or the "_" - depending on what the original developer used, then delete the line break, re-joining the line.

Yeah, it makes for some murderously long lines, but it also compiles. And works. I'll take the murderously long lines (and functionality) over trying to figure out which "line break/continue" feature is being used this time...

Just a thought.
Posted: 14th Jun 2007 21:57
ya
but now im confuseed about the bit of code i posted earler
i tryed putting the together and such
nothing
idk i gots head ack

from school
and tiredness
Posted: 15th Jun 2007 11:03
yawn i keep trying later
i waited for any help on that part but i can go look it up maybe or check tutorial