Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Spawn script for a recruit

Page: 1 of 1
 kavar000
12-30-2006, 5:16 PM
#1
i am in need of someones help i need to make a spawn script. but i am not sure how to do this i know that this is the code.

code:
void main ( )
{
float x=0.00f;
float y=0.00f;
float z=0.00f;
vector vecNPC=Vector(x,y,z);
location locNPC=Location(vecNPC, r);
Object oNPC=CreateObject(OBJECT_TYPE_CREATURE,"npc_mkavar",locNPC);
object opc=GetFirstpc( );
AssignCommand(ONPC,ActionMoveToObject(oPC) );
AssignCommand(ONPC,ActionStartConversation(oPC,"my_dlg") );
}


and i have the follow information from the werami armband

info:

Beginning whereami output:
Module: 204tel
> -78.74314
> 14.12152
> -0.00000
> Orientation: 286.98694
> Bearing: -1.27432

Nearest Creature: Tag: ond_dip Distance: 12.606m
Nearest Door: Tag: door_204sealed Distance: 16.162m
Nearest Placeable: Tag: desk2 Distance: 0.298m
Nearest Trigger: Tag: tr_medcall Distance: 5.381m
Nearest Waypoint: Tag: mn_medical Distance: 6.522m
End of whereami output
-----------

now i don't know were to put the following information if anyone knows please tell me so that i may procede.

thanks.




visite my website www.kotormods.tripod.com) :lurkblast
 stoffe
12-30-2006, 5:42 PM
#2
void main ( ) {
// ST: X, Y, Z coordinate of where to spawn, and facing angle of NPC.
location locNPC = Location(Vector(-78.74, 14.12, 0.0), 287.0);

// Spawn the NPC.
object oNPC = CreateObject(OBJECT_TYPE_CREATURE, "npc_mkavar", locNPC);
object oPC = GetFirstPC();

// ST: Make the NPC begin conversation with the player.
AssignCommand(oNPC, ActionMoveToObject(oPC) );
AssignCommand(oNPC, ActionStartConversation(oPC, "my_dlg"));
}


You set the X, Y and Z coordinate values you got from the whereami armband as parameters to the Vector() function, and set the facing angle (0-359) in the second parameter to the Location()function. The X/Y/Z values are in meters, so unless you need millimeter precision you could round off a few decimals. :) This should spawn a character created from the npc_mkavar.utc template at the specified coordinates. (The Z coordinate value is actually irrelevant when spawning characters since they always end up at the floor no matter what you set it to.)

Don't forget to change the name of the dialog file (marked in yellow above) in the script before compiling, unless the name of the file of the conversation to start actually is my_dlg.dlg.

Keep in mind that NWScript is case sensitive: oPC and OPC is not the same name. Your script had quite a few such mix-ups. :)
 kavar000
01-01-2007, 2:38 PM
#3
would someone like to create a spawn script for me. i will give you the infromation

Beginning whereami output:
Module: 204tel
> -78.74314
> 14.12152
> -0.00000
> Orientation: 286.98694
> Bearing: -1.27432

Nearest Creature: Tag: ond_dip Distance: 12.606m
Nearest Door: Tag: door_204sealed Distance: 16.162m
Nearest Placeable: Tag: desk2 Distance: 0.298m
Nearest Trigger: Tag: tr_medcall Distance: 5.381m
Nearest Waypoint: Tag: mn_medical Distance: 6.522m
End of whereami output
-----------

so if you can create it please send it to me.
thanks.

Mod note: Merged similar threads into one. ~M
Page: 1 of 1