Why wont units follow the trigger rules?!

excis

Member
Reaction score
1
Hi, I got a problem, I created a trigger that ordered a unit to cast chain lightning every 30 seconds after he has been attacked. It works..If i have Fixed player settings off in Force Properties but if i have it on he casts it whenever he well pleases aslong there are units around him. Isnt there someway to make units follow the triggers even if you have Fixed player settings on? Because if i have it off any player can be that slot and it's supposed to be a computer slot.

Really need help...
 

jig7c

Stop reading me...-statement
Reaction score
123
events
every 30 seconds...
conditions
actions
set group = (units matching <your unit type>)
pick every unit in group
loop
give chain lightning to picked unit
order picked unit to chain lightning (some unit)
remove chain lightning form picked unit...
call destroygroup (udg_group)

thats it
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
I'm assuming this unit is controlled by the computer? It has to do with the AI of the unit. Giving holy light to a unit will make it use it if it has mana and a unit is low on health.
 

excis

Member
Reaction score
1
events
every 30 seconds...
conditions
actions
set group = (units matching <your unit type>)
pick every unit in group
loop
give chain lightning to picked unit
order picked unit to chain lightning (some unit)
remove chain lightning form picked unit...
call destroygroup (udg_group)

thats it

when i try to write call destroygroup (udg_group) in custom script (i assume its where you are supposed to write it) it pops up a error message like expecting function name and turns off the trigger.
 

SanKakU

Member
Reaction score
21
Hi, I got a problem, I created a trigger that ordered a unit to cast chain lightning every 30 seconds after he has been attacked. It works..If i have Fixed player settings off in Force Properties but if i have it on he casts it whenever he well pleases aslong there are units around him. Isnt there someway to make units follow the triggers even if you have Fixed player settings on? Because if i have it off any player can be that slot and it's supposed to be a computer slot.

Really need help...

i think i ran into a problem like that. i gave up on ai because i didn't understand why it wasn't working. it kindof sounds like you figured out more than i did :/
 

excis

Member
Reaction score
1
Anyone know why call DestroyGroup(udg_group) doesn't work or does it have something to do which variabel you choosed?
 

jig7c

Stop reading me...-statement
Reaction score
123
call | function | variable

function: DestroyGroup
variable: whatever you want to call it.. call it group, or hippo, or %, or -1... its just a name of that variable...

Trigger:
  • custom script: call DestroyGroup (udg_var_name)
 

excis

Member
Reaction score
1
events
every 30 seconds...
conditions
actions
set group = (units matching <your unit type>)
pick every unit in group
loop
give chain lightning to picked unit
order picked unit to chain lightning (some unit)
remove chain lightning form picked unit...
call destroygroup (udg_group)

thats it

I got the custom script to work now :) but i wonder if the trigger really works isnt it supposed to give the ability cast it and remove it every 30 seconds? Because when he gets it he can cast it whenever he want. Here is my trigger, could have done something wrong. The reason i have wait is because it's a 3 sec cast time on it
Trigger:
  • Chain Breath
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set group = (Units of type Drephinos [Dragon])
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Unit - Add Chain breath of Frost to (Picked unit)
          • Unit - Order (Picked unit) to Orc Far Seer - Chain Lightning (Random unit from (Units in Deep breath Region &lt;gen&gt; matching (((Triggering unit) belongs to an enemy of Player 12 (Brown)) Equal to True)))
          • Wait 4.00 seconds
          • Unit - Remove Chain breath of Frost from (Picked unit)
          • Custom script: call DestroyGroup(udg_group)
 

excis

Member
Reaction score
1
Even if i use this trigger with the custom script as the first action he casts it whenever he wants after 15 sec
Trigger:
  • Chain Breath
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Set group = (Units of type Drephinos [Dragon])
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Custom script: call DestroyGroup(udg_group)
          • Unit - Add Chain breath of Frost to (Picked unit)
          • Unit - Order (Picked unit) to Orc Far Seer - Chain Lightning (Random unit from (Units in Deep breath Region &lt;gen&gt; matching (((Triggering unit) belongs to an enemy of Player 12 (Brown)) Equal to True)))
          • Wait 4.00 seconds
          • Unit - Remove Chain breath of Frost from (Picked unit)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top