• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] Unit carying item spawns new unit

Status
Not open for further replies.
Probably the last. I'm not sure if the dying unit can still be checked for carried items.

If it's possible:
  • Events
    • A unit dies
  • Conditions
    • (Dying unit) carries item of item type (YOUR ITEM)
  • Actions
    • Create 1 YOUR UNIT at (Position of (Dying unit)) facing default building angle
(Not sure what the condition really looks like, but it's something like that. I don't have the WE here.

If not:
You should make an arrayed Unit variable 'GotYourItem'. If the unit gets the item, place him in the variable. To check which array is still unused, you need an 'exitwhen' JASS line. I'm not using JASS, but I know that line exists. You should ask someone who's familiar with JASS to tell you the exact script line to place. It should exit when the array is not used or the unit in it has been detroyed (leakless). If that's not possible, just set the unit to a dummy unit and exit when the unit of that array is the dummy unit. For an example of what I mean, check this thread.
 
Probably the last. I'm not sure if the dying unit can still be checked for carried items.

If it's possible:
  • Events
    • A unit dies
  • Conditions
    • (Dying unit) carries item of item type (YOUR ITEM)
  • Actions
    • Create 1 YOUR UNIT at (Position of (Dying unit)) facing default building angle
(Not sure what the condition really looks like, but it's something like that. I don't have the WE here.

it would be or multiple conditions, unit has item in slot 1 unit has item in slot 2 etc i think.

If not:
You should make an arrayed Unit variable 'GotYourItem'. If the unit gets the item, place him in the variable. To check which array is still unused, you need an 'exitwhen' JASS line. I'm not using JASS, but I know that line exists. You should ask someone who's familiar with JASS to tell you the exact script line to place. It should exit when the array is not used or the unit in it has been detroyed (leakless). If that's not possible, just set the unit to a dummy unit and exit when the unit of that array is the dummy unit. For an example of what I mean, check this thread.

why array? just use unit group.
 
Status
Not open for further replies.
Back
Top