Jump to content

Home

I need a script...


Darth Xander

Recommended Posts

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

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

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

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...