kavar000 Posted December 30, 2006 Share Posted December 30, 2006 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 http://www.kotormods.tripod.com Link to comment Share on other sites More sharing options...
stoffe Posted December 30, 2006 Share Posted December 30, 2006 void main ( ) { [color=PaleGreen]// ST: X, Y, Z coordinate of where to spawn, and facing angle of NPC.[/color] location locNPC = Location(Vector(-78.74, 14.12, 0.0), 287.0); [color=PaleGreen]// Spawn the NPC.[/color] object oNPC = CreateObject(OBJECT_TYPE_CREATURE, "npc_mkavar", locNPC); object oPC = GetFirstPC(); [color=PaleGreen]// ST: Make the NPC begin conversation with the player.[/color] AssignCommand(oNPC, ActionMoveToObject(oPC) ); AssignCommand(oNPC, ActionStartConversation(oPC, "[color=Yellow]my_dlg[/color]")); } 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. Link to comment Share on other sites More sharing options...
kavar000 Posted January 1, 2007 Author Share Posted January 1, 2007 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.