• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Timed hero soul theft and release

Status
Not open for further replies.
Level 1
Joined
Dec 3, 2007
Messages
3
Hi, I have a script that operates on "Unit Casts Ability Targeting Hero" for "Item Soul Theft." This works in such a way that certain units can cast soultrap on enemy heroes, and the hero will be moved to a special area, made invulnerable, and a timer will start counting down until the hero is returned to the game. However, my foray into using timer arrays and timer windows was a fiasco: not only did the hero not get released when the timer ran out, but the timer window remained visible even after being told to destroy. Can someone please just give me a few tips on how I should go about setting up a trigger to time and release the hero that will work for what I'm trying to do?
 
Level 1
Joined
Dec 3, 2007
Messages
3
That's not what I was asking. I asked for tips about making a trigger that would do the time and release part. I completely scrapped my old timer system, and I just need help with a working way to set up a release system. I don't know what I should be aiming for -- do I need to hardcode triggers for every player color? Should I use individual timers or a timer array? How should I handle creating and destroying timer windows? Et cetera.
 
Level 2
Joined
Dec 2, 2007
Messages
22
Ohhh...i understand.

Maybee you can use variables of timers & windows...

i will try to understand a make a little example.

  • Capture
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YOUR_ABILITY
    • Actions
      • Unit - Move (Triggering unit) instantly to (Center of (YOUR REGION))
      • Game - Display to (All players) the text: ((Name of (Owner of (Target unit of ability being cast))) + has been captured !)
      • Countdown Timer - Start timer[(Player number of (Owner of (Target unit of ability being cast)))] as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for timer[(Player number of (Owner of (Target unit of ability being cast)))] with title (Name of (Owner of (Target unit of ability being cast)))
In start i THINK

  • Start
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to (Number of players), do (Actions)
        • Loop - Actions
          • Trigger - Add to Release <gen> the event (Time - timer[(Integer A)] expires)
That's my idea to capture, releasing i cant get it...let me think.
 
Level 9
Joined
May 27, 2006
Messages
498
Casting Banish spell on target unit of ability is better idea than moving a hero to special area... Just add trigger, that creates dummy unit with banish, make targeted unit invulnerable and set its movement speed to 0.

  • Banish / Soul Steal
    • Events
      • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Banish (or any other targeted ability)
      • Actions
        • Set TempPoint = (Position of (Triggering unit))
        • Unit - Create 1 dummy for (Owner of (Triggering unit)) at TempPoint facing some degrees.
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Unit - Add Banish to (Last Created unit)
        • Unit - Add 5 seconds generic timer to (Last Created unit).
        • Unit - Order (Last Created unit) to Human - Blood Mage (?) - Banish (Target unit of ability being cast)
        • Unit - Make (Target unit of ability being cast) Invulnerable.
        • Set UnitMS[(Player number of (Owner of (Target unit of ability being cast)))] = (Movement speed of (Target unit of ability being cast))
        • Unit - Set (Target unit of ability being cast) movement speed to 0.
        • Set HeroPlayer[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
        • Game - Display to (All players) the text: ((Name of (Owner of (Target unit of ability being cast))) +`s soul has been captured !)
        • Countdown Timer - Start timer[(Player number of (Owner of (Target unit of ability being cast)))] as a One-shot timer that will expire in 30.00 seconds
        • Countdown Timer - Create a timer window for timer[(Player number of (Owner of (Target unit of ability being cast)))] with title (Name of (Owner of (Target unit of ability being cast)))
        • Set CountdownTimerWindow[(Player number of (Owner of (Target unit of ability being cast)))] = (Last Created Timer window)
        • Wait 30 seconds.
        • For each (Integer A) from 1 to 10, do (Unit - Make HeroPlayer[(Integer A)] Vulnerable.
        • For each (Integer A) from 1 to 10, do (Unit - Set HeroPlayer[(Integer A)] to UnitMS[(Integer A)]
        • For each (Integer A) from 1 to 10, do (Countdown Timer - Destroy CountdownTimerWindow[(Integer A)])
Im not sure if actions after the wait line will work, mostly about this one setting movement speed back to normal... But you can always use additional dummy with Slow spell (100% lower movement speed [or 1000%, to be sure it`ll work :p]) or, as far as i remember, change the speed percent value in Banish spell, with 30 seconds lasting effect.
 
Last edited:
Level 1
Joined
Dec 3, 2007
Messages
3
Thanks guys! RaMMz's is pretty much what I had, except it doesn't handle destroying expired timer windows (which I'm still having trouble with)

Raft, I'll try out using banish to get rid of the soul theft, but what was most helpful was your script on creating and destroy timer windows; I'll see if I can get it working now!
 
Status
Not open for further replies.
Top