• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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