Scripting
Different types of ways of scripting.
If else.
If else is exactly what it says, If one thing does not happen do something else for example:
if (door is closed)
{open it}
else
{walk through}
This is saying if the door is closed, i need to open it but if it is not closed, i just walk through it.
In scripting this is saying.
if() <<< Normally you put a statement in there and read it like a sentence. so imagine the () are not there, it would say
if door is closed, its asking you/telling you the door is closed and what you should do next.
{} <<< This is the action, telling you what to do.
So in the script above inside the {} it says open it, so its telling you to open it.
else <<< this is used incase one of the actions is false and does not work so like if the door is closed and the first action says walk through door and there is no other action, the character will just walk and faceplant the door, so the else will ignore the one action and do the other. in this case he will open the door then walk through.
What do the symbols mean??
I I = Or
&&= And
< = Less than
> = Greater than
= = Equals
== = Equals to?
Flowchart version of scripting.
No comments:
Post a Comment