Respawn Body

Respawn Body 1.0

No permission to download

DatKofGuy

Active member
Hey, so I'm still getting a hang of using and writing scripts. I am bit stuck now making use of scripts written by others.
I want to implement the respawn in place script written by DC.

I followed the steps properly (I think), however when the player dies, they either play the default spawn, or the respawn animation if they have it, at the position set out by the level, instead of where the player died as I see the script is supposed to do.

So I downloaded the script, placed it in the scripts folder.

Added the death settings:
falldie 1
nodieblink 3

Then I made a new script spawn.c, and copied the example code in it.
Code:
#import "data/scripts/dc_respawn_body.c"

void main()
{
    void acting_entity = getlocalvar("self");

    int animation_id = openborconstant("ANI_RISE");

    /*
    * Find our body, remove it and play the
    * rise animation. "That's all you got?!"
    */
    dc_respawn_body(acting_entity, animation_id);
}

I then added the following to my player:
Code:
onspawnscript    data/scripts/spawn.c

Did do something wrong? Or did I miss something?
 
Didn't realize this resource did not yet have a discussion thread. I've added and linked to resource.

@DatKofGuy, I moved your question to the resource thread. Everything looks good at first glance, so the next step is add a log trace into the respawn body function. That will tell us if it is firing properly.

C:
log("\n\n Hello world! \n\n");

You can make it say other things of course, and even display stuff from script variables. That's just a sample.

DC
 
Last edited:
thanks for the reply @DCurrent

So I added a few log prompts through out the script eg:

Code:
  if (!getentityproperty(target, "exists"))
        {
            log("Target exists");
            continue;
               }
Code:
killentity(target);
log("Entity killed");

I did this at a few sections of the code.

Ran the game, got the player killed, and still the same happens as expected. Checked the ScriptLog in the logs folder, and nothing about this script is shown.
So maybe the script is not being called?

For reference, this is how I have my player settings set up
Code:
name    Terry
health    100
speed    12
type    player
shadow    4
combostyle 1
atchain    1 2 3 4 5 6
falldie     1
nodieblink 3
dust    dust

onspawnscript    data/scripts/spawn.c
icon    data/chars/TerryBogard/icon.png
palette  data/chars/TerryBogard/pal.png
diesound data/chars/TerryBogard/lose2.wav
 
thanks for the reply @DCurrent

So I added a few log prompts through out the script eg:

Code:
  if (!getentityproperty(target, "exists"))
        {
            log("Target exists");
            continue;
               }
Code:
killentity(target);
log("Entity killed");

I did this at a few sections of the code.

Ran the game, got the player killed, and still the same happens as expected. Checked the ScriptLog in the logs folder, and nothing about this script is shown.
So maybe the script is not being called?

For reference, this is how I have my player settings set up
Code:
name    Terry
health    100
speed    12
type    player
shadow    4
combostyle 1
atchain    1 2 3 4 5 6
falldie     1
nodieblink 3
dust    dust

onspawnscript    data/scripts/spawn.c
icon    data/chars/TerryBogard/icon.png
palette  data/chars/TerryBogard/pal.png
diesound data/chars/TerryBogard/lose2.wav

Script log is just a compilation check. Don't worry about what's in it unless you can read code.

The outputs from log() function show up in the regular log. Sometimes you have to look closely or run a find if you have a lot of things going on in your game.

DC
 
Ok, so checked the log and this is what I found.
Code:
 Target is dead 



 Check

 Check

 Check

 Check

 Check

 Check

 Check

 Target is dead 



 Target is dead 



 Target is dead 



 Target is dead

I did put log prompt at every check, so not sure why its not printing it out like its doing for Target is dead.
 
Back
Top Bottom