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 / FPSC-Style scripting

Author
Message
Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 29th May 2007 02:20
How would one accomplish script checking? What I want to do is check for commands in a script. It will be like FPSC's condition:action style. The closest I have gotten is having each command in its own file.

Any help?

---PlasmaArts---
www.plasmaarts.co.nr - www.plasmaarts-games.co.nr
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th May 2007 02:41
Use these two functions:


If you have this:


It can be split into:
"condition"
"action1"
"action2"
"action3"

Start by using getToken(string$, ":", 1) to get the condition, then use getToken(string$, ":", 2) to get all the actions in one string. Then get the number of actions, by doing getTokenCount(action$, ","), and get each action using a for/next loop and getToken()

Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 29th May 2007 03:36 Edited at: 29th May 2007 03:37
Ohhhhh boy... I don't understand any of that. I have never understood for/next loops and such...... I'm doomed.

Also, how do I set the conditions and actions? In the FPSC-Game code it uses arrays. Is there another way (that is less confusing)?

---PlasmaArts---
www.plasmaarts.co.nr - www.plasmaarts-games.co.nr
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 29th May 2007 04:59 Edited at: 29th May 2007 05:08
Count from 1 to 10 in your mind

Now lets make the computer do the same.
i is a variable that your using to count with



another example might be




Conditions are fairly easy.
In your mind you reach a crossroad, are you going to turn left to the shop, or right to the park.

Now lets look at a very basic condition with the computer.




As you can see its easy if you practice them again and again.

As for arrays think of them as akin to an egg carton holder.
each egg is the array data for that specific cup.



Arrays really start at zero location but for this simple example we are skipping that.
Arrays can stretch across 5 dimensions which I wont cover here, practice them, make examples to explore.



If your not familiar with loops /arrays etc for now, I seriously suggest you head back to learning the commands before embarking on anything.
Dont try and develop anything for now, just practice the commands.

Learn a few commands a day and make a folder with snippets to practice them.
The more commands you learn the easier it will be to solve problems.
The less abstract things will appear.
Soon you will be visualizing these aspects in your minds eye with ease.


That learning snippets folder will only make you a better programmer, and challenge you to exercise your mind, which in turn will bring your ideas to life.

Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 29th May 2007 13:11
Indi- Very nice way to explain it. Arrays were confusing me as well..that is until now...


Thanks

Cheers,
Dave


indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 29th May 2007 13:15
no problem mate. glad it helped more then one.
check out TDKS and sixties tutes now. then onto ruccus's

Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 29th May 2007 14:04
Thanks indi, I think I get it. Zotoaster explained everything in full detail on MSN. I made a quick source file with all that he said in REM. I think I got this down!

---PlasmaArts---
www.plasmaarts.co.nr - www.plasmaarts-games.co.nr

Login to post a reply

Server time is: 2024-11-25 17:48:00
Your offset time is: 2024-11-25 17:48:00