RandomTask Posted August 19, 2005 Share Posted August 19, 2005 Hi guys im trying to make a custom PUP to follow visas like the remote that follows baodur ive managed to link one to her but it wont follow her i know im missing something somewhere some help would be much appreciated Link to comment Share on other sites More sharing options...
TheOssusKeeper Posted August 19, 2005 Share Posted August 19, 2005 hehe, don't know but i would like to get rid of remote that follows Bao-Dur, if i could... Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 I quite like the remote although it is pretty useless so i made a script to up its stats and equipment makes the remote solo mission easier Link to comment Share on other sites More sharing options...
TheOssusKeeper Posted August 19, 2005 Share Posted August 19, 2005 i kinda' did the same thing, only i edited the utc file... Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 Hi guys im trying to make a custom PUP to follow visas like the remote that follows baodur ive managed to link one to her but it wont follow her i know im missing something somewhere some help would be much appreciated Make sure you've assigned the Puppet to its owner with the AssignPUP() function. Have you assigned the correct set of AI scripts to the creature? You'll need to use the k_hen_* scripts rather than the k_def_* ones for a puppet to make them work properly. Then you'll need to make a custom heartbeat script for the PUP that will make it follow its owner. I think something like this should work: #include "k_inc_generic" void main() { object oEnemy = GetNearestCreature( CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, 1, CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, CREATURE_TYPE_IS_ALIVE, TRUE ); if(!GN_GetSpawnInCondition(SW_FLAG_AI_OFF)) { if(GetIsPuppet() && (GetIsObjectValid(GetPUPOwner()) && (GetCurrentAction(OBJECT_SELF) != ACTION_MOVETOPOINT) && (GetCurrentAction(OBJECT_SELF) != ACTION_FOLLOWOWNER) && !GetIsConversationActive() && !GN_GetSpawnInCondition(SW_FLAG_SPECTATOR_STATE) && GetCommandable() && (GetDistanceBetween2D(OBJECT_SELF, GetPUPOwner()) > 3.0) && (!GetIsObjectValid(oEnemy) || (GetDistanceBetween(oEnemy, OBJECT_SELF) > 20.0)))) { ClearAllActions(); ActionFollowOwner(2.0); } } if (GN_GetSpawnInCondition( SW_FLAG_EVENT_ON_HEARTBEAT )) SignalEvent(OBJECT_SELF, EventUserDefined(1001)); } You probably want to set its faction to the STANDARD_FACTION_PARTYPUPPET (23) faction as well, if you want it to behave like Remote where it will attack enemies but the enemies will largely ignore it and go after the players instead. You likely also want to set the "IgnoreCrePath" field to 1 in the creature template to prevent it from constantly getting in the way. May look a little funny at times, like when Bao-Dur wears his Remote around the neck, but it's a lot less annoying in the heat of battle. Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 i cant seem to compile that script come's up with a list of errors am i not doing something? Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 i cant seem to compile that script come's up with a list of errors am i not doing something? You'll need to put the relevant include files in the same folder as nwnnsscomp.exe. You'll need k_inc_generic.nss, k_inc_gensupport.nss, k_inc_walkways.nss and k_inc_drop.nss, all of which can be found in Scripts.bif with KotorTool. Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 Cheers that helps a great deal thanks Stoffe I owe you one! Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 How frustrating it still will not follow me Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 How frustrating it still will not follow me Have you assigned the custom heartbeat script to the Puppet's creature template in the OnHeartbeat event slot? Have you added the creature to the puppet table with AddAvailablePUPByObject() or AddAvailablePUPByTemplate()? Have you assigned it an owner with AssignPUP()? Have you added it as an active puppet with AddPartyPuppet()? What AI style have you set the Puppet to? Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 Ok here is the script I used im new to this so i probably messed it up! void main() { object me = GetObjectByTag ("VisasMarr"); if (GetIsObjectValid( me)) { vector vPos = GetPosition(GetPartyLeader()); float fPCFace = GetFacing(GetPartyLeader()); location lLoc = Location(vPos + AngleToVector(fPCFace) * 1.5f,fPCFace); object oNihilus = CreateObject(OBJECT_TYPE_CREATURE,"p_darthnihilus",lLoc); AddAvailableNPCByObject(NPC_VISAS, me); AddAvailablePUPByObject(PUP_OTHER1,oNihilus); AddPartyMember(NPC_VISAS, me); AssignPUP(PUP_OTHER1,NPC_VISAS); } } I dont believe i have added it with AddPartyPuppet() and im not quite sure what AI style i have set Sorry to be a pain Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 Ok here is the script I used im new to this so i probably messed it up! I dont believe i have added it with AddPartyPuppet() and im not quite sure what AI style i have set Try this version and see if it works better: void main() { object oVisas = GetObjectByTag("VisasMarr"); if (GetIsObjectValid(oVisas) && IsObjectPartyMember(oVisas)) { location lLoc = Location(GetPosition(oVisas) + AngleToVector(GetFacing(oVisas)) * 2.0, 0.0); AddAvailablePUPByTemplate(PUP_OTHER1, "p_darthnihilus"); AssignPUP(PUP_OTHER1, NPC_VISAS); object oNih = SpawnAvailablePUP(PUP_OTHER1, lLoc); AddPartyPuppet(PUP_OTHER1, oNih); AssignCommand(oNih, SetFacingPoint(GetPosition(oVisas))); SetNPCAIStyle(oNih, NPC_AISTYLE_PARTY_SUPPORT); ChangeToStandardFaction(oNih, STANDARD_FACTION_PARTYPUPPET); } } Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 Still no joy perhaps it has something to do with the utc file Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 Still no joy perhaps it has something to do with the utc file Perhaps, check that you haven't accidentally gotten a space or something after the Resref of the script. You could also try stripping down the heartbeat script a bit and see if the problem lies there. See if this makes it follow: #include "k_inc_generic" void main() { if(!GN_GetSpawnInCondition(SW_FLAG_AI_OFF)) { if((GetCurrentAction(OBJECT_SELF) != ACTION_MOVETOPOINT) && (GetCurrentAction(OBJECT_SELF) != ACTION_FOLLOWOWNER) && !GetIsConversationActive() && !GN_GetSpawnInCondition(SW_FLAG_SPECTATOR_STATE) && GetCommandable() && (GetDistanceBetween2D(OBJECT_SELF, GetPUPOwner()) > 2.0)) { ClearAllActions(); ActionFollowOwner(2.0); } } if (GN_GetSpawnInCondition( SW_FLAG_EVENT_ON_HEARTBEAT )) SignalEvent(OBJECT_SELF, EventUserDefined(1001)); } Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 Nope still not following i would have thought that if the resref was wrong it would fail to spawn completely think maybe it must be the utc is there anything major in the utc that i must in order for this to work Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 Nope still not following i would have thought that if the resref was wrong it would fail to spawn completely think maybe it must be the utc is there anything major in the utc that i must in order for this to work You have to assign the heartbeat script to the ScriptHeartbeat field, other than that I can't think of anything in particular (aside from the above mentioned IgnoreCrePath field, but that has nothing to do with this problem). Make sure that the resref to the script is correctly set in this field, and has no trailing spaces. Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 i can't find any faults i'm using kotor tool to edit the utc shouldn't be a problem should it? Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 i can't find any faults i'm using kotor tool to edit the utc shouldn't be a problem should it? I wouldn't say no problems (it has a tendency to mess up the force power list on occasion, I've noticed), but I can't think of any that would cause your current problem. Post your UTC file and I'll have a look at it an see if I can spot anything that looks wrong. Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 Ok here is the UTC Download Here Link to comment Share on other sites More sharing options...
stoffe Posted August 19, 2005 Share Posted August 19, 2005 Ok here is the UTC Download Here As far as I can see you are using the standard heartbeat script, k_hen_heartbt01, for the creature. You'll need to use one like the one I posted before in this thread. The standard associate heartbeat will only make party members follow, not puppets. That's why you need the custom script. Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 That is so wierd the copy i have the heartbeat script has been modified to the custom one christ knows how i messed this all up sorry for the inconvenience must be the lack of sleep Link to comment Share on other sites More sharing options...
RandomTask Posted August 19, 2005 Author Share Posted August 19, 2005 Turns out i had two UTC files one the desktop that i thought i was editing and one in my documents that i was editing and i kept puttiing the unedited version in the override folder my fault for being tired and stupid. Working great now thanks Stoffe for your time and patience Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.