• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] spell about disguise into an enemy?

Status
Not open for further replies.
Level 3
Joined
Jun 17, 2015
Messages
53
Hi everyone, i was interested of TF2's Spy that he can turn himself into an enemy treat as enemy's ally. So i decided to make a spell based on it, when im testing. Sometimes it cant create the target unit, and i dont know what's wrong here :(

  • Disguise
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Disguise
    • Actions
      • Set Disguise_User = (Triggering unit)
      • Set Disguise_Loc = (Position of Disguise_User)
      • Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for (Owner of (Target unit of ability being cast)) at Disguise_Loc facing (Facing of (Target unit of ability being cast)) degrees
      • Set Disguise_Dummy = (Last created unit)
      • Unit - Add a 120.00 second Generic expiration timer to Disguise_Dummy
      • Unit - Add Locust to Disguise_Dummy
      • Unit - Remove 'Aatk' (Attack) from Disguise_Dummy
      • -------- INVISIBLE --------
      • Unit - Create 1 Craggy Exterior Dummy for (Owner of Disguise_User) at Disguise_Loc facing Default building facing (270.0) degrees
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Unit - Add Disguise [Invi] to (Last created unit)
      • Unit - Order (Last created unit) to Human Sorceress - Invisibility Disguise_User
      • Trigger - Turn on Disguise Timer <gen>
      • Trigger - Turn on Disguise Moves <gen>
      • Trigger - Turn on Disguise Attacks <gen>
      • Custom script: call RemoveLocation (udg_Disguise_Loc)
  • Disguise Timer
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set Disguise_Loc = (Position of Disguise_User)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Disguise_Dummy is dead) Equal to (==) True) or ((Disguise_User has buff Disguise ) Not equal to (!=) True)
          • Then - Actions
            • Unit - Remove Disguise_Dummy from the game
            • Unit - Remove Disguise buff from Disguise_User
            • Trigger - Turn off (This trigger)
            • Trigger - Turn off Disguise Attacks <gen>
            • Trigger - Turn off Disguise Moves <gen>
          • Else - Actions
      • Custom script: call RemoveLocation (udg_Disguise_Loc)
  • Disguise Moves
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Triggering unit) Equal to (==) Disguise_User
    • Actions
      • Set AALoc1 = (Target point of issued order)
      • Unit - Order Disguise_Dummy to Move To AALoc1
      • Custom script: call RemoveLocation (udg_AALoc1)
  • Disguise Attacks
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Triggering unit) Equal to (==) Disguise_User
    • Actions
      • Unit - Order Disguise_Dummy to Right-Click (Target unit of issued order)
 
Last edited:
Level 21
Joined
Nov 4, 2013
Messages
2,017
I don't think there's any problem with this. If the target unit belongs to the enemy and will be invisible, you cannot see it by yourself so you cannot be sure that the unit was not created. So unless you change the owner of the dummy to the caster of the skill, you'll never see it thus you'll never be sure if it was created or not.
Alternatively, the problem may be caused by the Disguise Timer

  • ((Disguise_Dummy is dead) Equal to (==) True) or ((Disguise_User has buff Disguise ) Not equal to (!=) True)
The second part about the buff. Does the skill Disguise apply the buff Disguise? Otherwise the unit will be removed immediately since it will never have that buff, satisfying the second condition and running the "Then" triggers.
 
Level 3
Joined
Jun 17, 2015
Messages
53
@Shadow Fury: the triggers works like Caster will become invisible (not the dummy) and the dummy will be revealed.

you can read this, it apply a buff of Invisibility and timer will check if the buff is gone or not

Add Disguise [Invi] to (Last created unit)
Unit - Order (Last created unit) to Human Sorceress - Invisibility Disguise_User

===========================================================================

Yes i think nothing is wrong here, but when i casted to an ally, enemy then i still goes invisible but the dummy is gone (sometimes it work). Do you need a sample map?
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
Ah yes I noticed now that the dummy goes invisible but my question now is: "Did you use the skill multiple times before the first dummy's timer (120 seconds) expired?" If you did so, you caused the overlapping of the trigger which will inevitably cause problems that cannot be fixed.
 
Status
Not open for further replies.
Top