Page 1 of 1

Destroy an object

Posted: Thu Jul 19, 2007 1:00 pm
by m4dh4tt3r
Is there any way to destroy a created object. Not a refrence to an obj objective. Lets say i create a corona for example then i want that object to (for lack of better term) Disappear, i know in other programing languages they use a destroy or release command but havent seen anything as far as medal of honor is concerned.

Thanks
H4tt3r

Posted: Thu Jul 19, 2007 2:06 pm
by Condor
Create a script_model, select it, press "N" to open the entity dialouge, and create these entries:

Key: model
Value: fx/corona_red.tik


Key: targetname
Value: mycorona


In the script insert at the point, where you want to "destroy" your corona, the lines:

Code: Select all

$mycorona hide
$mycorona notsolid
To show it, if its hidden, use:

Code: Select all

$mycorona show
$mycorona solid

Posted: Thu Jul 19, 2007 3:51 pm
by jv_map
For the more destructive under the .Map members, either:
  • $mycorona delete
  • $mycorona remove
  • $mycorona immediateremove :twisted:

Posted: Thu Jul 19, 2007 6:44 pm
by Condor
Mhh...didn't know these, so they all get removed from the memory, -> performance gets better?

remove

Posted: Sat Jul 21, 2007 7:19 am
by tltrude
If the players can't see it, frame rate goes up!

You can also remove things by "classname" in the script -- I don't remember how. But, if you tell the game to remove the classname "corona_red", all of the red coronas in the map would vanish.

Posted: Sun Jul 22, 2007 5:51 pm
by c_los

Code: Select all

removeclass actor
i know that that removes all ai from map... im not sure if it works with more specific classes further down the tree though :/