Jump to content

clearmap


wildcherrii
 Share

Recommended Posts

I'm wondering, if I have a map entity that loads in with a script,  then the Function Start() of that entity script loads a  Sound File,  do I need to keep track of these additional loads for when I do a clearmap(0 and load a new level ?   or does these extra resources get removed on a new map load?

What exactly gets removed from a world:Clear() ???

 

Im stuck on one major problem,  I have  entity:EmitSound() playing some footstep sounds as the enemy approach me. I want to kill the  looping footstep sound when he gets close to me then stops.  I've done intense reading on the forums and I see others had this delima to but no solution was recolved? This posts were back in 2014 and some point to dead 404 pages.

So basically I have to destroy the entire entity and reload it just to stop a looping 3d emited sound ?

And to add to the FUN !  this is what the docs say regarding EmitSound parms.

 

Parameters

  • sound: the new pick radius to set.
  • range: the new pick radius to set.
  • volume: the new pick radius to set.
  • pitch: the new pick radius to set.
  • loopmode: the new pick radius to set.
  • source: the new pick radius to set.

 

Good times. 

Link to comment
Share on other sites

OKay thank you both for the answers.,

If I'm loading some assets in a Script:Start() function for an NPC like this - 

self.footsteps = Sound:Load("Sound/footsteps/running.wav") 
 

Do I need to manually remove these assets when Im changing map files even though world:Clear() is being called?

Link to comment
Share on other sites

Perfect, okay one last question and I think I can solve all my map changing woes.

I load several prefabbed particle emitters throughout my map at certain times. ( via lua code ).

Do these emitters die and release once they run out ? or do I need to track them as well and release them on map clear?

 

 

Link to comment
Share on other sites

World::Clear() will decrement the reference count of all entities in the world. Unless you have manually incremented the reference count, they will all be deleted.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...