Canderis Posted June 29, 2009 Share Posted June 29, 2009 If I put in a modified version of the OnHeartBeat to spawn something will it keep spawning or will it only spawn once? If it does spawn more than one how can I make it so it does only spawn once in that module? Link to comment Share on other sites More sharing options...
Star Admiral Posted June 29, 2009 Share Posted June 29, 2009 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 More sharing options...
Canderis Posted June 29, 2009 Author Share Posted June 29, 2009 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 More sharing options...
Star Admiral Posted June 29, 2009 Share Posted June 29, 2009 Did you make sure that the template resref and the tag of the creature you are spawning are the same? - Star Admiral Link to comment Share on other sites More sharing options...
Canderis Posted June 29, 2009 Author Share Posted June 29, 2009 Man.. I always miss the obvious... EDIT: Now he dosn't spawn again when you enter another module. Link to comment Share on other sites More sharing options...
Star Admiral Posted June 30, 2009 Share Posted June 30, 2009 I take it you want the creature to spawn once every time it enters a different module? Is it a custom module you are making, or a regular ingame one? - Star Admiral Link to comment Share on other sites More sharing options...
Canderis Posted June 30, 2009 Author Share Posted June 30, 2009 Both. Mostly ingame Link to comment Share on other sites More sharing options...
Star Admiral Posted June 30, 2009 Share Posted June 30, 2009 Is the creature supposed to be a puppet of some sort? And does the creature not respawn when you re-enter a module you already visited, or does the creature not respawn when you enter all modules? - Star Admiral Link to comment Share on other sites More sharing options...
Canderis Posted June 30, 2009 Author Share Posted June 30, 2009 Yup i am experementing with making k1 puppets, he is still in the first module but he doesn't spawn into another module. Link to comment Share on other sites More sharing options...
Star Admiral Posted June 30, 2009 Share Posted June 30, 2009 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 More sharing options...
Canderis Posted June 30, 2009 Author Share Posted June 30, 2009 In another module i get I did not spawn. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.