So... What is the problem of my code?

soulmaka

New Member
Reaction score
2
i have this code below, which when i cast the skill, the units pause permanently.. how can i make that they will only be temporarily paused?

btw: here's the code


Code:
Time Hatcher
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Time Hatcher 
    Actions
        Unit Group - Pick every unit in (Units within 1000.00 of (Target point of ability being cast)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is alive) Equal to True
                        (Unit-type of (Picked unit)) Not equal to Saturn Caster |cffff00ff[Witch]
                    Then - Actions
                        Set Time_Hatcher_PU = (Picked unit)
                        Special Effect - Create a special effect at (Position of Time_Hatcher_PU) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                        Unit - Pause Time_Hatcher_PU
                    Else - Actions
        Wait (Real((Level of Time Hatcher  for (Triggering unit)))) seconds
        Unit Group - Pick every unit in (Units within 1000.00 of (Target point of ability being cast)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is alive) Equal to True
                        ((Picked unit) is paused) Equal to True
                        (Unit-type of (Picked unit)) Not equal to Saturn Caster |cffff00ff[Witch]
                        (Picked unit) Equal to Time_Hatcher_PU
                    Then - Actions
                        Unit - Unpause Time_Hatcher_PU
                    Else - Actions
 

linamus

I r bak!
Reaction score
57
Your trigger is very confusing, could you explain which unit is a caster, and what that ability does?

Otherwise, you simply misplaced the unpause action



p.s - if the caster should not be paused, you might just use this:

Unit Group - Pick every unit in (Units in (Region centered at (Target point of ability being cast) with size (1000.00, 1000.00)) matching (((Region centered at (Target point of issued order) with size (1000.00, 1000.00)) contains (Matching unit)) Equal to False)) and do (Actions)
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
You can't use (Target point of ability being cast) after a wait. You should save that to a variable.

Actually, you ought to save the unit group to a variable in order to be sure you unpause the same units, and waits in general aren't good to use. A timer is more accurate and matches the game speed, unlike a wait.

Also, you leak a special effect, and two groups and a point twice. You should read up on memory leaks over in the Tutorials forum.
 

c-sejker

New Member
Reaction score
0
First of all its not MUI, which can bug it. And When you unpause, you say it should unpause: Time_Hachter_PU. You have to change that to unpause picked unit
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
c-sejker should work unless u plan on using it multiple times in the duration or possibly having multiple units that can cast it ie: if 2 players have this unit/hero

if u dont plan on having the cooldown lower than the duration set time_hatcher_pu to have an array of 1 and set it to: set time_hatcher_pu [player number of (owner of (casting unit))] = picked unit
then unpause the same variable

if u plan on using it with one player multiple times in the duration...
set (integer) pu_group = pu_group + 1
set time_hatcher_pu [pu_group (index)] = picked unit
then it changes the index of time hatcher every time u cast it
 

evilwolf

Member
Reaction score
11
It's simple...
Move all your else actions to your then actions...
It should work...
The else action means that what will the trigger do if the conditions are false...
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
lol evilwolf, ur right but thats just 1 problem with it...
 
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