special pallette to P1,P2,P3,P4 players.

ShovelToad

New member
:)
Good Day, I have a some question.

It needs to make P1 always use Player1_pal.gif, and P2 always must use Player2_pal.gif

Also it needs to make "Wait" animalion is use special unique GIF to each Players (P1,P2,P3,P4)

It is possible?
 
ShovelToad said:
:)
Good Day, I have a some question.

It needs to make P1 always use Player1_pal.gif, and P2 always must use Player2_pal.gif

If you only have one playable character, this is the default behavior and you don't need to do anything special. Just set up the four palettes and you are finished.

If there are different characters available, then you must use a script to do it.

Also it needs to make "Wait" animalion is use special unique GIF to each Players (P1,P2,P3,P4)

There is one wait animation per character, so this will always need a script. Before writing instructions, we need to first ask how much do you know about C coding?

It is possible?

Please don't ask that. The answer is always yes. The only question is how to do it.

Welcome to the forum ShovelToad:)
 
My mod have a several playable characters, but gamers may be several.
My C is not good, - "copypastewithtutorial"-like skills ...

I needs to understand how to set specified frame and palette to each gamers in character's "Waiting" animation:

Now I trying to paste script:

Code:
anim waiting
@script
{
    int P2 = getplayerproperty(0, "entity");
    setglobalvar("Show", "X");
    if(P2){
      if(frame==0){
      void self = getlocalvar("self");
      performattack(self, openborconstant("ANI_FOLLOW17"));
    }
    }
}    
@end_script
	 loop       0
	 delay      1
	 offset     83 230


anim FOLLOW17
	 loop       0
	 delay      1
	 offset     83 230
         frame      data/chars/luke/P2luke_pal.gif


I can say what I need in English:

Waiting Animation:

If it is second gamer (listed on this character in select screen), then it play P2Frame in RED palette
If it is third gamer (listed on this character in select screen), then it play P3Frame in GREEN palette
If it is fourth gamer (listed on this character in select screen), then it play P4Frame in PURPLE palette
else it play P4Frame and use usual BLUE palette
 
If you need different WAIT animations based on which player is "waiting"for it (p1,p2,p3,p4), there are two options:

1 - Using script (you can change the animation and the palette at the same time)
2 - Making an offset trick with the characters wait animation.
 
ShovelToad said:
Now I trying to paste script:

Code:
anim waiting
@script
{
    int P2 = getplayerproperty(0, "entity");
    setglobalvar("Show", "X");
    if(P2){
      if(frame==0){
      void self = getlocalvar("self");
      performattack(self, openborconstant("ANI_FOLLOW17"));
    }
    }
}    
@end_script
	 loop       0
	 delay      1
	 offset     83 230


anim FOLLOW17
	 loop       0
	 delay      1
	 offset     83 230
         frame      data/chars/luke/P2luke_pal.gif

And when i try to add @cmd    anichange "ANI_Follow17"

openbor cant start:
"Fatal Error in load_cached_model, file: data/chars/luke/luke.txt, line 719, message: Error parsing function main of animation script in file '%s'!"

And I cant put blank main

Code:
anim waiting
@script
void main()
{
}    
@end_script
	 loop       0
	 delay      1
	 offset     83 230

Have a same error.
 
ShovelToad,

You can't put a main() into a model's text file like that. When you write code into a model text using @script and @end_script tags, you are inserting code into a main() that already exists in the background.

As for your code itself, I'm not sure what's going on. I think it would be better if you post the entire model text instead of part of it. That might help us find your issue.

DC
 
O Ilusionista said:
If you need different WAIT animations based on which player is "waiting"for it (p1,p2,p3,p4), there are two options:

1 - Using script (you can change the animation and the palette at the same time)
2 - Making an offset trick with the characters wait animation.
How can I set different offsets for different players in animation?
How can I set different animations and palettes for different players in animation via script?
Can i use any script in animation codebody in chars/luke.txt?
Maybe it have any command to play specific frame file via script?
 
Damon Caskey said:
ShovelToad,

You can't put a main() into a model's text file like that. When you write code into a model text using @script and @end_script tags, you are inserting code into a main() that already exists in the background.

As for your code itself, I'm not sure what's going on. I think it would be better if you post the entire model text instead of part of it. That might help us find your issue.

DC
Model works fine without "Main", thanks to understend.
I think it will be clearer, if we bring standart model as example:

Code:
anim waiting
	 loop       0
	 delay      1
	 offset     83 230
         frame      data/chars/luke/luke_pal.gif
Thats it, standart animation, its work, but i needs to different specified files by pleyers, something like:

Code:
anim waiting
	 loop       0
	 delay      1
	 offset     83 230
        P1frame      data/chars/luke/1luke_pal.gif
        P2frame      data/chars/luke/2luke_pal.gif
        P3frame      data/chars/luke/3luke_pal.gif
        P4frame      data/chars/luke/3luke_pal.gif

or

Code:
anim waiting
	 loop       0
	 delay      1
	 offset     83 230
        if Player = P1, then 
        frame          data/chars/luke/1luke_pal.gif
        if Player = P2, then 
        frame          data/chars/luke/1luke_pal.gif
        if Player = P3, then 
        frame          data/chars/luke/1luke_pal.gif
        if Player = P4, then 
        frame          data/chars/luke/1luke_pal.gif

But i needs to translate it to script language to use
 
How can I set different offsets for different players in animation?
Take a look at the manual https://dcemulation.org/index.php?title=OpenBORManual#HUD_location
p{#}smenu {x1} {y1} {x2} {y2}

~Determines the position of players in select screen.
~ {#} determines which player this setting is for and its possible values are 1, 2, 3 and 4. There's no space around {#} though.
~{x1} and {y1} determines player's position.
~{x2} and {y2} determines player's "Ready!" position.
~ x and y are the number of pixels, right and down respectively, from the top left corner of the screen to the player's offset (for x1 and y1) or to the top left corner of "Ready!" text.


Each player can have different offset, you you can use an offset trick - you make an image with all 4 players in different positions and change this offset for each player.
Its a very old tricky we use in other engines too (I knew is in Mugen, decades ago) - in a short, you make an image with all players and shift its offeset, like this:

4Qc3zZc.png

Each box should have the screen height. So the first box can have Y =0, second Y +(screen size*2), third Y +(screen size*3), fourth Y +(screen size*4)
Got it?

How can I set different animations and palettes for different players in animation via script?
You force them to change to a different animation and a different palette. I am on a hurry but I am sure someone will post the script here for you.


Can i use any script in animation codebody in chars/luke.txt?
I don't get it.


Maybe it have any command to play specific frame file via script?
I would change it to a whole different animation, like a follow.
 
Back
Top Bottom