HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Computer's hero realy don't want move

04-14-2009, 05:37 AM#1
Magissia
This trigger shoul order to a an unit(Hpal) to patrol from his current position to an random point.

Trigger:
Bot1Patrol1
Collapse Events
Time - Every 30.00 seconds of game time
Conditions
Collapse Actions
Set Bot_Order = (Random real number between 1.00 and 4.00)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order == 1.00
Collapse Then - Actions
Unit - Order Paladin 0224 <gen> to Patrouille vers (Center of SPAWN sud ouest 1 <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order == 2.00
Collapse Then - Actions
Unit - Order Paladin 0224 <gen> to Patrouille vers (Center of SPAWN sud est 3 <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order == 3.00
Collapse Then - Actions
Unit - Order Paladin 0224 <gen> to Patrouille vers (Center of SPAWN nord 1 <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order == 4.00
Collapse Then - Actions
Unit - Order Paladin 0224 <gen> to Patrouille vers (Center of SPAWN nord est 1 <gen>)
Else - Actions

But this unit just stay and don't want to move ...

What i've done wrong in my trigger?
04-14-2009, 05:46 AM#2
0zyx0
You are using a random real number. If you use an integer, it will work. Also, the trigger leaks locations.
04-14-2009, 01:40 PM#3
Magissia
I know it leaks, if a trigger don't work à don't try to make it leakless :p

I'll try interger thanks you
04-14-2009, 02:08 PM#4
Magissia
Trigger:
Bot1Patrol1
Collapse Events
Time - Every 180.00 seconds of game time
Conditions
Collapse Actions
Game - Display to (All players) the text: Action
Set Bot_Order = (Random integer number between 1 and 4)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order ==* 1
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN sud ouest 1 <gen>)
Unit - Order Paladin 0224 <gen> to Patrouille vers Temp_pos1
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order == 2
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN nord 1 <gen>)
Unit - Order Paladin 0224 <gen> to Patrouille vers Temp_pos1
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order Egal ==* 3
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN nord est 1 <gen>)
Unit - Order Paladin 0224 <gen> to Patrouille vers Temp_pos1
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order Egal ==* 4
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN sud est 1 <gen>)
Unit - Order Paladin 0224 <gen> to Patrouille vers Temp_pos1
Collapse Else - Actions
Do nothing
Custom script: call RemoveLocation( udg_Temp_pos1 )

Should be leakless?
04-14-2009, 02:45 PM#5
0zyx0
Yes, that should be leakless, unless Temp_pos1 was set to a location that wasn't removed properly before this trigger ran. By the way, you should make it like this:


Trigger:
Bot1Patrol1
Collapse Events
Time - Every 180.00 seconds of game time
Conditions
Collapse Actions
Game - Display to (All players) the text: Action
Set Bot_Order = (Random integer number between 1 and 4)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order ==* 1
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN sud ouest 1 <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order == 2
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN nord 1 <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order Egal ==* 3
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN nord est 1 <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Bot_Order Egal ==* 4
Collapse Then - Actions
Set Temp_pos1 = (Center of SPAWN sud est 1 <gen>)
Else - Actions
Unit - Order Paladin 0224 <gen> to Patrouille vers Temp_pos1
Custom script: call RemoveLocation( udg_Temp_pos1 )
04-14-2009, 04:55 PM#6
Magissia
Okay, thanks !