Which is easier?

MicroSheep

New Member
Reaction score
3
I'm making a spawning trigger, and im making it so that every 5 seconds of gametime, if the spawned unit hasnt been attacked, it is removed from the game.

I want to make it so that the unit is capable of changing ownership too, so i dont think expiration timers will work here.

Is an expiration timer or adding it to a unit group, then picking every unit in the unit group and removing it easier?
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
make 2 triggers one that picks attacked unit and the other that checks if attacked units are the ones you spawned
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
easiest way:

Trigger:
  • trigger1
    • events
      • every x seconds of game time
    • condition
    • actions
      • unit - create 1 footman for player x at <point>
      • unit group - add last created unit to TempGroup


Trigger:
  • trigger2
    • events
      • every 1 seconds of game time
    • condition
    • actions
      • unit group - pick every unit in TempGroup and do actions
        • unit - set the custom value of picked unit to custom value of picked unit + 1
        • if custom value of picked unit equal to or greater than 5 then
          • unit - remove picked unit from the game


Trigger:
  • trigger3
    • events
      • unit - unit is attacked
    • condition
      • triggering unit is in TempGroup equal to true
    • actions
      • unit - set the custom value of triggering unit to 0


I want to make it so that the unit is capable of changing ownership too

I'm not sure what you mean by that... does the unit change ownership once he's attacked or?
 

MicroSheep

New Member
Reaction score
3
easiest way:

Trigger:
  • trigger1
    • events
      • every x seconds of game time
    • condition
    • actions
      • unit - create 1 footman for player x at <point>
      • unit group - add last created unit to TempGroup


Trigger:
  • trigger2
    • events
      • every 1 seconds of game time
    • condition
    • actions
      • unit group - pick every unit in TempGroup and do actions
        • unit - setcustom value of picked unit to custom value of picked unit + 1
        • if custom value of picked unit equal to or greater than 5 then
          • unit group - remove picked unit from the game


Trigger:
  • trigger3
    • events
      • unit - unit is attacked
    • condition
      • triggering unit is in TempGroup equal to true
    • actions
      • unit - set the custom value of triggering unit to 0




I'm not sure what you mean by that... does the unit change ownership once he's attacked or?

umm its a pokemon map so when he casts a spell, it changes ownership to the owner of casting unit and it becomes a variable, so an expiration timer wont work since it cant be removed.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
something like this?

Trigger:
  • trigger1
    • events
      • unit - unit starts the effect of an ability
    • conditions
      • target unit of ability being cast is in TempGroup equal to true
      • ability being cast equal to <catch?>
    • actions
      • unit group - remove target unit of ability being cast from TempGroup
      • unit - change owner of target unit of ability being cast to owner of triggering unit
 

MicroSheep

New Member
Reaction score
3
Okay it works, but i just wish i could make it so that each unit stays on for 8 seconds instead of being able to be on for 2 or so seconds.
 
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