OneBadPsycho
10100111001
- Reaction score
- 93
Hello, I have this problem; whenever my unit enters a region, I wan't him to move to a random region, however it may not move back to the region it came from and may not be sent to the same region as it enters.
I have this trigger:
With this trigger it won't sent the unit to the same region as it enters, unless it is send like this:
The white numbers is the region numbers.
The black arrow indicates that the unit enters region 2. and are sent to region 4.
The red arrow indicates collision with region 1. and the unit is send to another region.
But when it enters region 1. the variable LocI is still 4 and the option of sending the unit to region 1. is still avaible.
Any help on fixing these bugs would be greatly appreciated.
I have this trigger:
Code:
Move
Events
Unit - A unit enters 1 <gen>
Unit - A unit enters 2 <gen>
Unit - A unit enters 3 <gen>
Unit - A unit enters 4 <gen>
Unit - A unit enters 5 <gen>
Conditions
(Unit-type of (Entering unit)) Equal to Footman
Actions
Set LocO = LocI
Custom script: loop
Set LocI = (Random integer number between 1 and 5)
Custom script: exitwhen udg_LocO != udg_LocI
Custom script: endloop
Unit - Order (Entering unit) to Move To Point[LocI]
[COLOR="Red"]Game - Display to (All players) for 1.00 seconds the text: (String(LocI)) [I]//For debugging[/I]
Game - Display to (All players) for 1.00 seconds the text: (|cffff0000 + ((String(LocO)) + |r)) [I]//For debugging[/I][/COLOR]
With this trigger it won't sent the unit to the same region as it enters, unless it is send like this:
The white numbers is the region numbers.
The black arrow indicates that the unit enters region 2. and are sent to region 4.
The red arrow indicates collision with region 1. and the unit is send to another region.
But when it enters region 1. the variable LocI is still 4 and the option of sending the unit to region 1. is still avaible.
Any help on fixing these bugs would be greatly appreciated.