Zscript allows you to define normal variables and access them directly.
For example you can define a custom integer inside your actor like this:You can also specify a variable as a user variable by adding this prefix: user_
Doing so will allow you to set that variable in a map editor per thing basis.
ZScript also allows you to do other things with variables that Decorate can't do, such as define them inside weapons (however then you will have to access them with the invoker pointer within states (invoker.myvar)) as well as define them as custom properties, like so:
For example you can define a custom integer inside your actor like this:
Code:
Class MyActor : Actor{int myvar; //This is a custom integer variableDefault{//Custom variables go outside any blocks like Default{}}States{Spawn:TNT1 A 1 A_JumpIf(myvar == 5, "VariableState"); //You can do custom jumps using variables like thisLoop;VariableState:TNT1 A 0 {myvar = 0;} //And change them like so, any math function will work hereGoto Spawn;}}
Doing so will allow you to set that variable in a map editor per thing basis.
ZScript also allows you to do other things with variables that Decorate can't do, such as define them inside weapons (however then you will have to access them with the invoker pointer within states (invoker.myvar)) as well as define them as custom properties, like so:
Code:
Class MyActor : Actor{int myvar;property MyVariable : myvar; //This is how you define a propertyDefault{MyActor.MyVariable 5; //And then you can change it like any other}}
Statistics: Posted by Jarewill — Mon Dec 23, 2024 3:29 pm