PDA

View Full Version : Stuck on Puppet making


Master Zionosis
06-20-2007, 11:10 AM
I'm having a little problem on creating a puppet, I've followed Stoffe's tutorial here (http://www.lucasforums.com/showthread.php?t=151438) and I'm at the part with the second script

// -------------------------------------------------------
// Support function: Assign a puppet to a party member
// -------------------------------------------------------
void ST_GivePuppet(int nNPC, int nPUP, string sTemplate) {
string sTag = "";
switch (nNPC) {
case NPC_ATTON: sTag = "atton"; break;
case NPC_BAO_DUR: sTag = "baodur"; break;
case NPC_CANDEROUS: sTag = "mand"; break;
case NPC_G0T0: sTag = "g0t0"; break;
case NPC_HANDMAIDEN: sTag = "handmaiden"; break;
case NPC_HK_47: sTag = "hk47"; break;
case NPC_KREIA: sTag = "kreia"; break;
case NPC_MIRA: sTag = "mira"; break;
case NPC_T3_M4: sTag = "t3m4"; break;
case NPC_VISAS: sTag = "visasmarr"; break;
case NPC_HANHARR: sTag = "hanharr"; break;
case NPC_DISCIPLE: sTag = "disciple"; break;
}

object oOwner = GetObjectByTag(sTag);
if (GetIsObjectValid(oOwner) && IsObjectPartyMember(oOwner)) {
location lLoc = Location(GetPosition(oOwner) + AngleToVector(GetFacing(oOwner)) * 2.0, GetFacing(oOwner)-180.0);

AddAvailablePUPByTemplate(nPUP, sTemplate);
AssignPUP(nPUP, nNPC);
object oPUP = SpawnAvailablePUP(nPUP, lLoc);
AddPartyPuppet(nPUP, oPUP);

SetNPCAIStyle(oPUP, NPC_AISTYLE_PARTY_SUPPORT);
}
}


// -------------------------------------------------------
// Main function: Example, call above function to assign
// a puppet in st_puppet1.utc to Kreia.
// -------------------------------------------------------
void main() {
// Spawn the "st_puppet1" UTC as a puppet, assign it to Kreia
ST_GivePuppet(NPC_KREIA, PUP_OTHER1, "st_puppet1");
}

Now i may be missing something, maybe i misread it but I've gone over it 3 times and i don't know what to call this script and what field to place it on in the .UTC file. Can someone who has made a successful puppet shed some light on what to do here please.

Thanks.

stoffe
06-20-2007, 01:26 PM
I'm having a little problem on creating a puppet
(snip)
Now i may be missing something, maybe i misread it but I've gone over it 3 times and i don't know what to call this script and what field to place it on in the .UTC file.

You can call it anything you like (that's a valid resource name), and you don't assign it as an AI script. You run it once when you want to give the NPC their puppet, usually right after that NPC has been assigned to the player's party pool.

Master Zionosis
06-20-2007, 01:47 PM
Ohhh of course!! I had a mind lapse :lol: stupid me, how could i forget that, thanks Stoffe, for pointing that out for me.

Hunter-Killer
06-20-2007, 02:40 PM
Sorry. I cannot find anything wrong. While I am looking for something, what is the puppet? Who is it for?

Master Zionosis
06-20-2007, 02:48 PM
Sorry. I cannot find anything wrong. While I am looking for something, what is the puppet? Who is it for?

There isn't anything wrong i just simply lost my mind for an hour and forgot what to do, :lol:.

And as for the content, it's a bit of a surprise, you'll find out soon enough, and it's not just a puppet mod He's got a dialog and if it sounds alright he will also have a voice :D a bit like a party member but without taking over any of the present party :D