ending bonus stage

Gurtag

Member
sup guys, i have a bonus level in wich you must kill all enemies before time runs out, i set the bonus level with type 1 0 0 so when time runs out level ends, so far good, however i would like to get same functionality when player dies, is there a script or command to make this posible? i mean when enmies kill me, level ends and jump to next with lives/health full/intact
 
That's doable however whose death script will read?
- All players meaning all active players will have to die before level ends
- One player meaning if say player 1 dies, level ends even though other players are still active
 
Alright, here's an entity which requested script:
Code:
name		Gamon
type		panel
speed		10


anim	idle
@script
  if(frame > 1){
    int P1 = getplayerproperty(0, "entity");
    int HP1;

    if(P1){
      HP1 = getentityproperty(P1,"health");
    }

    if(HP1 <= 0){
      void self = getlocalvar("self");

      performattack(self, openborconstant("ANI_FOLLOW1"));
    }
  }
@end_script
	loop	1
	delay	1
	offset	450 400
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif

anim	follow1
@script
  if(frame == 1){
    int P1 = getplayerproperty(0, "entity");
    int MHP1 = getentityproperty(P1,"maxhealth");

    changeentityproperty(P1, "health", MHP1);

    jumptobranch("Lanjut", 1);
  }
@end_script
	delay	200
	offset	10 17
	frame	data/chars/misc/empty.gif
	delay	10
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif

With this entity in place, when player 1 dies, current level is ended and player are brought to next level with full health

If you're using this for multiplayer, I'd have to modify the script to check other player's health too
 
Alright, here's an entity which requested script:
Code:
name        Gamon
type        panel
speed        10


anim    idle
@script
  if(frame > 1){
    int P1 = getplayerproperty(0, "entity");
    int HP1;

    if(P1){
      HP1 = getentityproperty(P1,"health");
    }

    if(HP1 <= 0){
      void self = getlocalvar("self");

      performattack(self, openborconstant("ANI_FOLLOW1"));
    }
  }
@end_script
    loop    1
    delay    1
    offset    450 400
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif

anim    follow1
@script
  if(frame == 1){
    int P1 = getplayerproperty(0, "entity");
    int MHP1 = getentityproperty(P1,"maxhealth");

    changeentityproperty(P1, "health", MHP1);

    jumptobranch("Lanjut", 1);
  }
@end_script
    delay    200
    offset    10 17
    frame    data/chars/misc/empty.gif
    delay    10
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif

With this entity in place, when player 1 dies, current level is ended and player are brought to next level with full health

If you're using this for multiplayer, I'd have to modify the script to check other player's health too
been some time since this ;p . hey bloodbane if you hapen to see this sorry for been anoying but could you mod this script to work with multiplayer so if any player dies the level ends?

sorry for the necroposting, got it .... thanks a lot for all the teachings guys
 
Last edited:
share with us your solution :)
well i put the same script in to other entity, replaced the calls and cheks of player1 for 2 and spawned both entitys in the level. so far it works... every time player 1 or 2 dies it ends the level like intended...
i know it is very rudimentary solution but my script knoledge is akin to a monkey witha stick soo.. ;p
 
Back
Top Bottom