Unit Gain Ability

blurished

Active Member
Reaction score
1
simply put there will be a region,
if a unit enters it, it will gain an ability after XX amount of time,
but if it leaves b4 that time is up, it does not gain the ability
so yeah


can u explain to me how to do this in GUI posibbly?

thx in advance
 

Moridin

Snow Leopard
Reaction score
144
This should be pretty easy to do via triggers. (GUI)

Note that the following triggers are freehand, so the text might not be exactly correct:

Trigger:
  • Enter Region
    • Events
      • Unit - A unit enters <Region>
    • Condition
    • Actions
      • Countdown timer - Start Timer as a One-Shot countdown timer that expires in 10 seconds
      • Trigger - Switch on Give Ability
      • Trigger - Switch on Exit Region


Trigger:
  • Exit Region
    • Events
      • Unit - A unit exits <Region>
    • Conditions
    • Actions
      • Trigger - Switch off Give Ability
      • Trigger - Switch off this trigger


Trigger:
  • Give Ability
    • Events
      • Timer - Timer expires
    • Conditions
    • Actions
      • Unit - Add <Ability> To Unit_Variable
 

Nherwyziant

Be better than you were yesterday :D
Reaction score
96
This should be pretty easy to do via triggers. (GUI)

Note that the following triggers are freehand, so the text might not be exactly correct:

Trigger:
  • Enter Region
    • Events
      • Unit - A unit enters <Region>
    • Condition
    • Actions
      • Countdown timer - Start Timer as a One-Shot countdown timer that expires in 10 seconds
        • Trigger - Switch on Give Ability
        • Trigger - Switch on Exit Region


Trigger:
  • Exit Region
    • Events
      • Unit - A unit exits <Region>
    • Conditions
    • Actions
      • Trigger - Switch off Give Ability
      • Trigger - Switch off this trigger


Trigger:
  • Give Ability
    • Events
      • Timer - Timer expires
    • Conditions
    • Actions
      • Unit - Add <Ability> To Unit_Variable

Maybe this may cause bugs?
 

mapguy

New Member
Reaction score
46
there is no switch on, there is turn on trigger.

try this:

Code:
a unit enters regionX

-put your conditions here-

set x = position of triggering unit.
create 1 dummy timer for owner of triggering unit at X
add 4 seconds generic expiration timer to last created unit.
set real = real + 1
set unit[real] = triggering unit
set dummy[real] = last created unit
add custom value for last created unit = real.
add triggering unit to gain_ab_group

Code:
A unit dies

unit type = dummy timer

add ability to unit[custom value of triggering unit].
remove unit from gain_ab_group

Code:
A unit leaves region.

unit is in gain_ab_group

remove dummy[index value of unit[]] from the game
remove triggering unit from gain_ab_group

Code:
A unit leaves region.

unit is in gain_ab_group equal to false

remove your ability from triggering unit
 

mapguy

New Member
Reaction score
46
do you know what`s MUI ?
if the trigger is not MUI your map will have bugs if the trigger is activated twice before the effect shows itself.
 

Moridin

Snow Leopard
Reaction score
144
MUI means multi unit instanceability.

Do you want this set of events to have an effect on multiple units? If yes, then you need MUI or it will, as mapguy said, "have bugs". Otherwise you can stick to non-MUI, which is simpler.
 
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