Sargeant Salsa
14 years ago
I currently have a scenario set up where a unit is unmanned. How would I go about triggering an event when someone 'mans' it?

EDIT: Keep in mind that this map will be used in multiplayer, and therefore will need scripts that are multiplayer friendly.
In war, the only salvation is annihilation.
Sponsor
VTULCobra
14 years ago
If a human player is entering it then use this script:
*** IF ***
    Unit 'whatyounamedyourunit' is owned by Player 'player0'
*** THEN ***
  Enable your event.

The "player0" is human slot 1 in the lobby and "player1" is human slot 2 in the lobby, I learned that from a few people here.
Rank up!
NewNightmare
14 years ago
is the 'event' player related ? like you get a building as a bonus? or just like 'a weird cash drop appears' ??
It depends, you can make an originally disabled script (scriptX) and use the mention code to enable it.
*** IF ***
    Unit 'whatyounamedyourunit' is owned by Player 'player0'
*** THEN ***
  Enable scriptX.
Now, depending on your type of event, you can go
*** IF ***
    Unit 'whatyounamedyourunit' is owned by Player 'player0'
OR
    Unit 'whatyounamedyourunit' is owned by Player 'player1'
OR
    Etc..
*** THEN ***
  Enable scriptX.
[/code]
Or you have to go
*** IF ***
    Unit 'whatyounamedyourunit' is owned by Player 'player0'
*** THEN ***
  Enable scriptX0.

*** IF ***
    Unit 'whatyounamedyourunit' is owned by Player 'player1'
*** THEN ***
  Enable scriptX1.

Etc, and make scripts for each player. you might also have to add a disable script option, so the event does not re-appear when you e.g. re-capture the unit with a Hijacker.
Simply add

Disable 'Name of the trigger script1'
Disable 'Name of the trigger script2'
Etc. 
at the end of the ***THEN*** path. Ofc with a slight change in names each time.