makslane wrote:Look the docs:
http://game-editor.com/docs/scripting.htmThe only way to change a internal, or built in, actor variable in a global code is putting some reference, even a comment, in the caller script.
- Code: Select all
- //hours_remaining 
 changeHours(2);
 
I thought that was a misprint in the documentation. I thought comments never affect the compiler. So referencing a control at the beginning of a comment is taken into account by the compiler and that affects the actor?
I think I understand but it seems strange. Would it be possible to have something more explicit in the code other than a comment, say:
- Code: Select all
- #SCOPE hours_remaining
 changeHours(2);
 
... that would not use a comment? What about comments that have actor names embedded in them accidentally, say ...
- Code: Select all
- // this function is called by the hours_remaining label
 changeHours(2);
 
... and how do you reference each clone in a group with similar syntax if you are iterating through a set of clones and setting some property in each, like in a for-next loop in a piece of global code? You could not add comments for each and every clone ...
- Code: Select all
- // hours_remaining.0
 // hours_remaining.1
 // hours_remaining.2
 // hours_remaining.3
 // hours_remaining.4
 for(i = 0;i < numberOfActors;i++)
 {
 DoSomething(ActorName(i));
 } ... etc.
 
I always thought that was a misprint in the documentation because I thought all compilers ignore comments unless they have special syntax.