About drawmethod

I never used this feature, so im kind lost...

Is there a way to use drawmethod (scale x and y) on a entire char with a single command?

Do in every animation is painful....

Thanks in advance!
 
masterderico said:
I never used this feature, so im kind lost...

Is there a way to use drawmethod (scale x and y) on a entire char with a single command?

Do in every animation is painful....

Thanks in advance!

Yes there is, I've done it with Alpha Ken in "onspawnscript data/scripts/spawn/ken.c" in the header. The script:

Code:
void main()
{
	void self=getlocalvar("self");
	void map=getentityproperty(self,"colourmap");
	if(self)setdrawmethod(self,1,195,255,0,0,0,0,0,0,0,0,0,map); 
	loadmodel("kenf");
	loadmodel("kenf1");
	loadmodel("hadouken");
	loadmodel("hadou");
	loadmodel("hadoua");
	loadmodel("srk");
}

You don't need the load models, I just put that in there for him. You only need:

Code:
void main()
{
	void self=getlocalvar("self");
	void map=getentityproperty(self,"colourmap");
	if(self)setdrawmethod(self,1,195,255,0,0,0,0,0,0,0,0,0,map);
}

Just start your "draw method" scale AFTER "self,1" and you're good.

So it should read if(self)setdrawmethod(self,1,x,y,0,0,0,0,0,0,0,0,0,map);

Of course "X" is how wide (skinny or fat) the character is and "Y" is how tall or short the character is.

This is a "Street Fighter Alpha" to " SNK/CvS" scale example.

Also take note that once you set this script, that's the ONLY draw script the engine will read so if you set it and don't like it, you have to change the X and Y in the script because it won't read anything you have in animation headers.
 
So... if i set scale to 50% with this script and  if you have special attack that sets x scale to 200% then you will go to your normal 100% scale after you use nodrawmethod at the end of this special attack to clear drawmethod effects and return to previous size ? Previous size will be 50 or 100% ?
Every new use of drawmethod will overwrite previous one ?
---
Hmm... from my tests it looks like it works which is great for lazy guys who dont want to convert sprite sizes but looks like it locks drawmethod so if you have tint effects or scale effects using drawmethod in your charater - they are ignored.
Still - its a nice trick, but bboxes and attack boxes will stay in original size.So you may get away with it if youre scaling down with 20% or so, Because it wont make your attack boxes bigger it could lead to some weird situations when you hit someone and you wont connect cause only image was resized and attack boxes werent, unless there will be some script to take care of that.
---
Did some more testing and i can change drawmethod with script but not with command...
 
"drawmethod scale 0.7"  this scales the image with a single command it is a non scripted command just add this to frame data.

Scripts use "scalex" and "scaley" and they have 256 as default size so 128 would be half size and 512 would be double size.

example:
Code:
name	Aura
health	30
type	panel
shadow	0
facing	1
alpha	5
icon	data/chars/0gamefx/empty.png

animationscript data/scripts/scripts.c

anim idle
	loop	1
	delay	8
	offset	51 28
	bbox	0 0 0 0
	drawmethod scale 0.7
	frame	data/chars/0gamefx/items/aura01.png
	frame	data/chars/0gamefx/items/aura02.png
	frame	data/chars/0gamefx/items/aura03.png
	frame	data/chars/0gamefx/items/aura04.png
	frame	data/chars/0gamefx/items/aura05.png
	frame	data/chars/0gamefx/items/aura06.png
 
So... if i set scale to 50% with this script and  if you have special attack that sets x scale to 200% then you will go to your normal 100% scale after you use nodrawmethod at the end of this special attack to clear drawmethod effects and return to previous size ? Previous size will be 50 or 100% ?
Every new use of drawmethod will overwrite previous one ?

The method I presented was for ALL character animations flat, since the was the problem the owner of the post needed help with.

Hmm... from my tests it looks like it works which is great for lazy guys who dont want to convert sprite sizes but looks like it locks drawmethod so if you have tint effects or scale effects using drawmethod in your charater - they are ignored.
Still - its a nice trick, but bboxes and attack boxes will stay in original size.So you may get away with it if youre scaling down with 20% or so, Because it wont make your attack boxes bigger it could lead to some weird situations when you hit someone and you wont connect cause only image was resized and attack boxes werent, unless there will be some script to take care of that.
---
Did some more testing and i can change drawmethod with script but not with command...

This drawmethod script actually adjusts attack boxes and bboxes. And yes, this is a VERY lazy method for those of us that are using copy-written characters from companies like Capcom and SNK and we want to blend them together lol. Also, I did mention early on in the post that this "ondrawscript" is flat on. That means that this is the only one the engine will read NO MATTER what you put in the animation headers.

Just start your "draw method" scale AFTER "self,1" and you're good.

So it should read if(self)setdrawmethod(self,1,x,y,0,0,0,0,0,0,0,0,0,map);

Of course "X" is how wide (skinny or fat) the character is and "Y" is how tall or short the character is.

This is a "Street Fighter Alpha" to " SNK/CvS" scale example.

Also take note that once you set this script, that's the ONLY draw script the engine will read so if you set it and don't like it, you have to change the X and Y in the script because it won't read anything you have in animation headers.

I haven't tested it yet but in the same script, you could try to resize your characters during specific animations and have them revert back to normal in another specified animation. An example could be:

Code:
void main()
{
void self=getlocalvar("self");
	void map=getentityproperty(self,"colourmap");
	if(self)setdrawmethod(self,1,195,255,0,0,0,0,0,0,0,0,0,map);
	//if (getAni()==openborconstant("ANI_FREESPECIAL5") && getAniPos()>4)
	//setdrawmethod(self,1,200,300,0,0,0,0,0,0,0,0,0,map)
        //if (getAni()==openborconstant("ANI_FOLLOW3") && getAniPos()>1)
        //setdrawmethod(self,1,195,255,0,0,0,0,0,0,0,0,0,map);}
}

I haven't tried or tested it but it's just an idea. I don't have a use for this specific script yet but you could toy with it and see what you get. It would be very interesting to see.
 
This script is cool to make your character giant temporarily when you look like final boss to beat by your enemies or tiny small and run like a mouse between enemies legs. ;D
 
bWWd said:
This script is cool to make your character giant temporarily when you look like final boss to beat by your enemies or tiny small and run like a mouse between enemies legs. ;D

That would DEFINITELY be funny to see lol. Especially in a comedy cartoon fighting game
 
Let me correct an information?

This drawmethod script actually adjusts attack boxes and bboxes.
This is not true. The bbox and attackbox are on the same size of before.  Take a look:
spRy2Wr.png

Drawmethod only affects sprites, not anything else.

And yes, this method will overwrite any subsequent drawmethod you use. Funny thing is: onspawnscript is persistent? This is new to me.
 
Back
Top Bottom