Destroy an object

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
m4dh4tt3r
Private
Posts: 1
Joined: Thu Jul 19, 2007 12:52 pm

Destroy an object

Post 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
Condor
Colour Sergeant
Posts: 82
Joined: Mon Apr 09, 2007 3:19 pm
Location: Bavaria (Germany)

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

For the more destructive under the .Map members, either:
  • $mycorona delete
  • $mycorona remove
  • $mycorona immediateremove :twisted:
Image
Condor
Colour Sergeant
Posts: 82
Joined: Mon Apr 09, 2007 3:19 pm
Location: Bavaria (Germany)

Post by Condor »

Mhh...didn't know these, so they all get removed from the memory, -> performance gets better?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

remove

Post 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.
Tom Trude,

Image
c_los
Private
Posts: 7
Joined: Tue Jul 03, 2007 7:53 pm

Post 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 :/
Post Reply