Difference between revisions of "Scripting Tutorial: Basic Scripting Knowledge"

m
imported>JOG
imported>JOG
Line 36: Line 36:
== 3. [[:Category:References|References]] and [[:Category:Variables|Variables]] ==
== 3. [[:Category:References|References]] and [[:Category:Variables|Variables]] ==


Functions affect the "calling object" (That on which the script is running) by default, but you can redirect them to another object by using the object's reference. When you want a script to affect the player for example, use the player's reference ("Player") and a '.' to redirect the function-call to the player instead of the calling object.
Functions affect the "calling object" (That on which the script is running) by default, but you can redirect them to another object by using the object's [[:Category:References|reference]]. When you want a script to affect the player for example, use the player's reference ("Player") and a '.' to redirect the function-call to the player instead of the calling object.


  player.additem gold_001 100
  player.additem gold_001 100




You can also use variables instead of numeric values required by a function.
To gain more flexibility, you can use [[:Category:Variables|variables]] instead of numeric values whenever a function requires such input.


  short addgold
  short addgold
Anonymous user