a shot ability

Enki

New Member
Reaction score
0
Hello. I'm living a problem with an ability. If i shoot the ability more than one other arrows stops moving. Here is my the triggers. And yea i know they leak. I'm gonna take care of them later.

Code:
shot
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Shot 
    Actions
        Set Shot_Damage = 100.00
        Set Shot_Caster = (Casting unit)
        Set Shot_Caster_Point = (Position of Shot_Caster)
        Set Shot_Target_Point = (Target point of ability being cast)
        Set Shot_Angle = (Angle from Shot_Caster_Point to Shot_Target_Point)
        Set Shot_Array = 1.00
        Unit - Create 1 dummyarrow for Neutral Passive at Shot_Caster_Point facing Shot_Angle degrees
        Set Shot_Arrow = (Last created unit)
        Unit - Add a 6.00 second Generic expiration timer to Shot_Arrow
        Countdown Timer - Start Shot_Timer as a One-shot timer that will expire in 0.01 seconds
        Trigger - Add to shotdmg <gen> the event (Unit - A unit comes within 32.00 of Shot_Arrow)

Code:
shotmove
    Events
        Time - Shot_Timer expires
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set Shot_Loc = (Shot_Caster_Point offset by Shot_Array towards Shot_Angle degrees)
        Unit - Move Shot_Arrow instantly to Shot_Loc
        Set Shot_Array = (Shot_Array + 15.00)

Any help is appreciated. Regards.
 

Yoww89

New Member
Reaction score
0
Well, your problem is to turn your ability into a MUI ability. I have done one just like yours and it wasn't so easy, i had to use arrays, unit groups and loop actions.
Maybe someone has a better idea for you?

By the way, what's the purpose of that timer? o.o'
 

Happy

Well-Known Member
Reaction score
71
easiest way would be turning your variables into arrays and set an integer variable at the beginning of the trigger in an if/then/else....and in the if then else you check whether the integer (the array number) is equal to 100 for example and if so set it to one if not set it to "IntValue = IntValue + 1". and in the second trigger you just add "from integer A from 1 to 100" ....should work...
 

tommerbob

Minecraft. :D
Reaction score
110
easiest way would be turning your variables into arrays and set an integer variable at the beginning of the trigger in an if/then/else....and in the if then else you check whether the integer (the array number) is equal to 100 for example and if so set it to one if not set it to "IntValue = IntValue + 1". and in the second trigger you just add "from integer A from 1 to 100" ....should work...

Or just use a Hashtable. either way.
 

Enki

New Member
Reaction score
0
Thank you all for your replies. But if anyone could give an easy example that ll be great. :)
 

HydraRancher

Truth begins in lies
Reaction score
197
Hashtables are a better use than some array technique.

If you learn how to use it, it becomes very simple. You just save all the data into a Hashtable of key your unit, and periodically pick every unit that is an arrow and apply effects accordingly.
 
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