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

Help with respawn and give item

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
  • GetIndex
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set Temp_UnitGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - 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 (Picked unit)) Equal to (Boss) Bandit Lord (Female)
                  • (Unit-type of (Picked unit)) Equal to (Sub-boss) Bandit Lord Assistant
                  • (Unit-type of (Picked unit)) Equal to (Boss) Kobold Head-Cheif
              • (Owner of (Picked unit)) Equal to Neutral Hostile
            • Then - Actions
              • Set X[(Custom value of (Picked unit))] = (X of (Position of (Picked unit)))
              • Set Y[(Custom value of (Picked unit))] = (Y of (Position of (Picked unit)))
              • Set Z_Facing[(Custom value of (Picked unit))] = (Facing of (Picked unit))
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Temp_UnitGroup
      • Custom script: call DestroyGroup(udg_Temp_UnitGroup)
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to (Boss) Bandit Lord (Female)
          • (Unit-type of (Dying unit)) Equal to (Sub-boss) Bandit Lord Assistant
          • (Unit-type of (Dying unit)) Equal to (Boss) Kobold Head-Cheif
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Set TempUnit = (Dying unit)
      • Set CV = (Custom value of TempUnit)
      • Wait 20.00 seconds
      • Unit - Create 1 (Unit-type of TempUnit) for Neutral Hostile at (Point(X[CV], Y[CV])) facing Z_Facing[CV] degrees
      • Unit - Set the custom value of (Last created unit) to CV
This should respawn the 3 units correctly, yet does nothing... Also...

JASS:
    call UnitAddItemToSlotById(GetLastCreatedUnit(), 'I01I', 6)

Drops item on floor rather than putting it in slot 6 even though theres nothing in slot 6 or any other slots
 
Level 11
Joined
Nov 15, 2007
Messages
800
You don't need those variables. They're probably being overwritten during the 20 second wait. Just use "Triggering unit" - it works with waits.
 
Level 13
Joined
May 11, 2008
Messages
1,198
are these heroes or regular units?

anyway, you didn't appear to insert the custom script anywhere. the only text i see is this one: call DestroyGroup(udg_Temp_UnitGroup)

also, looking at this: call UnitAddItemToSlotById(GetLastCreatedUnit(), 'I01I', 6)...your integer is wrong. for that function, slot 6 uses integer 5. slot 6 is invalid. so that's why the item isn't going in the inventory. the hero/unit doesn't have a 7th inventory slot.

if you could post the whole trigger in custom text, i could read it a little bit better.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
You don't need those variables. They're probably being overwritten during the 20 second wait. Just use "Triggering unit" - it works with waits.
Will test
are these heroes or regular units?

anyway, you didn't appear to insert the custom script anywhere. the only text i see is this one: call DestroyGroup(udg_Temp_UnitGroup)

also, looking at this: call UnitAddItemToSlotById(GetLastCreatedUnit(), 'I01I', 6)...your integer is wrong. for that function, slot 6 uses integer 5. slot 6 is invalid. so that's why the item isn't going in the inventory. the hero/unit doesn't have a 7th inventory slot.

if you could post the whole trigger in custom text, i could read it a little bit better.
Didn't know that. Thanks
 
Status
Not open for further replies.
Top