summonkill not working

oldyz

Well-known member
Enemies generated at random cannot drop items like bosser when they die when thrown - or if they are missing a death animation somewhere.
these random entities cant use this functions either:

spawn mutant2XRand
item bosser
coords 35 200
at 0
(in this example, any mutant generated by 2xrand does not drop bosser when killed)

i thought a solution would be to summon an entity using summonframe on all the  monsters spawn animation  - but if i kill the parent the sumoned entity wont die. it seems this function is broken.

what other options can i use to make sure that when an entity is dead it kills another?
 
(in this example, any mutant generated by 2xrand does not drop bosser when killed)
If I understood right, for sure it won't. When you set "item", you are giving it to that entity when something defeats it - and not to subentities created by script.

Like DC said to me long time ago, keep in mind by using script you have full control of many things. But YOU have the control of many things :)
Script does only what you told it to do.

For example:
If you use a native bomb or knife and those entities have "candamage player" on their header, that projectile will hit other players, but not its owner.
When you spawn something with script, it will hit all players... including who called it.
And why? Because the spawned entity doesn't know who is its OWNER (and the native function do know).

So the script will do exactly you told the engine to do: spawn the entity.

in you case, you will need to add the item spawn on their death animations.
 
kimono & O Ilusionista
So in this experiment - spawning any thing with summonframe - bats, zombies , etc, in
the way its supposed to work is when the mutant dies, the summoned monster is supposed to die too but it does not happen.

So in the experiment i need this:
I need mutantX to summon a mutantJunior at the 3rd frame of his spawn animation, or his rise animation.
BUt i need mutantjunior to die if mutantX does.
IF mutantx is defeated by a throw - there is no death animation - so mutantjunior wont die if this ever happens

so to fix this thought:
1 - Find a way to force a death animation to happen if the mutantX gets death by throw (to avoid the bug)
or
2 - use summonkill

i tried the script in this thread, https://www.chronocrash.com/forum/index.php?topic=286.msg1723#msg1723
but it did not work

i can't/don't want use these lines highlighted in red:
spawn mutant2X
item killjunioTrigger
coords  35 200
at  0

because mutantX itself will be spawned using script the majority of the time

 
oldyz said:
I need mutantX to summon a mutantJunior at the 3rd frame of his spawn animation, or his rise animation.
BUt i need mutantjunior to die if mutantX does.

You can try using ondeathscript. It will be run even if entity is killed by falling to hole.
 
Bloodbane -
so if understand correctly - i can point out a script like "bosslow" like this?  :

ondeathscript data/scripts/bosslow.c

booslow script :
Code:
	@script
	void self = getlocalvar("self");
	if (frame == 0){
	changeopenborvariant("slowmotion", 1);
	}
	if (frame == 22){
	changeopenborvariant("slowmotion", 0);
	damageentity(self, self, 1, 0, openborconstant("ATK_NORMAL"));
	}
	@end_script

so i need to create a script similar to this one, but for killing or triggering an animspecial - the only problem is , how do i define the specific character that i want to target?

basically - this:

spawn fullhouse    --------------------  if any of the cards spawned by "full house" die.....

coords 35 200
at 0

spawn trigger    ----------------------------  i need their death (no matter how) to finish off "trigger"
item Sunrise
coords 95 220
at 0


spawn dog  -------------------------------  the sunrise animation "item drop" triggers the dog to stop barking

coords 97 220
at 0

fullhouse cannot be killed, it is an entity that only exists to generate one card out of 7 & dissapears
trigger is an entity that will be used as a generic "item dropper" - with the right script it should work with any entity.


-- mmm  now that i think about it, i can try & bind "full house" to the cards via the spawn animation -
but will it die when i kill the card?



 
  ???

I'm really perplexed right now  ??? . You posted about mutants before and now you posted cards  :o .

Alright, let me analyze it again....

when an entity is dead it kills another?
but for killing or triggering an animspecial

There are 2 ways to do this.
1. The dead entity finds the other entity then kill it or force it to perform an animation.
OR
2. The dead entity leaves a signal which could be read by other entities.

For #1, you'd need to run function to scan all active entities like this:
Code:
void cari(void Name)
{// Find entity with defined Name then return that entity (if there were any)
    void vEntity;                                       //Target entity placeholder.
    int  iEntity;                                       //Entity enumeration holder.
    int  iName;                                         //Entity name.
    int  iMax      = openborvariant("count_entities");  //Entity count.
    int  iHealth; void Result;

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

      if(iName == Name){
        if(iHealth > 0){
          Result = vEntity;
          break;
        } else {
          Result = -1;
          break;
        }
      } else {
        Result = 0;
      }
    }
    return Result;
}

then do something to the found entity if it finds any.

For #2, you can use global variable to store the signal. Other entities could regularly check the variable in IDLE animation and do something if signal is read.

Each way has pros and cons so choose wisely :)
 
thanks  Bloodbane

also take a look a this post: https://www.chronocrash.com/forum/index.php?topic=5704.msg76109#msg76109

all i am trying to do is to restore or "transfer" an "Item flag"  from an entity spawned in a typical fashion to another that was spawned using script -
unfortunatelyy i did not have a correct description & could only explain what i was trying to do trough the only methods i know/understand, and that lead to many possible solutions & new knowledge
 
Yeah, transferring item from entity to its subentity is a questionable trick. If you need to do that, there must be some mechanic you'd need, which better coded in other way.
 
Back
Top Bottom