Aller au contenu

Photo

SOLVED: Teleport henchmen to the selected character.


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Bibdy

Bibdy
  • Members
  • 1 455 messages
I'm trying to setup an ambush situation where a wall of fire appears behind the player. Trouble is, I've had it a few times where the non-controlled party members lag behind so far that they get caught on the opposite side of the wall and literally die in a fire! I've tried moving the wall back a bit each time this happens, but now its so far away that you could barely even consider it a trap.

Is there a command which will teleport all non-controlled party members to the currently selected one (bear in mind, the player might not be controlling their hero specifically - he could be the one caught behind the fire).

Modifié par Bibdy, 04 mars 2010 - 03:09 .


#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
UT_LocalJump from utility_h has a parameter for bJumpParty. Set that to true for what you want.

(You can just use GetTag(GetMainControlled()) as the value for the sWP parameter.)

Modifié par Craig Graff, 25 février 2010 - 12:09 .


#3
Bibdy

Bibdy
  • Members
  • 1 455 messages
Hoo-ee that Starcraft 2 Beta will suck away your free-time if you let it. Haven't looked at this thing in a week!



I tried the UT_LocalJump command, but that didn't seem to function properly. I'm not sure why. I did, however, dissect some of the code from that command to use, and here it is!



object oControlled = GetMainControlled();

vector vPos = GetPosition(oControlled);

object oPartyMember;

object [] arParty = GetPartyList(GetPartyLeader());



int nLoop;

int nPartySize = GetArraySize(arParty);



for (nLoop = 0; nLoop < nPartySize; nLoop++)

{

oPartyMember = arParty[nLoop];



if (IsObjectValid(oPartyMember) )

{



SetPosition(oPartyMember, vPos, TRUE);

}

else

{

Log_Trace(LOG_CHANNEL_SYSTEMS, "utility_h.UT_LocalJump", "FAILED - <" + GetTag(oPartyMember) + "> is not a valid object.");

}

}




That'll teleport all non-controlled party members to the currently selected one.