• 🏆 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!

Set Name of (Last created item) Not working

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
Hi, I'm struggling with this particular trigger
  • Items
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ShowNames Equal to True
        • Then - Actions
          • Set Integer = 0
          • For each (Integer A) from 1 to Total, do (Actions)
            • Loop - Actions
              • Set Integer = (Integer + 1)
              • Item - Create Ability at (Random point in (Playable map area))
              • Item - Set the custom value of (Last created item) to Integer
              • Item - Set Name of (Last created item) to (Name of Abilties[Integer])
              • Special Effect - Create a special effect at (Position of (Last created item)) using Abilities\Spells\Orc\FeralSpirit\feralspirittarget.mdl
        • Else - Actions
          • Set Integer = 0
          • For each (Integer A) from 1 to Total, do (Actions)
            • Loop - Actions
              • Item - Create Ability at (Random point in (Playable map area))
              • Set Integer = (Integer + 1)
              • Item - Set the custom value of (Last created item) to Integer
              • Special Effect - Create a special effect at (Position of (Last created item)) using Abilities\Spells\Orc\FeralSpirit\feralspirittarget.mdl
To clarify the Variable "Abilities[]" is defined in the trigger in the "Spoiler" label, warning it is rather long.
But essentially every ability is given a variable with a different index value, I want the above trigger to name each item that is created by using each items custom value. Essentially say Death coil is given the variable "Abilities[52]" and then I want any item that has a custom value of 52 to be named Death Coil, my trigger works well in assigning custom values to items however the naming is the problem, every single item is named "Wind Walk" even though every item has a different custom value, wind walk is the last ability to be assigned a variable in the below trigger. I know for sure that the items are being assigned their own custom values using this trigger.
  • Custom Value Display
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String((Custom value of (Item being manipulated))))
  • Setting Variables
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
      • Unit - Create 1 Blademaster for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Set TimerLength = 40.00
      • Set Unit = (Last created unit)
      • Set Index = 1
      • Set Abilties[Index] = Acid Bomb
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Animate Dead
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Attribute Bonus
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Avatar
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Banish
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Bash
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Battle Roar
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Big Bad Voodoo
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Black Arrow
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Blink
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Blizzard
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Breath of Fire
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Brilliance Aura
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Carrion Beetles
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Carrion Swarm
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Chain Lightning
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Charm
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Cleaving Attack
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Cluster Rockets
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Critical Strike
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Dark Ritual
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Death And Decay
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Death Coil
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Death Pact
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Devotion Aura
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Divine Shield
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Doom
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Drunken Brawler
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Drunken Haze
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Earthquake
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Endurance Aura
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Entangling Roots
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Evasion
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Fan of Knives
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Feral Spirit
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Flame Strike
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Force of Nature
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Forked Lightning
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Frost Armor
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Frost Arrows
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Frost Nova
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Healing Spray
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Healing Wave
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Hex
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Holy Light
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Howl of Terror
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Immolation
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Impale
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Incinerate (Arrow)
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Inferno
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Life Drain
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Locust Swarm
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Mana Burn
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Mana Shield
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Mass Teleport
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Mirror Image
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Monsoon
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Phoenix
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Pocket Factory
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Rain of Fire
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Reincarnation
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Resurrection
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Scout
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Searing Arrows
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Serpent Ward
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Shadow Strike
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Shockwave
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Silence
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Siphon Mana
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Sleep
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Soul Burn
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Spiked Carapace
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Spirit Beast
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Stampede
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Starfall
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Storm Bolt
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Summon Bear
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Summon Hawk
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Summon Lava Spawn
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Summon Prawns
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Summon Quilbeast
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Summon Water Elemental
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Thorns Aura
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Thunder Clap
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Tranquility
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Transmute
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Trueshot Aura
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Unholy Aura
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Vampiric Aura
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Vengeance
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Volcano
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Voodoo Spirits
      • Set Index = (Index + 1)
      • Set Abilties[Index] = War Stomp
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Watery Minion
      • Set Index = (Index + 1)
      • Set Abilties[Index] = Wind Walk
      • Set Total = Index
      • Set Integer = 0
      • Hashtable - Create a hashtable
      • Set Hashtable_Dialog = (Last created hashtable)
      • Player - Disable sleeping for all creeps
      • Trigger - Run Trees And Terrain <gen> (checking conditions)
      • Trigger - Run Remove Hero Abilities <gen> (checking conditions)
      • Trigger - Run Items <gen> (checking conditions)
      • Trigger - Run Dialog <gen> (checking conditions)
      • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top