I'm working on making a puppet mod for TSL, and currently I'm working on making the script that assigns it to a party member. Unfortuantly whenever I try to assign it to a party member, the script wont compile. Here's the script.
void ST_GivePuppet(NPC_KREIA, PUP_OTHER1, "st_puppet1") {
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);
}
}
Does anyone know whats wrong with it?:confused:
Uh yeah I did. In fact this is one of the scripts from that turtorial. Unfortuantly when I tried to compile it... nothing.
The reason I asked was first off..the script you're showing is missing the the last few lines of stoffe's script...starting with the 'void main()' and the givepuppet function.. Second..did you take note of stoffe's note regarding the need to include the four .nss script files that need to be saved where your nwnnsscomp.exe compiler is i.e. Kotor Tool...assuming that is what you're using.
Thats kind of strange, especially since I copied and pasted the script on, and yes I did extract the four .nss scripts.
Alright I tried what you said and I still got an error message. It said something about a bunch of the functions (Like switch for example) were invalid. Can anyone explain why this might be, maybe send me a script to assign this to Kreia? (Or if possible the main PC. That's who the puppet was intended for but due to certain limitations I've encountered I haven't been able to set a puppet to the PC.)
You cannot link a puppet to the PC only to party members.
Yeah that's what I thought, but I was hoping that there may be a way around that without breaking the law. Maybe some intense scripting or something like that as I'm not really sure of scriptings limitations.
You can make an NPC follow the PC and function like a puppet though...
You can make an NPC follow the PC and function like a puppet though...
What exactly do you mean like that? Like the Call of Aid mod where the NPC doesn't count as a puppet but still follows the main PC?
Yes... that is exactly what I mean... and you can set it's field to Friendly_1 and it'll attack with your party members :)
not a bad idea... I'll try it out.
Haha... good luck Darth. (: (lmfao I can't resist)
May the Tools serve you well.
Alright. I'm pleasantly suprised to say that this mod could very well be finished soon. There are only a few problems with scripting (as that is not my strong suit) but they are slowly being resolved.
Alright I know I said that this mod would be released soon but somethings came up. If it wouldn't be too much of a bother could someone send me a script to assign a puppet character to T3-M4? I'll make the neccesary changes to the script to make it work with the puppets template. After that this mod will be for the most part done...