Jump to content

Home

Need help for a script


Fastmaniac

Recommended Posts

Heyo,

 

I'm currently working on a Recruitment Mod which is nearly completed by now (Only things left to do are VOs and Betatesting). Now I wanted to have the mod start earlier in the game so I started by changing the location of the character to spawn and attaching the script to a conversation. Then I wanted the NPC to walk to the location of the PC. So, my Problem is: When the scripts are triggered the conversation stops. The Spawn script is triggered correctly but the walking script doesn't work. The script worked fine in the conversation on Dantooine. Maybe someone here can help me spot the mistake.

 

Thanks for helping

 

Spawn script:

 

void main() 
{ 

   float x = 185.75; 
   float y = 116.26; 
   float z = 0.0; 
   float r = 0.0; 

   vector vCre = Vector(x, y, z); 
   location lCre = Location(vCre, r); 

   object oCre = CreateObject(OBJECT_TYPE_CREATURE, "n_lok_spwn", lCre); 


}

 

Walking script:

 

void main(){
          ActionPauseConversation();
          ActionWait(2.0);
          object oObject = GetObjectByTag("n_lokana",1);
          object oPC = GetFirstPC();
          location lLoc = GetLocation(oPC);
          AssignCommand(oObject, ActionMoveToLocation(lLoc, 1));
          ActionResumeConversation();
}

Link to comment
Share on other sites

object oCre = CreateObject(OBJECT_TYPE_CREATURE, "n_lok_spwn", lCre);

Is "n_lok_spwn" a tag or a script? I would think it is a tag, and it must be if it compiles and spawns properly as you say... just the name confuses me a little.

 

If it is a tag for your npc, then your walking script would seem to be calling a "different" creature... as the tag there is "n_lokana".

 

Not sure what it is worth....

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...