Won't kill unit

D.V.D

Make a wish
Reaction score
73
Yea, Im just starting to make a ability from scratch and basically outlining were the actions and all will be. Well, I want to know, I tried so many different things to make this work but one of the units I make won't die. The charge(unit[0] won't die. Code:
Code:
Big Bang Attack
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Big Bang Attack 
    Actions
        Set u[2] = (Triggering unit)
        Set p[0] = (Position of u[2])
        Set p[1] = (p[0] offset by 100.00 towards (Facing of u[2]) degrees)
        Unit - Pause u[2]
        Unit - Create 1 Big Bang Attack Charge for (Owner of u[2]) at p[1] facing p[0]
        Set u[0] = (Last created unit)
        Unit - Add a 2.00 second Generic expiration timer to u[0]
        Unit - Create 1 Big Bang Attack Ball for (Owner of u[2]) at p[1] facing p[0]
        Set u[1] = (Last created unit)
        Set size = 100.00
        For each (Integer A) from 1 to 20, do (Actions)
            Loop - Actions
                Set size = (size + 10.00)
                Animation - Change u[1]'s size to (size%, size%, size%) of its original size
                Wait 0.10 seconds
        Unit - Unpause u[2]
        Trigger - Turn on Untitled Trigger 001 <gen>
        Wait 2.00 seconds
        Trigger - Turn off Untitled Trigger 001 <gen>
        Unit - Create 1 Big Bang Attack Explode for (Owner of u[2]) at (Position of u[1]) facing (Position of u[1])
        Unit - Kill u[1]
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_p[0])
        Custom script:   call RemoveLocation(udg_p[1])
        Custom script:   call RemoveLocation(udg_p[2])
        Custom script:   call RemoveLocation(udg_p[4])

Code:
Untitled Trigger 001
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set p[4] = (Position of u[1])
        Set p[2] = (p[4] offset by 9.00 towards ((Facing of u[2]) - 0.00) degrees)
        Unit - Move u[1] instantly to p[2]
 

yunusowic

New Member
Reaction score
7
i cant see any mistakes here.

Trigger:
  • Unit - Add a 2.00 second Generic expiration timer to u[0]


Try puttin this under
Trigger:
  • Set u[0] = (Last created unit)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
well for the first you triggers leak like %#!& and lets starts by cleaning that up ...

Add these Custom Scripts at the end of the first trigger:

call RemoveLocation(udg_p[1])

call RemoveLocation(udg_p[0])

then you need to set this:

Code:
(Position of u[1])
into a variable as well, and then use this custom script to remove the leak:

call RemoveLocation(udg_p[3]) <-- if that what you variable name is XD

and for the second trigger you need 2 point variables, one for (Position of u[1]) and one for offset by ... and then remove those leaks too.
 

D.V.D

Make a wish
Reaction score
73
Cleaned up the code, put the timer after he is set. Still won't work.
 

D.V.D

Make a wish
Reaction score
73
No revival system and the unit doesn't die because its animation doesn't reset.
 

ShadowInTheD

Active Member
Reaction score
12
Umm, I don't think you ever killed u[0], and you killed u[1] twice..

Edit: Never mind, you only killed u[1] once.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Yeah dude, you didnt EVEN put a kill u[0]

Edit: sorry didn't see the expiration timer
 
General chit-chat
Help Users

      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