Hi, Heres the issue, have been looking about to see if scripts executed by triggers are always run on ALL computers.
Trigger conditions are evaluated on ALL machines. Due to that, the On Activation field is performed on ALL machines, should the mission designer want that. Most often he/she does and whatever is in the On Activation field is run on ALL machines.
Now, why do I state that in a slightly vague way? Consider this: one can imagine forumulating the
condition so as to make it evaluate to true only for certain computers. Examples:
Example 1 - trigger condition that eventually runs code on all machines(Trigger goes off just after 5 am in the morning)
dayTime>5
Example 2 - trigger condition that will run it's On Activation code on only one machine(Trigger activates on machine where the player calling himself "Joe" is playing)
name player=="Joe"
Heres the activation line of the trigger in question:
[thislist,Town0] exec "Main\SetTownSide.sqs"
Now then, the script here that runs will run on ALL computers, not just the computer of the player that had activated it, correct?
Yes, that is quite possible, again, depending on how the trigger condition is set up.
And lastly, therefore, in the script executed by this trigger, 'player' is a non-usable reference, because it will reference every player, being the script is running on all puters, as also 'local player' would be useless also in the script?
I'm not sure what you mean by "will reference every player". The command
player will return different values on each computer. On computer A,
player will give you a reference to the unit played by Mr A, on computer B you'll get a reference to the unit played by Mrs B and on a dedicated server, the command will return a non-valid value ("scalar bool array....", IIRC). So I wouldn't exactly call it unusable. You just need to keep this in mind depending on what you want to do in the script.
Furthermore, "
local player" will return the value
true on all client (player) computers and
false on the dedicated server.
Ok, that takes care of your first post. Hope it helps!