Respawn with zero MP

O Ilusionista

Captain 100K
I am changing how the MP works on PDC and now you start with zero MP and fill the bar over time.
I've added a code on the spawnscript to set the MP to 0 and it works, but this doesn't trigger in RESPAWN anim.

According to the manual, we have a function which triggers once you respawn:
respawn#.c
Corresponding player# (1-4) respawns after death.

But I save this file as respawn1.c and it didn't worked:

C-like:
void main()
{
void self = getlocalvar("self");
changeentityproperty(self, "mp", 0);
settextobj(0, 200, 30, 0, 300, "respawn", 300+openborvariant("elapsed_time"));
}

The engine isn't even reading it (as the settextobj isn't printing anything).

Is this broken in V3?
 
I am changing how the MP works on PDC and now you start with zero MP and fill the bar over time.
I've added a code on the spawnscript to set the MP to 0 and it works, but this doesn't trigger in RESPAWN anim.

According to the manual, we have a function which triggers once you respawn:


But I save this file as respawn1.c and it didn't worked:

C-like:
void main()
{
void self = getlocalvar("self");
changeentityproperty(self, "mp", 0);
settextobj(0, 200, 30, 0, 300, "respawn", 300+openborvariant("elapsed_time"));
}

The engine isn't even reading it (as the settextobj isn't printing anything).

Is this broken in V3?

I'll test some things and see.

DC
 
Doesn't using 0 in MP work in level.c? Everytime you begin a level with that, the player starts its MP with 0 starting from the very beginning.

level.c:
C:
void main(){
    int P1 = getplayerproperty(0, "ent");
    int P2 = getplayerproperty(1, "ent");
    int P3 = getplayerproperty(2, "ent");
    int P4 = getplayerproperty(3, "ent");

    changeentityproperty(P1, "mp", 0);
    changeentityproperty(P2, "mp", 0);
    changeentityproperty(P3, "mp", 0);
    changeentityproperty(P4 "mp", 0);
}

respawn#.c still works for me.

Example:
respawn1.c:
C:
void main(){
    int P1 = getplayerproperty(0, "entity");
    changeentityproperty(P1, "mp", 0);
}
 
Tested in the v3 6391 and looks fine. What version are you using?


I had also tested @Kratus, but using PDC, and with log traces instead of screen prompts to make certain - it's a no go. Not even the oncreate/ondestroy functions run, which means the scripts are never loading in the first place. No doubt it's something simple, but IMO, there are, far, FAR too many moving parts in the module to go trying to find the conflict.

DC
 
I have an outdated version of the PDC and the same issue happens, the text even sometimes blinks but it's too fast.

However, I noticed that there's a lot of other settextobj instances using the same index of 0, I suspect that they are refreshing the timer previously defined at the respawn1.c, making the text disappear instantly.

1757047885257.png

1757047929290.png

At least in this case, I was able to solve the problem by just changing the respawn1.c text index to other number, this way the timer will work separate from the other indexes.

1757048085212.png
 
Back
Top Bottom