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

[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