• 🏆 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] Save In Variables

Status
Not open for further replies.
Level 9
Joined
May 22, 2009
Messages
491
How do I save a trigger Unit acquires item item being manipulated equal to Longsword Special effect on right hand of triggering unit using longsword.mdx in a variable so I can make it dissapear when he drops the item?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Allright, basically it will look something like this:


  • Pick up Weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Sword
        • Then - Actions
          • Special Effect - Create a special effect attached to the hand,left of (Hero manipulating item) using Sword-effect
          • Set SE[(Player number of (Owner of (Triggering unit)))] = (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Axe
        • Then - Actions
          • Special Effect - Create a special effect attached to the hand,left of (Hero manipulating item) using Axe-effect
          • Set SE[(Player number of (Owner of (Triggering unit)))] = (Last created special effect)
        • Else - Actions


Set all your weapons to permanent, all shields to another class, ...

Then, to remove the special effects, you can use this trigger:
  • Drop Weapon
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Special Effect - Destroy SE[(Player number of (Owner of (Triggering unit)))]
This is just a rough sketch, but you get the bigger picture I guess.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Here is the screeny:
71390725.jpg


I use Windows XP, so it might look different, but I think you will find the action ;)
 
Level 5
Joined
Dec 18, 2007
Messages
205
no i think he wants to know what type of variable it is.
it is a 'special effect' array called "SE"
and the indexes (Player number of (Owner of (Triggering unit))) are there to make it MPI
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You can add a special effect (kill me if I remember how) directly to an item through the object manager. You don't need to make any triggers for this.

Argl, and NOW you say so? xD

Give the item an ability that has the art - target effect to the sword and the "Caster attachement point" to hand,left (or right).

Forgot about that :p
 
Last edited:
Status
Not open for further replies.
Top