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.

FPSC Classic Scripts / What does the word "state

Author
Message
jeremyc
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location:
Posted: 15th Jun 2007 03:32
What does the word "State" mean when scripting I see it a ton and I am trying to learn how to script so if someone could link me to a guide or tell me what the state word is used for it would be much appreciated.

owned
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 15th Jun 2007 10:19
Check out my guide for a guide to scripting.


Search for "HellHouse" in Showcase.
pigs can fly
18
Years of Service
User Offline
Joined: 20th Aug 2006
Location: Luxembourg
Posted: 15th Jun 2007 16:13
State is getting asked every week.
You should use the Search button at the bottom of the page

(Note: State is an intern variable of all entity AI script...)


All the free PCF Productions Stuff
jeremyc
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location:
Posted: 15th Jun 2007 20:39
Sorry I searched a little bit but found like 3 posts and had nothing to do with what I was looking for thanks for your help.

owned
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 16th Jun 2007 19:04 Edited at: 16th Jun 2007 19:13
STATE=X is true when the value stored in the FPI script is equal to X

fpi scripts are "trigger based" and they use a simple "if/then" type of syntax. In other words, they check the value of predefined conditions to see if they meet a criteria, and then perform an action, based on that value.

STATE is a condition. When you see the condition "STATE=1" in a script, that means that the engine will check the value of STATE to see if it equals 1. If so, the engine continues to process that line, or "statement". If not, the engine moves on to the next statement. So STATE is used to control the progression of the script.

STATE is also an action. When you see the action "STATE=1" in a script, it means that STATE is being given a value of 1. Why, you may ask? In order for us to control the sequence of events using the value of STATE. Like if we want an action to continue while STATE=1 and not to stop until STATE=2.

STATE's position in the script determines whether it is a condition or an action: After the first colon it is a condition and after the second colon it is an action.

:condition:action - or - :state=1:state=2

Understanding this is one thing, but relating or teaching it something completely different. For those who have a background in programming languages, such as Basic, this is a simple concept. For those with no experience, it's like learning another spoken language, even harder if you speak other than English.

The best way to learn this is to take the information here and in Nick's guide, then look at the scripts in your scriptbank folder. Follow the progression in your head and see how each condition is checked and what actions are taken based on the results.

For more on this, see the scripting tutorial in Nickydudes guide. (link above)

best.

I'm sorry, my answers are limited. You must ask the right question.

incense
18
Years of Service
User Offline
Joined: 25th Nov 2005
Location:
Posted: 29th Jun 2007 18:32
So it's kind like a state of being.

State of standing, State of sitting, State of insanity.

Thats one of the few things that I understand about scripting.

Now all I have to do is get a handle on calling animations in a script. I have been banging my head against that wall since I got FPSC.

I tried using the entity maker and that should have been simple. If you knew me you would know why that didn't go as planned.

Just a list of commands don't help me and the generic lay doesn't either. I need to know spicifically how to call the animations of an entity using a script.

I do not wish to highjack this thread. If someone can shed some light on the subject that would be great. Just send me an email or something.

Thanks in advance to the one that helps.

Later

The person that now knows the most started with many questions. Patients and tolorance are the keys to the passage of knowledge. http://gamedesigntech.byethost7.com/

Login to post a reply

Server time is: 2024-11-23 19:04:42
Your offset time is: 2024-11-23 19:04:42