Trigger

Crofna

New Member
Reaction score
0
How to make this kind of trigger:
If a <Unit1> enter <Region>, <Units2> will be replaced with <Units3> and <Player> will get control of that units.

I hope that its possible to create.
 

Joccaren

You can change this now in User CP.
Reaction score
54
Yes its possible and its basically done how you said:

Event: Unit (Your Unit) Enters Region
Conditions:
Actions: Replace (Unit 2) with (Unit 3)
Change owner of (Last Replaced Unit) to (Your Player)
 

Crofna

New Member
Reaction score
0
Is it gonna work: (Post edited)

Trigger:
  • Call to Arms
    • Events
      • Unit - A unit enters Region 001 &lt;gen&gt;
    • Conditions
      • (Region 001 &lt;gen&gt; contains Sylvanas Windrunner 0324 &lt;gen&gt;) Equal to True
    • Actions
      • Unit - Replace High Elf (Male) 0206 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Male) 0207 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Male) 0208 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Female) 0209 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Female) 0210 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Female) 0457 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Unit - Change ownership of (Picked unit) to Player 1 (Red) and Change color
 

The-Shadows

New Member
Reaction score
12
Is it gonna work: (Post edited)

Trigger:
  • Call to Arms
    • Events
      • Unit - A unit enters Region 001 &lt;gen&gt;
    • Conditions
      • (Region 001 &lt;gen&gt; contains Sylvanas Windrunner 0324 &lt;gen&gt;) Equal to True
    • Actions
      • Unit - Replace High Elf (Male) 0206 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Male) 0207 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Male) 0208 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Female) 0209 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Female) 0210 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Unit - Replace High Elf (Female) 0457 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Unit - Change ownership of (Picked unit) to Player 1 (Red) and Change color

its not working.
"(Picked unit)" only works for Unit Group.

attach each of unit you want to place with variables
Code:
Unit - Replace High Elf (Male) 0206 <gen> with a Swordsman using The new unit's max life and mana
Set Variable - Unit[1] = last replaced unit

Unit - Replace High Elf (Male) 0207 <gen> with a Swordsman using The new unit's max life and mana
Set Variable - Unit[2] = last replaced unit

.....

repeat until
Set Variable - Unit[6] = last replaced unit

them make a loop
Code:
Loop [Integer A] from 1 to 6
- Unit - Change ownership of (Unit[Integer A]) to Player 1 (Red) and Change color

sorry i lazy to open WE
 

The-Shadows

New Member
Reaction score
12
i dont get him wether he want trigger on the entering unit or specific player, he used player 1.

or both it must be owner of "entering unit"
 

Crofna

New Member
Reaction score
0
Wich part you dont understand? I want:
When windrunner come there, all neutral villagers will became troops and windrunner will get control of that units. I will try to see what can i do with

Unit - Replace High Elf (Male) 0206 <gen> with a Swordsman using The new unit's max life and mana
Set Variable - Unit[1] = last replaced unit

Unit - Replace High Elf (Male) 0207 <gen> with a Swordsman using The new unit's max life and mana
Set Variable - Unit[2] = last replaced unit

.....

repeat until
Set Variable - Unit[6] = last replaced unit

EDIT:

Trigger:
  • Call to Arms
    • Events
      • Unit - A unit enters Region 001 &lt;gen&gt;
    • Conditions
      • (Region 001 &lt;gen&gt; contains Sylvanas Windrunner 0324 &lt;gen&gt;) Equal to True
    • Actions
      • Unit - Replace High Elf (Male) 0206 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Set Unit = (Last replaced unit)
      • Unit - Replace High Elf (Male) 0207 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Set Unit = (Last replaced unit)
      • Unit - Replace High Elf (Male) 0208 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Set Unit = (Last replaced unit)
      • Unit - Replace High Elf (Female) 0209 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Set Unit = (Last replaced unit)
      • Unit - Replace High Elf (Female) 0210 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Set Unit = (Last replaced unit)
      • Unit - Replace High Elf (Female) 0457 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Set Unit = (Last replaced unit)
      • Unit - Change ownership of Unit to Player 3 (Teal) and Change color


Is it working?
 

Avaleirra

Is back. Probably.
Reaction score
128
No, now your just overriding it every time you set the same variable. Change the variable to an array then set your first unit to unit(1), second unit to unit(2), etc.
 

Crofna

New Member
Reaction score
0
Like this?
Trigger:
  • Call to Arms
    • Events
      • Unit - A unit enters Region 001 &lt;gen&gt;
    • Conditions
      • (Region 001 &lt;gen&gt; contains Sylvanas Windrunner 0324 &lt;gen&gt;) Equal to True
    • Actions
      • Unit - Replace High Elf (Male) 0206 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Set Unit[1] = (Last replaced unit)
      • Unit - Replace High Elf (Male) 0207 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Set Unit[2] = (Last replaced unit)
      • Unit - Replace High Elf (Male) 0208 &lt;gen&gt; with a Swordsman using The new unit&#039;s max life and mana
      • Set Unit[3] = (Last replaced unit)
      • Unit - Replace High Elf (Female) 0209 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Set Unit[4] = (Last replaced unit)
      • Unit - Replace High Elf (Female) 0210 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Set Unit[5] = (Last replaced unit)
      • Unit - Replace High Elf (Female) 0457 &lt;gen&gt; with a Archer using The new unit&#039;s max life and mana
      • Set Unit[6] = (Last replaced unit)
      • Unit - Change ownership of Unit[1] to Player 3 (Teal) and Change color
      • Unit - Change ownership of Unit[2] to Player 3 (Teal) and Change color
      • Unit - Change ownership of Unit[3] to Player 3 (Teal) and Change color
      • Unit - Change ownership of Unit[4] to Player 3 (Teal) and Change color
      • Unit - Change ownership of Unit[5] to Player 3 (Teal) and Change color
      • Unit - Change ownership of Unit[6] to Player 3 (Teal) and Change color
 

The-Shadows

New Member
Reaction score
12
it may working..

besides, you can shorten your trigger by making like this

Code:
Loop [Integer A] from 1 to 6
- Unit - Change ownership of (Unit[Integer A]) to Player 3 (Teal) and Change color

instead

Code:
Unit - Change ownership of Unit[1] to Player 3 (Teal) and Change color 
Unit - Change ownership of Unit[2] to Player 3 (Teal) and Change color 
Unit - Change ownership of Unit[3] to Player 3 (Teal) and Change color 
Unit - Change ownership of Unit[4] to Player 3 (Teal) and Change color 
Unit - Change ownership of Unit[5] to Player 3 (Teal) and Change color 
Unit - Change ownership of Unit[6] to Player 3 (Teal) and Change color
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top