• 🏆 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] In request of some help and/or feedback. (Trigger leak?)

Status
Not open for further replies.
Level 3
Joined
Jun 2, 2007
Messages
26
Hello,

I'm currently working on a Zombie tag map (Very original.) and it seems ive become stuck:weekani:

You see, one of the survivor players needs to be able to pickup a weapon but once i do so, my game crashes..

Does anyone have a fix for this?
 

Attachments

  • Zombie map.w3x
    360.3 KB · Views: 77
Level 29
Joined
Jul 29, 2007
Messages
5,174
Your problem is not in the items themselfs, its in the actions they make when you USE them.

Since you didn't put a X on the "Stats - Use Automatically When Acquired", it uses it the moment you acquire it.

Your actions at usage are the cause, and its also pretty obvious, since you are trying to move items from the inventory of a REMOVED unit.

You should move all items to some place the players can't see, replace the hero, and then move them back.
 
Level 3
Joined
Jun 2, 2007
Messages
26
Yep, seems to have fixed the pickup problem, thanks:)

Though i still seem to have problems with the items, i tried moving the items to a region and THEN replacing the unit, but that also ends up with a crash, ive even tried desperate things like a wait timer between the two actions and dropping everything, it just doesnt seem to budge:/

Thanks for resolving the first issue though=D
 
Level 3
Joined
Jun 2, 2007
Messages
26
Sorry for taking me so long, New years eve and i didnt realy wanted to miss it:)

Heres the trigger, i couldnt realy find an action for the items once they where stored in the Item Storage Region, since if i took Random Item in Region it could leak and give the replaced unit the items of another, heres how far ive come with the trigger.

  • Shotgun use
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Shotgun
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Hero manipulating item)) Equal to Survivor {Shotgun
              • (Unit-type of (Hero manipulating item)) Equal to Zombie Host
              • (Unit-type of (Hero manipulating item)) Equal to Zombie
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Item - Move (Item carried by (Hero manipulating item) in slot 1) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item carried by (Hero manipulating item) in slot 2) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item carried by (Hero manipulating item) in slot 3) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item carried by (Hero manipulating item) in slot 4) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item carried by (Hero manipulating item) in slot 5) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item carried by (Hero manipulating item) in slot 6) to (Random point in Temporary item storage <gen>)
          • Wait 0.50 seconds
          • Unit - Replace (Hero manipulating item) with a Survivor {Shotgun using The old unit's life and mana
Because i didnt know what action to end the trigger with i thought i could have just made the items drop so the replaced unit could pick them up once the replacing is done, but also this ended up as a crash.

  • Shotgun use
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Shotgun
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Hero manipulating item)) Equal to Zombie Host
              • (Unit-type of (Hero manipulating item)) Equal to Zombie
              • (Unit-type of (Hero manipulating item)) Equal to Survivor {Shotgun
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Hero - Drop the item from slot 1 of (Hero manipulating item)
          • Hero - Drop the item from slot 2 of (Hero manipulating item)
          • Hero - Drop the item from slot 3 of (Hero manipulating item)
          • Hero - Drop the item from slot 4 of (Hero manipulating item)
          • Hero - Drop the item from slot 5 of (Hero manipulating item)
          • Hero - Drop the item from slot 6 of (Hero manipulating item)
          • Wait 0.50 seconds
          • Unit - Replace (Hero manipulating item) with a Survivor {Shotgun using The old unit's life and mana
Ive looked for wrong settings on the items this time, but i couldnt find anything.:/
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Just make a small region for each player.

Couldn't see why the 2nd trigger crashed... weird.

And just as a tip, use Triggering Unit as much as you can because it works better usually and bugs less (in your trigger for example, you can use it instead of "Hero manipulatin item").
 
Level 6
Joined
Nov 28, 2007
Messages
203
This should work. I dunno why if it doesn't.
  • Items carried
    • Events:
      • Time - Every 0.15 Seconds of time
    • Conditions:
    • Actions:
      • For each (Integer A) from 1 - 6, do (Actions)
        • Loop - Actions:
          • Set (Item carried by (Survivors_Player1[(Integer A)] in slot (Integer A)) = Item_CarriedSlot1[Integer A]
          • Set (Item carried by (Survivors_Player2[(Integer A)] in slot (Integer A)) = Item_CarriedSlot2[Integer A]
          • Set (Item carried by (Survivors_Player3[(Integer A)] in slot (Integer A)) = Item_CarriedSlot3[Integer A]
          • Set (Item carried by (Survivors_Player4[(Integer A)] in slot (Integer A)) = Item_CarriedSlot4[Integer A]
          • Set (Item carried by (Survivors_Player5[(Integer A)] in slot (Integer A)) = Item_CarriedSlot5[Integer A]
          • Set (Item carried by (Survivors_Player6[(Integer A)] in slot (Integer A)) = Item_CarriedSlot6[Integer A]
  • Shotgun use
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated) Equal to Shotgun
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Unit-type of (Triggering Unit)) Equal to Survivor {Shotgun
            • (Unit-type of (Triggering Unit)) Equal to Zombie Host
            • (Unit-type of (Triggering Unit)) Equal to Zombie
        • Then - Actions
        • Else - Actions
          • For each (Integer A) from 1 - 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot (Integer A) of (Triggering Unit)
          • Item - Move (Item_CarriedSlot1[(Player number of (Owner of (Triggering Unit)))]) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item_CarriedSlot2[(Player number of (Owner of (Triggering Unit)))]) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item_CarriedSlot3[(Player number of (Owner of (Triggering Unit)))]) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item_CarriedSlot4[(Player number of (Owner of (Triggering Unit)))]) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item_CarriedSlot5[(Player number of (Owner of (Triggering Unit)))]) to (Random point in Temporary item storage <gen>)
          • Item - Move (Item_CarriedSlot6[(Player number of (Owner of (Triggering Unit)))]) to (Random point in Temporary item storage <gen>)
          • Unit - Replace (Triggering Unit) with a Survivor {Shotgun using The old unit's life and mana
          • Hero - Give (Item_CarriedSlot1[(Player number of (Owner of (Triggering Unit)))]) to (Triggering Unit)
          • Hero - Give (Item_CarriedSlot2[(Player number of (Owner of (Triggering Unit)))]) to (Triggering Unit)
          • Hero - Give (Item_CarriedSlot3[(Player number of (Owner of (Triggering Unit)))]) to (Triggering Unit)
          • Hero - Give (Item_CarriedSlot4[(Player number of (Owner of (Triggering Unit)))]) to (Triggering Unit)
          • Hero - Give (Item_CarriedSlot5[(Player number of (Owner of (Triggering Unit)))]) to (Triggering Unit)
          • Hero - Give (Item_CarriedSlot6[(Player number of (Owner of (Triggering Unit)))]) to (Triggering Unit)
 
Last edited:
Level 6
Joined
Nov 28, 2007
Messages
203
Don't think so. Because it updates 'every 0.15 sec of time' and the time between the actions is like 0.0000001 sec

[EDIT]: Or did u mean that it removes the item? It doesn't (I hope xD), cus it says "Drop the item blablabla"
 
Status
Not open for further replies.
Top