Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Problems with code

Author
Message
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 9th Feb 2003 12:05
Ok, im still using the Demo version of DBPro, I want to create a First Person Shooter, but I cant get the code to work right. I am trying to add a simple jump, which my friend found way on back 7-9 pages. When I try to add my code, I get this message.

#100013: Command out of place at like 59

On line 59, I have loop. I understand what it wants from me, but I dont know how to solve this, does anyone have any ideas or suggestions as to what is causing it & can anybody help to to figure out where to put the loop or make the code work? Any tips you may have to placing the loop, or getting this to work?

I am wondering if it is even possible to get both codes to work. I am using The Darthsters code for the movement, & I will post both the jump code & the other here in a second.

Jump code
If Spacekey()=1 then YSPD#=3

inc PY#,YSPD#

`Change the following line to set the fall rate
Dec YSPD#,0.2

if PY#0 and yspd#90 then dx#=90
if dx#
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 9th Feb 2003 14:52
What is the section of code around line 59? This can happen if you forget to end and IF or a loop or do something like

IF SPACEKEY() THEN
Do something
ENDIF

It will say the ENDIF is out of place.

Hope this helps.

Jas
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 10th Feb 2003 01:30
Sorry, I guess the codes didnt post right. Since I have been playing around with the code, it now says line 61, which is a loop.

What should I post at the top of the loop? Its the Darthsters 20 line winner, to those of you who know.

When I take the jump code out, it works just fine, but thwn I add the jump code, it doesnt work.

If I move the jump code to the bottom of the entire code, it gives me this error...

#100012: Could not close nest at line 67.

Where 67 is an ENDIF

I will try to post the code again, but I dont know if it will work unlike it did last time.



Lets hope that works.
Thanks,

jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 10th Feb 2003 11:12
That small section there seems to be missing an ENDIF

Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 10th Feb 2003 20:00
Shadow... make sure your IDE is up to date... http://www.realgametools.com/ ... Thats a problem I used to have... o_O

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 10th Feb 2003 21:14
IDE, whats that?

I noticed the level runs now, but it seems that my jump code doesnt allow the player to jump, do I need to put part of the code in a different part than the other? Something like put the if Spacekey()=1 then YSPD#=3 with the controls, & the rest somewhere else. Can someone help to to figure out where I went wrong?

Thanks,

Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 10th Feb 2003 22:47
If your running DarkBASIC Pro you must download the most recent patch here... then goto www.realgametools.com and download the newest IDE ... its the editor... o_O

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 11th Feb 2003 03:08
Ok, I understand what your talking about now, my copy of DBPro came in the mail today, I ordered it from http://www.realgametools.com.

Now, I will try out the tutorials that came with it in hopes that I can find my problem. ^^

Thanks,

Login to post a reply

Server time is: 2024-11-24 01:49:09
Your offset time is: 2024-11-24 01:49:09