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

[Solved] Switch unit variables

Status
Not open for further replies.
Level 11
Joined
Sep 14, 2009
Messages
284
This is probably really simple but I just can't figure out how to do it.

I have 2 unit variables. udg_PartyMember[1] and udg_PartyMember[2] and want the units to switch variables, in other words move unit 1 to variable 2 and unit 2 to variable 1.

This is how I try to do it (it does not work lol):

JASS:
    set udg_PartyMember[1] = udg_TempUnitA
    set udg_PartyMember[2] = udg_PartyMember[1]
    set udg_TempUnitA = udg_PartyMember[2]

EDIT: It works now. Thanks Ceday.
 
Last edited:
Level 12
Joined
May 22, 2015
Messages
1,051
It should look like this:
JASS:
    set udg_TempUnitA = udg_PartyMember[1]
    set udg_PartyMember[1] = udg_PartyMember[2]
    set udg_PartyMember[2] = udg_TempUnitA
 
Status
Not open for further replies.
Top