Give item won't work.

Ex0sphere

New Member
Reaction score
1
I'm trying to make it so the item stays with the replacing unit, but this always crashes my game.
Trigger:
  • Sniper
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Sniper
    • Actions
      • Unit - Replace (Hero manipulating item) with a Soldier using The new unit's default life and mana
      • Hero - Create Sniper and give it to (Hero manipulating item)

Thx in advanced!!!!!!!
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
Does the Soldier unit have an inventory?

EDIT: Woops, no. I found the obvious solution.

You've created an infinite loop.

The unit picks up Sniper,

then he is given Sniper again

So the trigger fires off again...
and again...
and again...

And so your game crashes rather than submitting to this onslaught of constant sniper-creation.

To fix this, simply do this to your trigger.

Code:
    * Sniper
          o Events
                + Unit - A unit Acquires an item
          o Conditions
                + (Item-type of (Item being manipulated)) Equal to Sniper
          o Actions
                [B]+ Trigger - Turn off (This trigger)[/B]
                + Unit - Replace (Hero manipulating item) with a Soldier using The new unit's default life and mana
                + Hero - Create Sniper and give it to (Hero manipulating item)
                [B]+ Trigger - Turn on (This trigger)[/B]
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top