• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Item Ability Trigger doesn't work

Status
Not open for further replies.
Level 31
Joined
Apr 17, 2009
Messages
3,572
Hey Guys,

I'm working on the Cutting ability for my survival map.
You can use your "Knife" item directly on the "Branch" item to sharpen it to a "Sharpened Stick".

This is the trigger:


  • Cutting
    • Ereignisse
      • Einheit - A unit Beginnt, eine Fähigkeit zu wirken
    • Bedingungen
      • (Item-type of (Target item of ability being cast)) Gleich Branch
    • Aktionen
      • Gegenstand - Remove (Target item of ability being cast)
      • Held - Create Sharpened Stick and give it to (Triggering unit)
      • Gegenstand - Set charges remaining in (Last created item) to (Charges remaining in (Target item of ability being cast))
      • Spiel - Display to (All players) the text: |c00FFDE88You have ...


It almost works, but setting the charges remaining is bugged somehow. If I use the knife on a branch item with more then one charge remaining, it just creates a single item, without this number for the charge.

Maybe it's because of my item stacking trigger:


  • Item Stacking
    • Ereignisse
      • Einheit - A unit Erwirbt einen Gegenstand
    • Bedingungen
      • (Item-class of (Item being manipulated)) Gleich Aufgeladen
    • Aktionen
      • For each (Integer A) from 1 to 6, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Gleich (Item-type of (Item being manipulated))
              • (Item carried by (Triggering unit) in slot (Integer A)) Ungleich (Item being manipulated)
            • 'THEN'-Aktionen
              • Gegenstand - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to ((Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
              • Gegenstand - Remove (Item being manipulated)
            • 'ELSE'-Aktionen


Can anyone help me?
Greets chilla_killa
 
Level 31
Joined
Apr 17, 2009
Messages
3,572
Is this correct?

  • Cutting
    • Ereignisse
      • Einheit - A unit Beginnt, eine Fähigkeit zu wirken
    • Bedingungen
      • (Item-type of (Target item of ability being cast)) Gleich Branch
    • Aktionen
      • Set Branches = (Charges remaining in (Target item of ability being cast))
      • Gegenstand - Remove (Target item of ability being cast)
      • Set TempPoint[0] = (Position of (Target item of ability being cast))
      • Gegenstand - Create Sharpened Stick at TempPoint[0]
      • Custom script: call RemoveLocation( udg_TempPoint[0] )
      • Gegenstand - Set charges remaining in (Last created item) to Branches
      • Held - Give (Last created item) to (Triggering unit)
      • Spiel - Display to (All players) the text: |c00FFDE88You have ...
 
The temp point will be set at the middle of the map (default) because the item at which it is set has been removed.
You want to set the point before removing the item.

Also. I would recommend that you set the point somewhere the players can't access. That way you cannot see the item being created on the ground.
Do you follow?

Otherwise the trigger looks fine.
 
Status
Not open for further replies.
Top