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.

DarkBASIC Discussion / strings as subroutines and question on exe vs f5 compile and run

Author
Message
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 11th Oct 2005 01:38
I'm workin on another first person shooter before I finish my paintball game and I have 2 questions about it.

anyone know if/how u can use a string as a subroutine, like so u could go to the shooting code for a specific weapon without if-thens?

and when I make an exe, my game tops out at about 22-25 frames per second, tho it stays at a steady 32 when I run it in the editor. I changed it so that all the media is in folders(thinking that maybe having all the media clogging the exe file was the problem) but that didn't help. Is there some automatic video hardware config done in the editor thats not done in an exe, is the exe maybe suffering from somethign that the editor can get around, does god hate me?

thanks for your help in advance

verydevastating.com
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 11th Oct 2005 01:41
Yes, the editor uses something that makes the games you make run better than the EXE. IT did it for my game when I made an EXE out of it.

As for the string as subroutine thing, you mean something like this?:


If so, then I don't think so. I'm sure I'm mistaken though.

Visit my website of games http://www.dabip.co.nr!

Visit http://www.madmanhosting.tk For a GREAT web host visit MAD MAN HOSTING
UFOs other account lol
19
Years of Service
User Offline
Joined: 3rd Jun 2005
Location: Somewhere :)
Posted: 11th Oct 2005 02:38 Edited at: 11th Oct 2005 02:38
You you mean something like this?


devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 11th Oct 2005 03:59 Edited at: 11th Oct 2005 03:59
i meant like green bunny's. I'd test it but i'm off the computer today. I'm researching 4 school now....

would it work to like

wep$ = "shotgun"

gosub _wep$

((((then down to))))

_shotgun



and anyone know of some settings that would pull the exe up to par w/ the editor's runtime?

verydevastating.com
P Schnell
20
Years of Service
User Offline
Joined: 13th Feb 2005
Location:
Posted: 11th Oct 2005 04:39
For one thing, _wep$ would return a null string, you'd have to use "_"+wep$ to get _shotgun.

I don't think you can use gosubs like that anyway, because (I'm guessing) the compiler wouldn't store _shotgun, but probably just number the sub.

It shouldn't be too time consuming to write the "If wep$ = "shotgun" Then ..." code.

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 11th Oct 2005 16:20
Quote: "I don't think you can use gosubs like that anyway, because (I'm guessing) the compiler wouldn't store _shotgun, but probably just number the sub."

That's correct.


Quote: "It shouldn't be too time consuming to write the "If wep$ = "shotgun" Then ..." code."

Either that or use Select/Case (not sure if that's only in DB Enhanced, though)


Play Nice! Play Basic! Version 1.088
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 11th Oct 2005 20:05
devastation 328,

For what reason would you use this method, even if it were possible. Somewhere in your program you might have to use if statements to fill the variable string with a specific word. That is, unless you are using a mathematical technique.



+NanoBrain+
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 11th Oct 2005 23:20
I'm makin the guns react way different when you shoot, plus I want to have alot of other features without wasting time with the other guns stuff. not to mention theres like 200 ifthens in my main loop already

and strigns was a bad example, I kinda meant currwep# variable or something.

verydevastating.com
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 12th Oct 2005 00:12
Quote: "and strigns was a bad example, I kinda meant currwep# variable or something."


You should definately use select/case (as Empty suggested above). Select/case are the coolest set of commands.

devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 12th Oct 2005 02:57
ill give that a try thanks guys

verydevastating.com

Login to post a reply

Server time is: 2025-05-22 13:26:26
Your offset time is: 2025-05-22 13:26:26