SOLVED Respawn in specific place

dantedevil

Well-known member
I have an stage with size 996 x 278 and z 230 270.
This stage have a ring in the middle, where you fight against Zangief.
This stage have scroll both, and I want the player always respawn in the middle of the stage, then in the middle of the ring.
 
Solution
Alright, here's the entity text + script:
name SpawnSpot
type none
offscreenkill 3000


anim idle
@script
    void self = getlocalvar("self");
    void P1 = getplayerproperty(0, "entity");
    void P2 = getplayerproperty(1, "entity");
    void P3 = getplayerproperty(2, "entity");

    if(P1){
      void P1Ani = getentityproperty(P1,"animationID");

      if(P1Ani == openborconstant("ANI_RESPAWN")){
        int x = getentityproperty(self,"x");
        int z = getentityproperty(self,"z");

        changeentityproperty(P1, "position", x, z, 0);
      }
    }
    if(P2){
      void P2Ani = getentityproperty(P2,"animationID");

      if(P2Ani == openborconstant("ANI_RESPAWN")){
        int x = getentityproperty(self,"x");
        int z...
There are two ways to do this:
1. Use special entity which will move respawning/spawning players at middle of the ring
2. Use spawn relocating system

#1 is great for single use but due to check rate, you might see a small glitch
#2 is great for multiple usage but it's complex as you need to modify multiple texts + set some scripts

So which one do you prefer?
 
I've created special entity for #1 option and it works great :D

Before I could share it here, I need to ask: do you want all three players respawn in same place OR in different places?
If the answer is the former, I could combine all scripts in just one entity but if it's the latter, I'd need to create 3 entities
 
Alright, here's the entity text + script:
name SpawnSpot
type none
offscreenkill 3000


anim idle
@script
    void self = getlocalvar("self");
    void P1 = getplayerproperty(0, "entity");
    void P2 = getplayerproperty(1, "entity");
    void P3 = getplayerproperty(2, "entity");

    if(P1){
      void P1Ani = getentityproperty(P1,"animationID");

      if(P1Ani == openborconstant("ANI_RESPAWN")){
        int x = getentityproperty(self,"x");
        int z = getentityproperty(self,"z");

        changeentityproperty(P1, "position", x, z, 0);
      }
    }
    if(P2){
      void P2Ani = getentityproperty(P2,"animationID");

      if(P2Ani == openborconstant("ANI_RESPAWN")){
        int x = getentityproperty(self,"x");
        int z = getentityproperty(self,"z");

        changeentityproperty(P2, "position", x, z, 0);
      }
    }
    if(P3){
      void P3Ani = getentityproperty(P3,"animationID");

      if(P3Ani == openborconstant("ANI_RESPAWN")){
        int x = getentityproperty(self,"x");
        int z = getentityproperty(self,"z");

        changeentityproperty(P3, "position", x, z, 0);
      }
    }
@end_script
loop 1
delay 1
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif

This entity will put any players playing RESPAWN animation in its coordinate. So if you spawn it in x=700 and z=200, respawning players will be moved to that coordinate

HTH
 
Solution
Back
Top Bottom