View Single Post
Old 03-31-2013, 12:02 AM   #15
arsenalforever
Rookie
 
Join Date: Apr 2012
Posts: 65
I showed zbyl2 your script and this is what he had to say:

Quote:
That latest script you posted suggests you'd like to fire a script through NPC's OnHeartbeat event; bad way to do it - OnHeartbeat script is fired by game's engine every six seconds and is often unpredictable (as is GetLastPerceived() function due to the way engine works, GetDistanceToObject() would be better). Again, triggers would be better.
Here is a list of the scripts I have currently (I'll make the conversation scripts later. I just want to see if the Gammorean is spawning correctly):

1. Gamspawn101.nss

Code:
void main()
{
object oEntering = GetEnteringObject();
object Gamtest = GetObjectByTag("g_gammorean01");

if(GetIsPC(oEntering))
{

if(GetIsObjectValid(Gamtest)==FALSE)
{
ExecuteScript("gamspawn",OBJECT_SELF);
}
}
ExecuteScript("k_501_enter",OBJECT_SELF);
}
2. gamspawn.nss:

Code:
void main()
{
        vector Spawn; 
        Spawn.x = 24.0;   
        Spawn.y = 34.0;   
        Spawn.z = 65.0;   
        
CreateObject(OBJECT_TYPE_CREATURE, "g_gammorean01", Location(Spawn,0.0));
ExecuteScript("k_501_enter", OBJECT_SELF);
}
The OnEnter value for Iziz Airport was k_501_enter but why do I need to execute k_501_enter at the end of both the scripts?
Are the above two scripts enough for me to be able to see the Gammorean in the Iziz Spaceport?

Thanks.

Last edited by arsenalforever; 03-31-2013 at 12:08 AM.
arsenalforever is offline   you may: quote & reply,