• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

Increasing/decreasing the size of characters

Weoooo

Member
Since I'm not in any way a pixel artist, anything I try and make in Openbor is going to be an assemblage of other things. There's not really a way around it aside from learning an entirely new skill from the ground up.
But that has some inherent aesthetic issues. One of the many obvious ones is that sprites come from all over and have different dimensions since the games they were made for all worked differently. This doesn't feel like an unsolvable problem, but the idea of "oh, I'll just resize them" opens up an entirely new can of worms as the sprites then change. Halving them or doubling them isn't that bad, but you wanna change something by like 15%? It's gonna be a wild time.
I understand, intuitively, why things can keep the same shape when I zoom in and out of them or scale them in, like, a document. I also understand, intellectually, why adding or subtracting the amount of pixels in a picture will change it. However, I don't know enough to understand what the actual difference is to the point where I could get why one changes things and the other doesn't. How am I not adding pixels by making it bigger or decreasing them by making it smaller? How come I can't just make something 15% bigger and have it stay the way it looks? It's a mystery that I feel like I should understand except when I just ask the question to myself I realize I don't.
ANYWAY: is there a way to scale characters other than increasing or decreasing the size of their sprites? If there isn't, is there a good way to make them bigger or smaller without changing them, the way that scaling them in a powerpoint does? As a non-artist, it's not easy for me to get things to look right again after they change.
 
Solution
Hi. Sorry I couldn't explain it further yesterday because I was busy doing some very important stuff. So, my time was constraint the time I posted. I think I will continue what I was supposed to explain and/or what I should've explained before I posted.

To create a new C file for your new scripts, just make a new .txt file and rename anything you like. Then, change its file extension from a .txt file to a .c file. For example, if you have mycode.txt, you can change its file mycode.txt to mycode.c.

You know what's better than having just one-line scripts? You make some new script inside a .c file. For instance, let's say you make this one based on what I made an example for you previously. This one is a better, but I don't know if I...
unfortunately, rezising a character in openbor means that you have to re-program hitboxes, the sprites, collisions , etc

in mugen/ikeman there is a way to scale characters in relation to a stage, but i found that some characters for some reason, had problems where projectiles and such would remain their original size. but this paremeter affects all characters on screen.

the reson why i know this is becaseu some characters are "Hight definition", and if you load one of these on a normal resolution stage they look gigantic , but some of them could be modified easily while others could not...

i wish the next openbor engine would feature some kind of rezise parameter where you punch in a number on character .txt files and it automatically rezises everything, but it would probably make the engine more resource hungry or bring weird conflicts
 
I found in the manual the drawmethod scale {scalex} {scaley} commands, but they're for frames. I also found setdrawmethod in scripts, but I don't know how you'd use that cause I don't know nothin' about scripting. Has anyone fooled with those before?

edit: okay I did. For animations you're going to have to change the other data manually to reflect it, but you can totally scale characters up and down no problem. I don't know anything about scripts though. That might be the easier option if you know what you're doing!
 
Last edited:
I have. You only manually use a hardcoded drawmethod to scale in each animation. But if you want to give a whole entity a real scale in all animations without putting them in every single animation, I guarantee you that you'll have no worries about it with the use of setdrawmethod. The one that I put them in bold are the function or command names in OpenBOR.

To further elaborate this trick using setdrawmethod, check how many parameters setdrawmethod has, list the names of those that are part of that function, and outline them with a number of order for each parameter like any standard/non-scripted OpenBOR command. The difference is that setdrawmethod has 13 parameters and is a script, while the old drawmethod has 10 and is a standard/regular/non-scripted command. The latest drawmethod like you have there, is separate. Also, the difference is that the script has a declaration to/for a particular entity (used/declared), unlike the regular non-scripted commands that don't specify its declaration on which entity you go with. Here's how I set this method.

Number how many parameters each function has:
setdrawmethod 1 2 3 4 5 6 7 8 9 10 11 12 13

Specify what parts that are from this particular function.
setdrawmethod(entity, flag, scalex, scaley, flipx, flipy, shiftx, alpha, colourmap, fillcolour, rotate, rotateflip, transparencybg)

As in...
setdrawmethod {entity} {flag} {scalex} {scaley} {flipx} {flipy} {shiftx} {alpha} {colourmap} {fillcolour} {rotate} {rotateflip} {transparencybg}

Outline them in order for your function like this for an easier way to understand:
setdrawmethod 1 2 3 4 5 6 7 8 9 10 11 12 13
1 - entity
2 - flag
3 - scalex
4 - scaley
5 - flipx
6 - flipy
7 - shiftx
8 - alpha
9 - colourmap = color map
10 - fillcolour = fill color
11 - rotate
12 - rotateflip
13 - transparencybg

If you are using .txt files for putting your notes outside of scripts, you use # to give notes in one line like this.
Code:
# This is my note in any .txt file.

If you want to give notes in scripts, you can put a double slash ( // ) in a single line as a comment or put this tag (/* and */) for multiple lines.

Example for commenting in a single line.
Code:
// This is a comment with a double slash at the beginning. Do you get it?

Example with multiple lines with comment(s).
Code:
/*
A: Is this a single comment?
B: No, this is a multi-comment here. Do you see the slashes and stars?
A: I don't understand what you mean by that.
B: Here. You see the slash (/) and star (*) on top of this conversation, right? As well as the ending below.
A: I'm not sure.
B: It's a comment tag. Like tag-team partners. /* means the beginning of tag and */ means the ending of it. You look all the way up and down of this convo.
A: How do you make that kind of comment?
B: Easy. Start typing /* first and then type below that line (or in the same line as a single line comment) with */. Slash-star (/*) goes first, and then star-slash (*/) for end. You put your own comment between these two.
A: Hmm.. I think I'm beginning to understand a bit. So this /* to begin and this */ for make ending of main comment. I can comment between these tag parts here. Cool!
*/

setdrawmethod(entity, int flag, int scalex, int scaley, int flipx, int flipy, int shiftx, int alpha, int colourmap, int fillcolour, int rotate, int rotateflip, int transparencybg)

  • Set drawmethod for an entity or define a global drawmethod for other script functions.
  • entity must be a valid entity handle or an empty value.
  • All other parameters are optional.
  • flag defines whether the drawmethod is active, when set to 0, the drawmethod will not take effect.
  • scalex defines how the sprite will be stretch in x direction: sizex = original_sizex * scalex / 256
  • scaley defines how the sprite will be stretch in y direction: sizey = original_sizey * scaley / 256
  • flipx defines whether the sprite will be flipped left/right. 0 means don't flip and 1 means flip.
  • flipy defines whether the sprite will be flipped top/bottom. 0 means don't flip and 1 means flip.
  • shiftx defines how the sprite leans, like lightx in gfxshadow feature, in most situations you don't need this.
  • alpha defines which alpha blending effect will be used. 0 means no alpha effect. -1 means the entity(if given) will use its own alpha value.
  • colourmap(entity only) defines which colourmap will be used. 0 means no colourmap. -1 means the entity(if given) will use its current colourmap.
  • fillcolour is the colour used by the entire sprite. 0 means don't fill the sprites.
  • rotate is the rotate angle(clockwise), the range is from 0 to 359.
  • rotateflip(entity only) means whether the entity will flip its rotate direction if the facing is changed.
  • transparencybg(screen only) means whether the screen will use transparency colour.
  • Notice: In 8bit mode, fillcolour is the index in palette, otherwise, it will be a RGB value which needs to be calculate first(no system functions available now).
  • Notice: For screen, transparency colour is the first colour in palette(8bit) or pure black colour(which is also 0).
  • Notice: If the entity parameter is an empty value, it will change the global drawmethod, and can be used by other script functions like drawsprite or drawscreen.

This is the original form without the use of setdrawmethod.
My Mod - 0867.png

This one is scaled bigger with scalex 321 and scaley 321.
Example:
Code:
setdrawmethod(getlocalvar("self"), 1, 321, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0);
My Mod - 0868.png

This one is scaled with scalex 181 and scaley 265.
Example:
Code:
setdrawmethod(getlocalvar("self"), 1, 181, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0);
My Mod - 0869.png

In case you're wondering how I put those kinds of values and know where to put them, for the entity part (first parameter of setdrawmethod), I declared it as getlocalvar("self") since it's only in one line. That's because the engine does not know what kind of entity you are declaring unless you specify which function. getlocalvar("self") means a local entity you're gonna use. For example, I declared Necro with a one-line script and you let the engine know what you mean.

This one is without declaring a C file for the character. Script that is declared in the character header, is an entity script. Declare an ending of a function with a semicolon (;) you see here. The one that is like @script and @end_script is called a script tag. The one with a value of 1 under setdrawmethod you see below is a flag. Flag activates its drawmethod set ready for its change. This is a shortcut without declaring a C file.
Code:
script @script
void main()
{
    setdrawmethod(getlocalvar("self"), 1, 321, 289, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    //setdrawmethod(entity, flag, scalex, scaley, flipx, flipy, shiftx, alpha, colourmap, fillcolour, rotate, rotateflip, transparencybg);
}
@end_script

IMO, this shortcut is good for practice as a newb, but NOT for a professional level because there will be tons of scripts to use if you knew how to do scripts.

Note that void main() is used for non-animation scripts. Since the entity script (script) is not an animation script, you should declare void main. void main should have its tags () (parentheses) and {} (curly brackets) for declaring any stuff. I will explain more details about animation scripts and non-animation scripts later.
 
Last edited:
Thanks! So you'd make a script for each character? That might not be that bad, since it's just one line. Does it update things like offsets and body boxes, too? Cause that's the thing that'd really take up a lot of time, figuring out where those were supposed to actually be. Probably not, since it's just changing the way it's drawn, but I donno.

Also, could you use the simplified commands that drawmethod has? It's easier for me to figure out what the percentages are when it's based on 1 rather than 256.
 
So you'd make a script for each character?
It depends on how specific you want your character(s) to be like. It doesn't have to be each character per script, but if you want to make each character unique, then you can.

Also, could you use the simplified commands that drawmethod has? It's easier for me to figure out what the percentages are when it's based on 1 rather than 256.
I forgot about the total value number's reach is 256 for the scaling, but I have an example of using drawmethod scale. I use decimals for percentage since its total value is 256 and that would become 1. Scale 0.5 equals to 128 since it's the half of its total scale size. You can use your calculator to multiply that 256 with a percentage or divide that 256 by a number ranging from 1-256. For instance, 128 divided by 256 is 0.5, so it's 50%. Even 100% becomes 1 and 62% becomes 0.62. Use decimals. Notice I'm not using setdrawmethod which is from script, as well as the sprite is scaled/resized.

Code:
anim idle # Round 1
delay 90
offset 192 64
sound    data/sounds/round.wav
drawmethod scale 0.62 0.62
frame data/chars/misc/rounds/round_1.png
delay 150
sound    data/sounds/one.wav
frame data/chars/misc/rounds/round_1.png
delay 52
#frame data/chars/misc/empty.gif
@cmd changeentityproperty getlocalvar("self") "shadowbase" 0
frame none
delay 110
sound    data/sounds/fight.wav
frame data/chars/misc/rounds/fight.png
    delay    3
    offset    1 1
    @cmd    EnemyStart
    @cmd    suicide
    @cmd    DeControl 0 0
    @cmd    DeControl 1 0
    @cmd    setindexedvar "fightStarted" 1
frame data/chars/misc/rounds/fight.png

My Mod - 0870.png

I'll come back to explain more later.
 
Last edited:
So you can define what characters the script applies to? That's super useful, especially for some shortcuts I've been using for enemy variety. I also suppose it's not that hard to figure it out, especially since I'd only be doing it a few times.

So if I was using drawmethod in the animation and wanted to increase the sprite size by 15%, I'd put drawmethod scale 1.15 at the beginning of every animation. But, if I was making a script, I'd use setdrawmethod(getlocalvar("self"), 1, 294, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0). I'd have to figure out scripting as, like, a whole, cause I don't even really know how to target those things, but that'd be the command.

For things like offets, bboxes and aboxes, I know those have to be updated when you mess with the scaling with drawmethod. Or, at least, I think you have to since scaling things in large amounts makes them behave strangely. Would you have to update the animation data for those anyway if you're using a script to resize things? If that's the case, I don't know if scripting it is the best way to scale a character, because if you're gonna be foolin' with animation data anyway, what's one line? It seems more for cinematic effects or for special attacks then.
 
Hi. Sorry I couldn't explain it further yesterday because I was busy doing some very important stuff. So, my time was constraint the time I posted. I think I will continue what I was supposed to explain and/or what I should've explained before I posted.

To create a new C file for your new scripts, just make a new .txt file and rename anything you like. Then, change its file extension from a .txt file to a .c file. For example, if you have mycode.txt, you can change its file mycode.txt to mycode.c.

You know what's better than having just one-line scripts? You make some new script inside a .c file. For instance, let's say you make this one based on what I made an example for you previously. This one is a better, but I don't know if I could call it a shortcut or not.

mycode.c:
Code:
void main()
{
    void self = getlocalvar("self");
    setdrawmethod(self, 1, 321, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}

Notice that you have the variable self inside the setdrawmethod command instead of just getlocalvar("self"). Do you see void self and an equal sign there? That variable (void self) declares what kind of function is to become.

Instead of this one:
Code:
setdrawmethod(getlocalvar("self"), 1, 321, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0);

You have this:
Code:
setdrawmethod(self, 1, 321, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0);

Therefore, in your character header, you can declare that file in the entity script event like any command like this (instead of the script tag I previously made).

Code:
script     data/scripts/mycode.c

That way, you don't need to add script tag for the entity script event anymore.

So if I was using drawmethod in the animation and wanted to increase the sprite size by 15%, I'd put drawmethod scale 1.15 at the beginning of every animation. But, if I was making a script, I'd use setdrawmethod(getlocalvar("self"), 1, 294, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0). I'd have to figure out scripting as, like, a whole, cause I don't even really know how to target those things, but that'd be the command.
I think you got it right according to the calculation. The purpose for me to put the setdrawmethod command in a single line under the declared script in the character header, is that the character I have, has many animations. So, that means I don't have to put all drawmethod scale command in each and every animation. The reason I put the drawmethod command (non-script) is that the entity has a very few animations. To me, in my opinion, it's about how many animations I have for a character.

For things like offets, bboxes and aboxes, I know those have to be updated when you mess with the scaling with drawmethod. Or, at least, I think you have to since scaling things in large amounts makes them behave strangely. Would you have to update the animation data for those anyway if you're using a script to resize things? If that's the case, I don't know if scripting it is the best way to scale a character, because if you're gonna be foolin' with animation data anyway, what's one line? It seems more for cinematic effects or for special attacks then.
Like drawmethod, yeah, same result with setdrawmethod. You're gonna make some changes with bboxes and attackboxes. For offsets, it wouldn't be a problem unless your character sprites are all cropped, which you'll have to adjust its position of offset in every frame of the animations. You can use either setdrawmethod (script command) or drawmethod (standard command). Let either of them suit your taste.

Though we have a comparison with sprite resize, bbox remains the same. You can either choose options mode in title menu screen. Or you pause and press the F12 key or screenshot button to go to the Options menu like the title menu screen.

Go to: Options Mode > Systems Options > Debug Settings

There, you enable the body boxes and/or attack boxes for the resize result. It's hard to know how much size the character is gonna be like.

sprite scaling with bbox.png

Notice there's a red box for measuring the height in pixels between the two.
 
Solution
Hi. Sorry I couldn't explain it further yesterday because I was busy doing some very important stuff. So, my time was constraint the time I posted. I think I will continue what I was supposed to explain and/or what I should've explained before I posted.

You don't have to apologize, I appreciate any time you've given me. You've explained a whole lot, to the point where I think my question is answered. The only thing left for me is to figure out why when I scaled a very large thing down it disappeared until I changed offsets, because I haven't seen that happen with anything else I've tried.
This info has actually opened up a whole bunch of avenues that I actually thought were closed tight, so thank you very much for it.
 
Great questions,

To further elaborate this trick using setdrawmethod, check how many parameters setdrawmethod has, list the names of those that are part of that function, and outline them with a number of order for each parameter like any standard/non-scripted OpenBOR command. The difference is that setdrawmethod has 13 parameters and is a script, while the old drawmethod has 10 and is a standard/regular/non-scripted command. The latest drawmethod like you have there, is separate. Also, the difference is that the script has a declaration to/for a particular entity (used/declared), unlike the regular non-scripted commands that don't specify its declaration on which entity you go with. Here's how I set this method.

great answers, thank you both!
 
hey i started using this setdrawmethod and its cool, but one problem is that it completely disables things like drawmethod tint and stuff. any way to overcome this?
 
any way to overcome this?
@Aerisetta In this case I suggest applying the drawmethod command individually, this way avoiding the other effects already applied.
For example, if you already have tint applied and want to apply alpha, you can code like this.

Code:
changedrawmethod(self,"enabled", 1);
changedrawmethod(self,"alpha", alpha);

You can even put NULL() in some setdrawmethod parameters but some of them are mandatory in order for the command to work properly, otherwise can cause crashes.
 
Back
Top Bottom