Jump to content

Home

Making something spawn once through heartbeat tag?


Canderis

Recommended Posts

You can add a conditional before spawning to check for the existence of the object, something like this:

 

void main() {
  if( GetObjectByTag( "xxxxx" ) == OBJECT_INVALID ) {
  // Spawn Stuff
  }
}

 

xxxxx is the tag of the item you want to spawn.

 

- Star Admiral

Link to comment
Share on other sites

The check didn't work they kept spawning. But at least they spawned. They didn't before...

 

  if( GetObjectByTag( "p_t4m8" ) == OBJECT_INVALID ) {
  // Spawn Stuff
  CreateObject( OBJECT_TYPE_CREATURE, "p_t4m8", GetLocation(GetFirstPC())); 
  }

This is also only a part of the whole script, i decided not to post that cuz its the default heartbeat stuff.

 

EDIT: This is for k1

Link to comment
Share on other sites

I'm not sure if its a script problem or not. Could you change the heartbeat script to something like this:

 

SendMessageToPC( GetFirstPC(), "I did not spawn." );
if( GetObjectByTag( "p_t4m8" ) == OBJECT_INVALID ) {
  CreateObject( OBJECT_TYPE_CREATURE, "p_t4m8", GetLocation(GetFirstPC()));
  SendMessageToPC( GetFirstPC(), "I spawned." );
}

 

Which of the two messages shows up in your feedback page?

 

- Star Admiral

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...