Darth Xander Posted December 1, 2007 Share Posted December 1, 2007 Could somebody make me a script that spawns a custom npc right next to the pc? I made this but It will not work: void main () { location locNPC=Location(GetFirstPC); object oNPC=GetObjectByTag(pc_jedi");} Link to comment Share on other sites More sharing options...
Miles Edgeworth Posted December 1, 2007 Share Posted December 1, 2007 This should work: CreateObject( OBJECT_TYPE_CREATURE, "pc_jedi", GetLocation(GetFirstPC())); Link to comment Share on other sites More sharing options...
Darth Xander Posted December 8, 2007 Author Share Posted December 8, 2007 This should work: CreateObject( OBJECT_TYPE_CREATURE, "pc_jedi", GetLocation(GetFirstPC())); That script won't work, It says something about a syntax error at CreateObject. By the way this is for TSL. Link to comment Share on other sites More sharing options...
Marius Fett Posted December 8, 2007 Share Posted December 8, 2007 Try putting a void main () at the start of it, like this: void main() { CreateObject( OBJECT_TYPE_CREATURE, "pc_jedi", GetLocation(GetFirstPC())); } Link to comment Share on other sites More sharing options...
Darth Xander Posted December 8, 2007 Author Share Posted December 8, 2007 THANK YOU THANK YOU THANK YOU. DarthDingDong YOU ROCK!!!! Link to comment Share on other sites More sharing options...
Marius Fett Posted December 8, 2007 Share Posted December 8, 2007 Umm..... no problem... Link to comment Share on other sites More sharing options...
Darth Xander Posted December 8, 2007 Author Share Posted December 8, 2007 I have almost finished my W.I.P but could I have a script that makes an npc salute? Link to comment Share on other sites More sharing options...
Marius Fett Posted December 8, 2007 Share Posted December 8, 2007 I don't know how to do that, I SUCK at scripting........ Link to comment Share on other sites More sharing options...
Darth Xander Posted December 8, 2007 Author Share Posted December 8, 2007 Also I need this npc I am making to act and react like a party member but he musn't be a party member. Basically all I want him to do is to be follow me around. Link to comment Share on other sites More sharing options...
glovemaster Posted December 8, 2007 Share Posted December 8, 2007 You could try: void main() { CreateObject(OBJECT_TYPE_CREATURE, "pc_jedi", GetLocation(GetFirstPC())); object PC_JEDI = GetObjectByTag("pc_jedi"); AssignCommand(PC_JEDI, ActionPlayAnimation(104, 1.0)); DelayCommand(5.0, AssignCommand(PC_JEDI, ActionForceFollowObject(GetFirstPC()))); } This will only get the created NPC to salute and follow the lead player, if you want to script in combat then im thinking of a "OnHeartBeat" script to get whether or not you are in combat, who the target is and to attack that target. Link to comment Share on other sites More sharing options...
Darth Xander Posted December 9, 2007 Author Share Posted December 9, 2007 I used Dak Vesser's script to make him follow me but I still need to make the guy salute. You guys who helped me will be fully credited. // k_fpm_heartbtxx #include "k_inc_debug" #include "k_inc_generic" #include "k_inc_switch" #include "k_inc_utility" void main() { object oEnemy = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, 1, CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); if(!GN_GetSpawnInCondition(SW_FLAG_AI_OFF) && !GetSoloMode()) { if(GetPartyMemberByIndex(0) != OBJECT_SELF) { if(//GetCurrentAction(OBJECT_SELF) != ACTION_FOLLOW && GetCurrentAction(OBJECT_SELF) != ACTION_WAIT && !GetIsConversationActive() && !GN_GetSpawnInCondition(SW_FLAG_SPECTATOR_STATE) && GetCommandable()) { if(!GN_GetIsFighting(OBJECT_SELF) && !GetIsObjectValid(oEnemy)) ClearAllActions(); if(GetDistanceBetween(OBJECT_SELF, GetPartyMemberByIndex(0)) < 5.0) { ClearAllActions(); ActionForceMoveToObject(GetPartyMemberByIndex(0), FALSE, 1.0); //SendMessageToPC(GetFirstPC(), "Debug Message: Henchmen just executed the bWalk routine."); } if(GetDistanceBetween(OBJECT_SELF, GetPartyMemberByIndex(0)) > 5.0) { ClearAllActions(); ActionForceMoveToObject(GetPartyMemberByIndex(0), TRUE, 3.5); //SendMessageToPC(GetFirstPC(), "Debug Message: Henchmen just executed the bRun routine."); } } } } else if(GetSoloMode() && GetCurrentAction(OBJECT_SELF) == ACTION_FOLLOWLEADER) { ClearAllActions(); } if(GN_GetSpawnInCondition(SW_FLAG_EVENT_ON_HEARTBEAT)) { SignalEvent(OBJECT_SELF, EventUserDefined(1001)); } } Link to comment Share on other sites More sharing options...
DarthJebus05 Posted December 9, 2007 Share Posted December 9, 2007 Doesn't a Sith salute in the game? If this is for a dialog file, just find the animation. What are you looking for exactly? Someone that salutes randomly? Dialog animations? Link to comment Share on other sites More sharing options...
Darth Xander Posted December 9, 2007 Author Share Posted December 9, 2007 I am after a script that makes the npc salute not an animation. Link to comment Share on other sites More sharing options...
Marius Fett Posted December 9, 2007 Share Posted December 9, 2007 The script would fire an animation... Link to comment Share on other sites More sharing options...
Darth Xander Posted December 9, 2007 Author Share Posted December 9, 2007 Ok last one, forget teh salute it was a lame idea anyway. I need a script that makes a placeable disappear once it closes. And by disapperar I mean like fading away not "pop out of existance". Thank you guys for all your help I won't forget this. Edit: I have finished this mod, thank you everyone who helped ans tried to help. You have all been fully credited and I will post a link soon. Link to comment Share on other sites More sharing options...
DarthJebus05 Posted December 27, 2007 Share Posted December 27, 2007 Never posted the link... unless it's in another thread. Anyways, I just bought my TSL from Ebay tonight, so instant download when I get it Link to comment Share on other sites More sharing options...
Marius Fett Posted December 27, 2007 Share Posted December 27, 2007 I just got my new copy of TSL off Amazon.co.uk Link to comment Share on other sites More sharing options...
DarthJebus05 Posted December 27, 2007 Share Posted December 27, 2007 Amazon doesn't deliver to my area Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.