[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