• 🏆 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!

[JASS] Connected Units

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
I'm doing a spell that needs to have a set of positioned traps, but I want do when you destroy one trap, all the other are destroyed as well. And you can put as many set (One set is 5 traps) you want, and need to be MUI.

But I can't think a way to know which traps are of the same set :(
Also, I forgot the ability that creates a line of light between units, someone remember?

Thanks in advance ^^
 
Level 12
Joined
Mar 23, 2008
Messages
942
save them in a unit array then loop it to destroy them

JASS:
loop
    exitwhen i >= Dat.TotalTraps
    //damaging stuff
    call KillUnit(Dat.Trap[i])
    set i = i + 1
endloop

*sob*

I think you didn't understand. I have a spell that summon 5 traps. Those traps make a circular shape, when someone enter inside they explode, they are also invisible.

But, if someone buy a gem they can destroy one trap, so the other 4 become useless, I wanna destroy them since they will do nothing.

How to detect if one trap was destroy, so I can destroy the other? (MUI please)
 
Level 7
Joined
Jul 20, 2008
Messages
377
Needs more info:

Does the spell drop all traps within a set at once, or as long as you've got 4 or fewer traps, the new trap created belongs to that set?
 
Level 12
Joined
Mar 23, 2008
Messages
942
Needs more info:

Does the spell drop all traps within a set at once, or as long as you've got 4 or fewer traps, the new trap created belongs to that set?

All traps are created at the same time.

Edit: I'm using a global group array with a integer index, setting all the traps to the same custom value to match the group index... If anyone have a better idea, call me xD
 
Last edited:
Status
Not open for further replies.
Top