Forcing model in stage

mersox

Active member
Hi all.

I have tried unsuccessfully to force a character selection in a given stage. Basically, I want players to use specific characters during the map. Usually you just make them use a weapon in that particular level (map), but in my case I have an extra problem to overcome: I want a specific character per player. In ther words:

Player 1 would be Leonardo ("leo_overhead")
Player 2 would be Michaelangelo("mike_overhead")
Player 3 would be Donatello ("don_overhead")
Player 4 would be Raphael ("raph_overhead")

skipselect doesn't work because the map comes up after each level, and skipselect seems to work only with the first level of a game.

SO  have been trying to use script in the map level. I have tried different examples and none works. Here are a couple:

spawn  delay
@script
void self = getlocalvar("self");
void p1 = getplayerproperty(0,"entity");
void p2 = getplayerproperty(1,"entity");
void p3 = getplayerproperty(2,"entity");
void p4 = getplayerproperty(3,"entity");


{
      changeplayerproperty(0, "model", "leo_overhead");
changeplayerproperty(1, "model", "mike_overhead");
changeplayerproperty(2, "model", "don_overhead");
changeplayerproperty(3, "model", "raph_overhead");
   
    }
@end_script
health 20
coords  160 185
at 0

or

spawn  delay
@script
void main()
{
      changeplayerproperty(0, "model", "leo_overhead");
changeplayerproperty(1, "model", "mike_overhead");
changeplayerproperty(2, "model", "don_overhead");
changeplayerproperty(3, "model", "raph_overhead");
   
    }
@end_script
health 20
coords  160 185
at 0

Ideas?
 
mersox said:
Hi all.

I have tried unsuccessfully to force a character selection in a given stage. Basically, I want players to use specific characters during the map. Usually you just make them use a weapon in that particular level (map), but in my case I have an extra problem to overcome: I want a specific character per player. In ther words:

Player 1 would be Leonardo ("leo_overhead")
Player 2 would be Michaelangelo("mike_overhead")
Player 3 would be Donatello ("don_overhead")
Player 4 would be Raphael ("raph_overhead")

skipselect doesn't work because the map comes up after each level, and skipselect seems to work only with the first level of a game.

SO  have been trying to use script in the map level. I have tried different examples and none works. Here are a couple:

spawn  delay
@script
void self = getlocalvar("self");
void p1 = getplayerproperty(0,"entity");
void p2 = getplayerproperty(1,"entity");
void p3 = getplayerproperty(2,"entity");
void p4 = getplayerproperty(3,"entity");


{
      changeplayerproperty(0, "model", "leo_overhead");
changeplayerproperty(1, "model", "mike_overhead");
changeplayerproperty(2, "model", "don_overhead");
changeplayerproperty(3, "model", "raph_overhead");
   
    }
@end_script
health 20
coords  160 185
at 0

or

spawn  delay
@script
void main()
{
      changeplayerproperty(0, "model", "leo_overhead");
changeplayerproperty(1, "model", "mike_overhead");
changeplayerproperty(2, "model", "don_overhead");
changeplayerproperty(3, "model", "raph_overhead");
   
    }
@end_script
health 20
coords  160 185
at 0

Ideas?

try to changeplayerproperty in loading.c
 
Bloodbane said:
Try changing each player's name too.
I've tried changing model like you before and it failed but after I added another line for changing name, it works

If it's not too much to ask... could you paste that script? Please?
 
Alright, let's see:

spawn  delay
@script
void main()
{
    void P1 = getplayerproperty(0, "entity");
    void P2 = getplayerproperty(1, "entity");
    void P3 = getplayerproperty(2, "entity");
    void P4 = getplayerproperty(3, "entity");

    changeentityproperty(P1, "model", "leo_overhead", 1);
    changeentityproperty(P1, "name", "leo_overhead");
    changeentityproperty(P2, "model", "mike_overhead", 1);
    changeentityproperty(P2, "name", "mike_overhead");
    changeentityproperty(P3, "model", "don_overhead", 1);
    changeentityproperty(P3, "name", "don_overhead");
    changeentityproperty(P4, "model", "raph_overhead", 1);
    changeentityproperty(P4, "name", "raph_overhead");   
    }
@end_script
health  20
coords  160 185
at  0

I've tried similar script and it works to forcefully change player 1's model and name to defined name
UNFORTUNATELY when player 1 is hit by an attack, he will revert to original model

FORTUNATELY after I set weaploss 3 in model's text, that issue is gone :)

HTH
 
Bloodbane said:
Alright, let's see:


I've tried similar script and it works to forcefully change player 1's model and name to defined name
UNFORTUNATELY when player 1 is hit by an attack, he will revert to original model

FORTUNATELY after I set weaploss 3 in model's text, that issue is gone :)

HTH

EXCELLENT!!! Worked like a charm! The only thing I had to add was "modelflag 1". Works perfectly now, thank you very much!
 
Ah, you're right that command is required too. Glad you got it working :)

Also I just realized that defined model must be correct but defined name could be anything. So you can use turtle's name instead
 
New ultra bug.

During the map stage, everything works fine. Players are forced to use "leo_overhead" and others.

Then players pick a stage, and then go to character selection screen where they can choose any character.

But then in the stage, if you day and press start to continue, you don't get to choose a characters, you are automatically given "leo_overhead", even though you're not in the map anymore! I find this so weird.

I even modified the map script so that it occurs only in the map, but that made no difference:
@script
void main()
{
if(openborvariant("current_stage")==2){

    void P1 = getplayerproperty(0, "entity");
    void P2 = getplayerproperty(1, "entity");
    void P3 = getplayerproperty(2, "entity");
    void P4 = getplayerproperty(3, "entity");


    changeentityproperty(P1, "model", "leo_overhead", 1);
    changeentityproperty(P1, "name", "leo_overhead");
    changeentityproperty(P2, "model", "mike_overhead", 1);
    changeentityproperty(P2, "name", "mike_overhead");
    changeentityproperty(P3, "model", "don_overhead", 1);
    changeentityproperty(P3, "name", "don_overhead");
    changeentityproperty(P4, "model", "raph_overhead", 1);
    changeentityproperty(P4, "name", "raph_overhead");   
    }
}
@end_script
 
Upon further tweaks I can confirm that the bug is not caused by the script at all. If anything it seems to be caused by skipselect at the start of the game. BUT WHY
 
skipselect and nosame is still bugged too I think  :'(

My TMNT mod I couldn't set it properly so that you can't use the same turtle. 

Whitedragon scripted around it for his mod.
 
This gets weirder and weirder.

I went to levels.txt and removed all instances of skipselect and also the map stages(therefore the script forcing a model is not present in the game).

I start the game on a normal stage, kill myself and upon continue... I can't select a character and I am assigned the "map" character (leo overhead)!!!! The bug is still present! What gives?!

Could there be remnants of previous gameplays in the cache that are messing everything up? I deleted the .sav files to test that but the bug is still present.

This is just too weird.
 
Back
Top Bottom