Quote: "I have got the edit pad but all this sate1:state10 things dont make sense"
Really,if you say so, oh wise one...
If you can't understand this,how will you ever understand programming languages (not to mention low-level ones...)
In a script , on each row there's an
ACTION and a
CONDITION. The CONDITION comes BEFORE the ACTION.It is always wrapped around in
colons ( : ).You can have multiple conditions on the same row,you just have to divide each condition with a
comma ( , )
Same thing goes for the ACTIONS.You can write as many on one row as you like,you just have to divide them with commas(note:after the last condition or action,there shouldn't be a comma)
States are like pointers ,telling the engine to which part of the script to go.States can be both conditions and actions(self-explanatory why..).The initial state number for every script is 0 and you can set it to whatever you like.The whole script is in a constant loop,so if you don't change the state,the engine will repeat the line with the current state until you close the program(or move to another level).
For example -
:state=0:if the current state of the script is equal to 0,then return true and perform actions here
Simple example of states -
Quote: "
:state=0,plrdistwithin=100:plraddhealth=-25,state=1
"
This piece of "code" translates into plain English like this :
*If the current state is equal to 0(zero) AND the player is within a distance of 100 units(1 segment in radius) , then substract 25 points from his health and change the current state to 1,so that the substraction is done only once.Once the state is equal to 1,nothing will be executed , because there are no conditions checking if the state is equal to 1 and no respective actions given,if true is returned on that condition.
Does this help ?
PC Specs:Windows 7 Ultimate 64-bit,Intel Core i7 960 @ 3.20GHz,NVIDIA GeForce GTX 480,12GB RAM,2x Western Digital 997GB HDD