Killing panel type entity

mtrain

New member
How to kill a panel type entity in the middle of the stage? Is there any script for this? Is it possible by the script to kill (remove) any entity on the screen i want at any time?
 
Yes, scroll position. The panel have the same speed as the camera, so it is following screen as a ui decoration from the start of the level, and in the middle (at definite scroll position) it must be removed. This is the first thing.
And the second thing i want to know is it possible to make a script, saying, @cmd entitykill "Door_01", that will allow you to put it on any (empty) entity that spawns and kill (remove) the existing on the screen entity with the name "Door_01". It is important for me because i have a lots of level decorations that will appear and disappear.
 
Ah if that's the case you should make a looping IDLE animation for the panel then set this script:

@script
    void self = getlocalvar("self");
    int XPos = openborvariant("xpos");

    if(XPos >= 2000){
      killentity(self);
    }
@end_script

This code will remove panel entity when scroll position reached 2000

As for your 2nd request, I can imagine editing smartbomb code by Damon Caskey to do that but I'm afraid the code would kill all entities with same name i.e if you have 5 entities with Door1 as name, the code would kill all of them
You sure you want this code?
 
Thank you, BB for the first solution! I will try it now)

As for second if the name is only thing, i always can give a unique name, right?)
Post that code if you can?) Thank you)
 
Ah, I almost forgotten about this thread, anyways here's the kill entity by name (alias) entity:

name Killer
type none


anim idle
@script
    void self = getlocalvar("self"); //Caller.

    if(frame==1){
      char Name = getentityproperty(self,"name");
      void vEntity;                                      //Target entity placeholder.
      int  iEntity;                                      //Entity enumeration holder.
      char iName;                                        //Entity Name.
      int  iMax      = openborvariant("ent_max");        //Entity count.

      //Enumerate and loop through entity collection.
      for(iEntity=0; iEntity<iMax; iEntity++){
        vEntity = getentity(iEntity);                //Get target entity from current loop.
        iName  = getentityproperty(vEntity, "name"); //Get target type.

        //Same alias but different entity?
        if(iName == Name && vEntity != self){
          killentity(vEntity);
        }
      }
    }
    if(frame==2){
      killentity(self);
    }
@end_script
delay 10
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif

Spawn it like this:

spawn Killer
alias Badd
coords 340 170
at 220

and it will remove any active entities with Badd alias excluding itself. It will remove itself after purging :)

HTH
 
Back
Top Bottom