Solved drawmethod tintmode & Tintcolor

Question that is answered or resolved.
Hello to all
I apologize for my absence
Sorry, I need help with Tintcolor and Tintmode
I use these commands in the game to change the tint and they work fine.
drawmethod tintmode 1
drawmethod tintcolor 0_70_0

but now I need to use this in the script.
These two commands are mentioned in the openbor manual
changedrawmethod(entity, propertyname, value);
  • tintcolor, // Will tint the sprite with given tintcolor, in alpha mode tintmode
  • tintmode, // Defines the tintmode
But I always get an error when I use them like this
void P1 = getplayerproperty(0,"entity");
changedrawmethod( p1, tintmode, 1);
changedrawmethod( p1, "tintcolor", 0x004600);

Does anyone know how I can use them?

Thank you all for your support
 
Solution
Try this:
C:
        void P1 = getplayerproperty(0,"entity");
        changedrawmethod(P1, "tintmode", 1);
        changedrawmethod(P1, "tintcolor", rgbcolor(0, 46, 0));
Hello and thank you for your reply
It doesn't give any arror , but it also doesn't do anything:(
Let me explain what is my purpose of using tintcolor .
I want the player's character to be scanned by the computer at the beginning of the game, and at the moment the player is recognized by the computer, the player's color will change to green for small amount of time and then player's color returns to its previous state.
do you have any suggestion for me to change put player 1 color to green in small amount of time
Try this:
C:
        void P1 = getplayerproperty(0,"entity");
        changedrawmethod(P1, "tintmode", 1);
        changedrawmethod(P1, "tintcolor", rgbcolor(0, 46, 0));
Hello and thank you for your reply
It doesn't give any arror , but it also doesn't do anything:(
Let me explain what is my purpose of using tintcolor .
I want the player's character to be scanned by the computer at the beginning of the game, and at the moment the player is recognized by the computer, the player's color will change to green for small amount of time and then player's color returns to its previous state.
do you have any suggestion for me to change put player 1 color to green in small amount of time
 
Last edited:
Solution
Yeah, I was aware of that issue but decided to let you try it to confirm the issue.
You need to allow drawmethod script first before those quoted scripts work. To do that, you can declare this script in SPAWN animation:
Code:
anim    spawn
@script
  if(frame==1){
    void self = getlocalvar("self");

    changedrawmethod(self, "reset", 1);
  }
@end_script
 
Yeah, I was aware of that issue but decided to let you try it to confirm the issue.
You need to allow drawmethod script first before those quoted scripts work. To do that, you can declare this script in SPAWN animation:
Code:
anim    spawn
@script
  if(frame==1){
    void self = getlocalvar("self");

    changedrawmethod(self, "reset", 1);
  }
@end_script
Hello, thank you for your help, I did this and it worked perfectly, but from the moment I used reset for drawmethod, all the previous drawmethods that I used stopped working.
i used this
changedrawmethod(self, "reset", 0);
but it didnt return it to its previous form

how i can change it to its default form after using it
 
Did you try something like this?
C:
anim    spawn
@script
  if(frame==1){
    void self = getlocalvar("self");

    changedrawmethod(self, "reset", 1);
  }
  if(frame == 5){
    changedrawmethod(self, "reset", 0);
  }
@end_script

Or this...

Code:
anim spawn
offset 4 10
delay 4
frame ... # 0
@cmd reset 1
frame ... # 1
frame ... # 2
frame ... # 3
frame ... # 4
@cmd reset 0
frame ... # 5

C:
void reset(int bi){
    void self = getlocalvar("self");
    changedrawmethod(self, "reset", bi);
}

I don't know if it works. I haven't tested it.
 
how i can change it to its default form after using it

Hmmm... let me ask this: are you using tint script in just one animation or multiple animations?
If it's the former, you could do like maxman suggested but instead of declaring in SPAWN animation, declare script to reset drawmethod in respective animation.
 
Hmmm... let me ask this: are you using tint script in just one animation or multiple animations?
If it's the former, you could do like maxman suggested but instead of declaring in SPAWN animation, declare script to reset drawmethod in respective animation.
i created a scan that target players and for its animation it turn players tint color to green in this operation player has full control and he could be in any animations

void self = getlocalvar("self");
void P1 = getplayerproperty(0,"entity");
if ( frame == 15 )
{
changedrawmethod(P1, "reset", 1);
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 70, 0));
}
else if ( frame == 16 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 106, 0));
}
else if ( frame == 17 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 144, 0));
}
else if ( frame == 18 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 204, 0));
}
else if ( frame == 19 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 63, 255, 63));
}
else if ( frame == 20 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 160, 255, 160));
}
else if ( frame == 22 )
{
changedrawmethod(P1, "tintmode", 0);
changedrawmethod(P1, "reset", 0);
}
these are my codes . they are perfectly working
but all of man drawmethods get disabled in player after these codes
for example i filliped some of players frames by this code
drawmethod 256 256 1 0
and now they are not working
 
Just a guess but i think you need to add:
changedrawmethod(P1, "reset", 1); each time you change drawmethod or was there a variable to enable drawmethod.

Anyway you will find practical exaples of drawmethod by script in my shadow trails demo.

 
i created a scan that target players and for its animation it turn players tint color to green in this operation player has full control and he could be in any animations

void self = getlocalvar("self");
void P1 = getplayerproperty(0,"entity");
if ( frame == 15 )
{
changedrawmethod(P1, "reset", 1);
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 70, 0));
}
else if ( frame == 16 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 106, 0));
}
else if ( frame == 17 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 144, 0));
}
else if ( frame == 18 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 0, 204, 0));
}
else if ( frame == 19 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 63, 255, 63));
}
else if ( frame == 20 )
{
changedrawmethod(P1, "tintmode", 1);
changedrawmethod(P1, "tintcolor", rgbcolor( 160, 255, 160));
}
else if ( frame == 22 )
{
changedrawmethod(P1, "tintmode", 0);
changedrawmethod(P1, "reset", 0);
}
these are my codes . they are perfectly working
but all of man drawmethods get disabled in player after these codes
for example i filliped some of players frames by this code
drawmethod 256 256 1 0
and now they are not working
@pedramtolo

The "reset" makes exactly what it says and will change all character's drawmethod to default values. In case you need to disable certain effects and maintain others (like disabling tint and keeping scale), you need to change only the desired effect instead of using reset, same as you did in the changedrawmethod(P1, "tintmode", 0).

In addition, I suggest using the changedrawmethod(P1, "enabled", 1) instead of the reset in case you only need to turn on/off the effects without resetting everything to default.
 
Back
Top Bottom