Posted: 26th Jun 2007 5:19
First of all, wow.
I love this porgram! Its so simple! I have LOTS of experiance with macromedia flash 7, and the AS(actionscripy) is all c++! this code is so simple, but it does need varibles strings, and important attributes for any coder. okay im cool.

I have been making a sweet dungeon game, and its pretty basic. left click=foward right click back. you can only roatet the camera left and right. its form a tutorial. I was wondering if anyone could help me "spice it up" Its done, but I wanna add enimeis and items and menus 2. I cant find any help on those sort of things tho. (Which is a suggestion for tuts. More FULL game tuts, like warcraft and other popular games)
anyways, does anyone feel up to take my hand and show me how to make the essientals of any game? My dungeon game is an fp. not a fps. and i wanna add the s! I just need help with menus and items and weapons. one more thing. if u do help me, can u explain the code so I can learn and teach myslef as I did with flash? thank you very much in the future. i luv u all.
Posted: 26th Jun 2007 6:41
Oh yes, a "Make your own Warcraft" tutorial... I'll get right on that.

Anyway... I'll try to help you with whatever I can, but I'll do it tomorrow 'cause it's late here. you see I'm already going mad.

Well until then... Here's some penguins.
Posted: 26th Jun 2007 6:53
More FULL game tuts, like warcraft and other popular games

Lol, you won't find a tutorial to make a commercial-like game, although it is possible .

if u do help me, can u explain the code so I can learn and teach myslef as I did with flash?

You need to be more specific with what you exactly want to know how to do.

i luv u all.

Thats...strange .

EDIT: And I don't know why you have a question in your signature, but the answer is to just say "IF scancode() > 0" if you're asking how to read if any key is being pressed.
Posted: 26th Jun 2007 7:21
Hahaha i think his sig is talking about "Press Any Key to Continue".
Posted: 26th Jun 2007 15:11
That's one of my favorite jokes.



You definitly won't find any full game tuts anytime soon. The best thing is to put your dream project aside for awhile until you have become very comfortable with the language, even if you're a great programmer in other languages this is still a good idea.
Posted: 26th Jun 2007 15:14
Search: FPS Tutorial

and: Menu tutorial

Remember Mr. Rockstar... Search is your friend...




Mike
Posted: 26th Jun 2007 17:44
Lemme talk a little more clearly, my freinds. I was typing fast obviously. Okay. You know that "Huge Dungeon Tutorial"? I'd like to advance in it a little more. Such as creating enemies and items and weapons. (Im going to solve that weapon switching thing too, someday)I can probally figure this out on my own, but I would just like boost, thats all.

One more thing, I have the code for my dungeon game. It worked once, but now for some reason, it's coming up with this: "Could not determine paramenter type of '"#" or ' at line 112". Im pretty sure its the same code from last time. I checked to make sure the map directory was correct, and anything else that could be wrong.
The error message highlights the line below `Wand. Its this line of code:
+ Code Snippet
if map$(int(curposx),int(curposz))="#" or



Here is the whole code of the game.

+ Code Snippet
set display mode 800,600,16
sync on
sync rate 0
hide mouse
backcolor=rgb(0,0,0)
backdrop on
color backdrop backcolor
cls

mapsize=512
dim map$(mapsize,mapsize)
maxcubes=16
cubesize=200
collisionstep=int(cubesize/10)

fog on
fog color backcolor
fog distance (int(maxcubes)*cubesize)
set camera range 1,(maxcubes*cubesize)

function loadmap(filename$,size)
open to read 1,filename$
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

loadmap("Dungeon/media/mymap.map", mapsize)

load image "Dungeon/media/wall2.jpg",1
load image "Dungeon/media/ground.jpg",2
load image "Dungeon/media/wall.jpg",3
load music "Dungeon/media/forest_temple.mp3",1
play music 1
loop music 1

` Wall
for i=1 to maxcubes*maxcubes
make object cube 100+i,cubesize
texture object 100+i,1
next i
` 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

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)

for z=1 to mapsize
for x=1 to mapsize
if map$(x,z)="O"
cx=x*cubesize
cz=z*cubesize
endif
next x
next z
position camera cx,0,cz

oldpositionx#=camera position x()
oldpositionz#=camera position z()

if mouseclick()=1 then move camera maxcubes
if mouseclick()=2 then move camera maxcubes*(-1)
ry#=wrapvalue(ry#+mousemovex())
rotate camera 0,ry#,0

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#)+zz
if curposx<=1 then curposx=1
if curposx>=mapsize then curposx=mapsize
if curposz<=1 then curposz=1
if curposz>=mapsize then curposz=mapsize
for zz=1 to maxcubes
for xx=1 to maxcubes
zzz=zzz+1
curposx=int(cx#)+xx
curposz=int(cz#)+zz
if curposx<=1 then curposx=1
if curposx>=mapsize then curposx=mapsize
if curposz<=1 then curposz=1
if curposz>=mapsize 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" or
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()

position object 100+zzz,curposx*cubesize,0.0,curposz*cubesize

` 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

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()



Thanx for the penquins, I'm starving.
Also, Mike. I did use the search. But to no prevail. I am not rtying to make Warcraft either. I was just using it as an example. Thanx again.
(P.S. I didn't mean.....anything....when I said.....I luv u all....)
Posted: 26th Jun 2007 18:42
"Could not determine paramenter type of '"#" or '

It's because you have an empty "or" statement, you say "or", then don't say what the or is. Either delete the "or" or add something to it .

Here's some tutorials that may help:
http://forum.thegamecreators.com/?m=forum_view&t=105573&b=7

(P.S. I didn't mean.....anything....when I said.....I luv u all....)

Lol, I know, I was just playing with you .
Posted: 26th Jun 2007 19:01
It's because you have an empty "or" statement, you say "or", then don't say what the or is. Either delete the "or" or add something to it .


He has something after the or, but it is on the next line of the program. I suggest you:

Go to Tools->System Options, Enable Source Line Concatenation Directive, and set the Concatenation Symbol to something such as "..."

You can then write your statements like

+ Code Snippet
if a = 1 ...
or b = 2
   print a + b
endif


or

+ Code Snippet
if a = 1 or ...
b = 2
   print a + b
endif
Posted: 27th Jun 2007 3:12
It's still messed up. I delete the or and I did what gamefreak said. but its still being dumb. can u guys, especially a db pro expert look at my code and find something wrong and how to fix it? Ill give u the code again. the whole thing. whats wrong?

this code has 0 errors, but it kicks me out when it opens up before it shows anything.
+ Code Snippet
set display mode 800,600,16
sync on
sync rate 0
hide mouse
backcolor=rgb(0,0,0)
backdrop on
color backdrop backcolor
cls

mapsize=512
dim map$(mapsize,mapsize)
maxcubes=16
cubesize=200
collisionstep=int(cubesize/10)

fog on
fog color backcolor
fog distance (int(maxcubes)*cubesize)
set camera range 1,(maxcubes*cubesize)

function loadmap(filename$,size)
open to read 1,filename$
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

loadmap("media/mymap.map", mapsize)

load image "media/wall2.jpg",1
load image "media/ground.jpg",2
load image "media/wall.jpg",3
load music "media/forest_temple.mp3",1
play music 1
loop music 1

` Wall
for i=1 to maxcubes*maxcubes
make object cube 100+i,cubesize
texture object 100+i,1
next i
` 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

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)

for z=1 to mapsize
for x=1 to mapsize
if map$(x,z)="O"
cx=x*cubesize
cz=z*cubesize
endif
next x
next z
position camera cx,0,cz

oldpositionx#=camera position x()
oldpositionz#=camera position z()

if mouseclick()=1 then move camera maxcubes
if mouseclick()=2 then move camera maxcubes*(-1)
ry#=wrapvalue(ry#+mousemovex())
rotate camera 0,ry#,0

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#)+zz
if curposx<=1 then curposx=1
if curposx>=mapsize then curposx=mapsize
if curposz<=1 then curposz=1
if curposz>=mapsize then curposz=mapsize
` Wand
if map$(int(curposx),int(curposz))="#"
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))=":"
 map$(int(curposx),int(curposz))="D"
 map$(int(curposx),int(curposz))="S"
 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))=":"
map$(int(curposx),int(curposz))="D"
map$(int(curposx),int(curposz))="S"
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()

position object 100+zzz,curposx*cubesize,0.0,curposz*cubesize

` Wall
if map$(int(curposx),int(curposz))="#"
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

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()


this code had the same errors as i mentioned earlier.

+ Code Snippet
set display mode 800,600,16
sync on
sync rate 0
hide mouse
backcolor=rgb(0,0,0)
backdrop on
color backdrop backcolor
cls

mapsize=512
dim map$(mapsize,mapsize)
maxcubes=16
cubesize=200
collisionstep=int(cubesize/10)

fog on
fog color backcolor
fog distance (int(maxcubes)*cubesize)
set camera range 1,(maxcubes*cubesize)

function loadmap(filename$,size)
open to read 1,filename$
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

loadmap("Dungeon/media/mymap.map", mapsize)

load image "Dungeon/media/wall2.jpg",1
load image "Dungeon/media/ground.jpg",2
load image "Dungeon/media/wall.jpg",3
load music "Dungeon/media/forest_temple.mp3",1
play music 1
loop music 1

` Wall
for i=1 to maxcubes*maxcubes
make object cube 100+i,cubesize
texture object 100+i,1
next i
` 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

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)

for z=1 to mapsize
for x=1 to mapsize
if map$(x,z)="O"
cx=x*cubesize
cz=z*cubesize
endif
next x
next z
position camera cx,0,cz

oldpositionx#=camera position x()
oldpositionz#=camera position z()

if mouseclick()=1 then move camera maxcubes
if mouseclick()=2 then move camera maxcubes*(-1)
ry#=wrapvalue(ry#+mousemovex())
rotate camera 0,ry#,0

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#)+zz
if curposx<=1 then curposx=1
if curposx>=mapsize then curposx=mapsize
if curposz<=1 then curposz=1
if curposz>=mapsize then curposz=mapsize
for zz=1 to maxcubes
for xx=1 to maxcubes
zzz=zzz+1
curposx=int(cx#)+xx
curposz=int(cz#)+zz
if curposx<=1 then curposx=1
if curposx>=mapsize then curposx=mapsize
if curposz<=1 then curposz=1
if curposz>=mapsize 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" or
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()

position object 100+zzz,curposx*cubesize,0.0,curposz*cubesize

` 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

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()



Id like to metion it worked fine before a couple times and i followed the tut's instructions. I accidently deleted the file. I did it again but it wont work. thanx fo the help. ill keep trying meanwhile.
Posted: 27th Jun 2007 4:37
I did it! I fixed all of the errors!!!!! It works! Horray! Hip-hip: *crickets* Hip-hip: *more crickets* Hip-hip: *cough*

Now that's fixed, can you guys help me add stuff? I kindov have an idea. I make an enemie varable or whatever the player letter is called, and I load a .X file of an enemy in it, so its built into the map like the player. Same with items. The only problem is... i open the text doc., and its all weird looking. Any ideas?
Posted: 27th Jun 2007 4:55
DB Pro Experts are like Coal - EXTREMELY COMMON but there definately are a few diamonds here and there!

Seriously - I'm finding DB Covers ALOT of ground - and it'd be hard to become an EXPERT imho.

I do think its just as much learning the quirks and reading error messages and knowing what they REALLY mean versus taking them to literally sometimes.

As for code "kicking you out" I often find calling "abilities" thast your gfx card doesn't support can do that. Dark Basic Pro doesn't seem to really have an error catching system - so when errors are encountered - afaik - you get a error message if the darkbasic issue is with a command you made - and edbpro simply stops wihout a report if its an error it wasn't prepared to deal with.

hypothetical
e.g. Asking a FOO video card for raytrace command - but it doesn't have it causes the directx driver to return an error AFTER executing your command which was correct "according ro DBPro" so when the card tossed back an error, directx library then hands it back to DBPro, DBPro doesn't know what and why so it just knows life is bad then you die - so it ends the application rather abruptly.


Some tips are commenting out huge chunks of code that will still run (without errors) - essentially breaking the application into smaller chunks.. and REINTRODUCING them one chunk of code at a time until you can isolate the "area" that seems to be a prolem. Toss in some print statements to examine values of variables etc you expect to have data - and possibly dont... etc. Break the problem down into smaller pieces and work it like that. you may find that the problam code "block" that is the culprit is requesting the FOO video card for something it doesn't support - say specular lighting... who knows. I program for a living and this is basically how its done...otherwise handing a hundred or more lines of code to someone else - well - let's say its a last resort. Though I know I've posted a question more than once to find the answer seconds after struggling for hours and posting the issue!

Another thing I do in most languages - not in DBPRO yet (lack of compiler defines makes me leary) is make a couple diagnostic subroutines that can dump out log files. I jhave two tpye - ones that just log info and say things like "Error 200706262246: Media file not found" The error number is the time I wrote the code and error message - yyymmddhhmmss - so I have unique codes to search for to be able to open the editor search the code for that value and BANG I'm at the problem.

The other kind of logging I do emulates a debugger - sorta - its for nesting. I have a global variable - "iNestLEvel"

In EVERY function I Call a "addnestlevel function"


+ Code Snippet
function SampleFunc
if bDebug
  DebugIn("FunctionNameHere")
endif
...
Do something
...
if bDebug
  DebugOut("FunctionNameHere")
endif

endfunction


Then these two functions DEbugin and debug out add or subtract ONE from the global iNestLEvel - and also print a log file that uses nest level to print "minus" signs.

Example:
+ Code Snippet
IN  >------->SampleFunction 2007-06-23 23:45:55
IN  >-------->UpdateDisplay 2007-06-23 23:45:55
OUT <--------<UpdateDisplay 2007-06-23 23:45:55
OUT <-------<SampleFunction 2007-06-23 23:45:56


This log file helps me figure out where things blow up. Its much easier to implement this idea - from the very start as a matter of course - then trying to add it to a huge application that now has a tricky bug.

I could see why people might not choose this method due to the nature of dbpro - but if DBPro had compiler defines - you could turn this diagnostic code off globally when you compile for production (or a playable demo) versus a heaver (code wise) debug version.

this is extremely helpful because the log file just stopps where the program did - so even if dbpro didn't give a error and line number - you know WHERE the code died approximately - rather quickly

best regards,
Jason P Sage

P.S. If DBPro just had explicit variable declaration as an option - we would get alot more done per hour - I guarantee it. Nothing worse than hunting a problem for hours to realize You Type "Bullet" versus "Bullets" and the compiler said "No problem - Looks fine to me! compiles runs a bit then "bang... good luck finding that one!"
Posted: 27th Jun 2007 6:56
Jesus is a ROCKSTAR

That makes the answers to WWJD a lot more fun