• 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.

[Trigger] Item System

Status
Not open for further replies.
Level 3
Joined
May 21, 2011
Messages
31
Yes, I'm back again >.<

I seem to be prone to errors with this map, I've never had to ask about errors for any other map.

Okay, I tried to change my item system so that when you acquire an item it'll equip it, when he drops it, it'll unequip. I wanted it also to unequip for any item dropped.

I've ALMOST got this figured out, originally from crashing the game. The only problem right now is, instead of removing the unit, for some reason it kills the unit picking it up. :p, I really don't get why.

this is the map, I disabled the generation so you don't have to sit through it :p.

http://www.hiveworkshop.com/forums/pastebin.php?id=dyr8sd



Edit:I posted the triggers

Knife
  • Knife
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Knife
      • (Hero manipulating item) Not equal to Temp_Item_Unit
    • Actions
      • Unit - Turn collision for (Triggering unit) Off
      • Set P[0] = (Position of (Triggering unit))
      • Unit - Create 1 Victim Knife for (Owner of (Triggering unit)) at P[0] facing (Facing of (Casting unit)) degrees
      • Set Temp_Item_Unit = (Last created unit)
      • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Create (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) and give it to (Last created unit)
      • For each (Integer A) from 1 to 50, do (Actions)
        • Loop - Actions
          • Unit - Set level of Spell_Professions[(Integer A)] for (Last created unit) to (Level of Spell_Professions[(Integer A)] for (Triggering unit))
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • Special Effect - Create a special effect attached to the left hand of (Last created unit) using war3mapImported\Punyknife_E2.mdx
      • Unit - Set mana of (Last created unit) to (Mana of (Triggering unit))
      • Unit - Set life of (Last created unit) to (Percentage life of (Triggering unit))%
      • Set Temp_Item_Unit = (Triggering unit)
      • Unit - Remove (Triggering unit) from the game
Unequip
  • Unequip
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to AA-12 Semi-Automatic Shotgun
              • (Item-type of (Item being manipulated)) Equal to AK-47
              • (Item-type of (Item being manipulated)) Equal to Barrett M98B Sniper Rifle
              • (Item-type of (Item being manipulated)) Equal to Barrett REC7 Assault Rifle
              • (Item-type of (Item being manipulated)) Equal to Colt Revolver
              • (Item-type of (Item being manipulated)) Equal to Desert Eagle
              • (Item-type of (Item being manipulated)) Equal to HK CAWS Shot Gun
              • (Item-type of (Item being manipulated)) Equal to KNT-308 Sniper Rifle
              • (Item-type of (Item being manipulated)) Equal to Knife
              • (Item-type of (Item being manipulated)) Equal to LAG-40 Grenade Launcher
              • (Item-type of (Item being manipulated)) Equal to M240 Machine Gun
              • (Item-type of (Item being manipulated)) Equal to M25
              • (Item-type of (Item being manipulated)) Equal to M4 Carbine
              • (Item-type of (Item being manipulated)) Equal to M9 Flamethrower /w Suit
              • (Item-type of (Item being manipulated)) Equal to MG42 Machinegun
              • (Item-type of (Item being manipulated)) Equal to Mendoza RM2 Submachine Gun
              • (Item-type of (Item being manipulated)) Equal to Pistol
              • (Item-type of (Item being manipulated)) Equal to RMB-98 Shotgun
              • (Item-type of (Item being manipulated)) Equal to Scorpion Rifle
              • (Item-type of (Item being manipulated)) Equal to Shotgun
              • (Item-type of (Item being manipulated)) Equal to Sniper
          • (Unit-type of (Triggering unit)) Not equal to Woman
    • Actions
      • Unit - Turn collision for (Triggering unit) Off
      • Set P[0] = (Position of (Triggering unit))
      • Unit - Create 1 Victim for (Owner of (Triggering unit)) at P[0] facing (Facing of (Casting unit)) degrees
      • Set Temp_Item_Unit = (Triggering unit)
      • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Not equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Hero - Create (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) and give it to (Last created unit)
            • Else - Actions
      • For each (Integer A) from 1 to 50, do (Actions)
        • Loop - Actions
          • Unit - Set level of Spell_Professions[(Integer A)] for (Last created unit) to (Level of Spell_Professions[(Integer A)] for (Triggering unit))
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • Unit - Set mana of (Last created unit) to (Mana of (Triggering unit))
      • Unit - Set life of (Last created unit) to (Percentage life of (Triggering unit))%
      • Unit - Remove (Triggering unit) from the game
Those are two main triggers, the rest of the triggers in the item system are just duplicates of Knife. If you want to see them you can go to the map.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
The problem isn't with both running, which they don't seem to do.

Maker said:
Unequip runs after you pick up a knife. Make sure it doesn't.

  • Unequip
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Triggering unit) Not equal to Temp_Item_Unit // add this
      • (Unit-type of (Triggering unit)) Not equal to Woman
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to AA-12 Semi-Automatic Shotgun
          • (Item-type of (Item being manipulated)) Equal to AK-47
          • (Item-type of (Item being manipulated)) Equal to Barrett M98B Sniper Rifle
          • ...
    • Actions
      • ...
 
Status
Not open for further replies.
Top