You are here

banana-sprites

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

LINK (version 1.1): http://froggy.web.pagesperso-orange.fr/gimp/banana-sprites.scm

Hello world,
EDIT: VERSION 1.1
I uploaded other examples and added some tips at the end. This script-fu will be here in the menu: Filters\Animation\banana-sprites

I hope that you will better understand the use of the script. ;)
It is quite difficult to use, I did not think at the start to share it.

Sorry, I sometimes corrects this topic, because I see errors due to bad copy / paste or due to careless mistakes . I say "3" frames instead of "4" frames, Left instead of Right. This script is already complicated enough as it is ! -_-'

_________________________________________

BANANA SPRITES: 'BANniere ANimee Affichant des SPRITES' (animated banner displaying sprites).

IMPORTANT OPTIONS ARE 'Charset', 'Max. number of frames per anim.','Max. number of animations' and 'Sel.of anim.& Move.of the tile'.

Explanation of 'Selection of animation & Movement of the tile' option:
'R' = Right. The character goes to the right. The background moves.
'U' = Up. The character goes up. The background moves.
'L' = Left. The character goes to the left. The background moves.
'D' = Down. The character goes down. The background moves.
' '(space) = Skip the animation.
'A' (or what you like) = a classic animation, e.g. an attack. The background does not move.

e.g. with 4 animations, 'RULD' (R 1st anim, U 2nd anim, L 3rd anim ...) but you can have a different order depending on your charset. 'DLRU' is suited to rmxp charset.

Explanation on this option 'If 3 frames, duplicate the 2nd frame'
Admit that this represents the legs of the character for one animation.
/| || |\
1 2 3
So there are 3 frames for this animation in the charset.
If you untick the option, you will get this result:
/| || |\ /| || |\ /| || |\ ...
1 2 3 1 2 3 1 2 3 ...
As you can see, it's strange when the character walks ('|\ /|').
If you tick the option, you will get this result:
/| || |\ || /| || |\ || /| || |\ ||...
1 2 3 2 1 2 3 2 1 2 3 2 ...

The other options do not require explanation . They seem easy to understand. But feel free to ask questions.
Be careful to specify the number of images and animations that fit YOUR charset.
Tile used for the background is not mandatory , but in this case there is no inner border.
'Offset of pixels (y-axis)' may cut the sprites.

version 1.0 2015.01.11
1st version put online
version 1.1 2015.01.18
Oops! The order of the frames was reversed. This worked with a walking animation, but it was ugly , for example, for an animation of attack.
I also renamed 'If 3 frames, duplicate one' option. Now it's 'If 3 frames, duplicate the 2nd frame', because it's always the second frame.
I added an explanation on this option.
The charset has its own grid in 'DEBUG' mode.

_________________________________________
PS: I wish I could upload the file directly to the http://registry.gimp.org site, but it does not work . I have the same messages as many of you:
"The file banana-sprites.scm could not be saved. An unknown error has occurred."
"The file in the File attachments field was unable to be uploaded."
I put a link until it works again.

_________________________________________
Example 1:
- Banana-sprites (bs) made from a charset and a tile:

(Zoom 400%)

- I drew this nice monster to give an example of charset (If using, please credit!)

So it will be 'DLRU' (Down Left Right Up)

- Tile:

- Important options for this first banana-sprites:
Max. number of frames per anim.: 3
If 3 frames, duplicate the 2nd frame: [x] (So tick this option)
Max. number of animations: 4
Sel.of anim.& Move.of the tile: DLRU

_________________________________________
Example 2:
- Banana-sprites (bs) made from the same charset and tile.
But the zoom is different; the border is different; it's a vertical banner; I added an offset of 4 pixels that explains why the sprite is slightly more at the top.
But the difference in what I called the important options is that I skipped 2 animations (left and right), that 's why there are only down and up animations.

(Zoom 300%)

- Important options for this second banana-sprites:
Max. number of frames per anim.: 3
'If 3 frames, duplicate the 2nd frame: [x] (So tick this option)
Max. number of animations: 4 (Even if you only want 2 animations, leave 4 because the charset has 4 animations)
Sel.of anim.& Move.of the tile: D U (Down space space Up)

_________________________________________
Example 3:
- Another charset but for the attack animations (If using, please credit!)

- A tile of 16px for this example

- BS made from this new charset and tile.

(Zoom 300%)

- Important options for this third banana-sprites:
Max. number of frames per anim.: 4 (and not 3)
'If 3 frames, duplicate the 2nd frame: [x] or [ ] (This option will not be taken into account, because there are four frames)
Max. number of animations: 4 (In my example, I just want 3 animations (D R and U), but leave 4 because the charset has 4 animations)
Sel.of anim.& Move.of the tile: A AA (Attack space Attack Attack)

_________________________________________
Example 4:
- Just to compare with the walking animation you know now.

(Zoom 300%)

- Important options for this fourth banana-sprites:
Max. number of frames per anim.: 3 (and not 4)
If 3 frames, duplicate the 2nd frame [x]
Max. number of animations: 4
Sel.of anim.& Move.of the tile: D RU (Down space Right Up)

_________________________________________
To go further...

Sorry I updated

---(^_^)---
- Where is this in the menu? It is in Filters => Animation => banana-sprites

---(^_^)---
- Explanation on the size of the BS
In example 3 and 4, I selected "Width of the tile * x: 1 " and "Height of the tile * y: 3 "

Width of the tile * x: 1 In my example, the tile is 16 pixels wide. It should be 16px * 1 = 16pixels, but the sprite is 24 pixels wide. The sprite would be cut. To correct that, it 's automatically replaced by 32 pixels (16px * 2)

Height of the tile * y: 3 The tile is 16 pixels high. The sprite is 24 pixels high. So, 16px * 3 = 48 pixels will work.
Each background for one animated sprite is 32 pixels wide and 48 pixels high.

I want 3 animations for these examples: 'AA A' or 'D RU'. 32 pixels * 3 = 96 pixels wide.
It's an horizontal banner. Then the height of the banner also measures 48 pixels .
So the BS should be 96 pixels wide and 48 pixels high if only I chose a 100% zoom.
But remember , I chose a 300 % zoom .
(96 * 3) = 288 pixels wide
(48 * 3) = 144 pixels high.

---(^_^)---
- A tile of 32px for your tests:

---(^_^)---
- Regarding the "Sel.of anim.& Move.of the tile" option , you can write nothing if you want all animations. But the tiles of the backgound will not move.
For example, if "Max. number of animations" = 8 , you want all animations; instead of writing "AAAAAAAA", this can be boring, you can put nothing.

---(^_^)---
- Always regarding the "Sel.of anim.& Move.of the tile" option , if you add DEBUG at the end, you will get the DEBUG mode. You must write DEBUG in capital letters .
It means that the image of the charset, the image of the tile will not be deleted at the end of the script. It also means that the undo history is available for the banana-sprites and the charset. (play with 'ctrl + z' and 'ctrl + y' to see the different steps of modifications)
e.g.
DL UDEBUG
AAAADEBUG
DEBUG
AA A AADEBUG

If you don't write completely DEBUG in capital letters (ex: "debug" or "Debug" "DeBuG" ...), you will have only the undo history for the banana-sprites. The charset will be deleted (of course, not your file, just the charset loaded temporarly in Gimp)

---(^_^)---
- Adapt the script to your needs. Change the script-fu-register at the end and define the default value for some options.
Read this before changing anything: http://docs.gimp.org/2.8/en/gimp-using-script-fu-tutorial-first-script.html
(3.4.7. Registering The Script's Parameters + 3.4.8. The Script-Fu parameter API[8] )

I put in bold the options that can be changed without too much risk. TRUE can be replaced by FALSE and vice versa.
Remember that the first value is the default value. For SF-COLOR, if you want the default color is white , there must be '(255 255 255)

SF-FILENAME "Charset" "???"
SF-ADJUSTMENT "Max. number of frames per anim." '(4 2 16 1 1 0 SF-SLIDER)
SF-TOGGLE "If 3 frames, duplicate the 2nd frame" TRUE
SF-TOGGLE "Clear the BG color (charset)" FALSE
SF-ADJUSTMENT "Max. number of animations" '(4 1 16 1 1 0 SF-SLIDER)
SF-FILENAME "Tile of the background" "???"
SF-ADJUSTMENT "Width of the tile * x" '(1 1 10 1 1 0 SF-SLIDER)
SF-ADJUSTMENT "Height of the tile * y" '(1 1 10 1 1 0 SF-SLIDER)
SF-STRING "Sel.of anim.& Move.of the tile" "RULD"
SF-OPTION "BANANA-SPRITES" '("Horizontal" "Vertical")
SF-ADJUSTMENT "Offset of pixels (y-axis)" '(0 -10 10 1 1 0 SF-SLIDER)
SF-DIRNAME "Directory" "???"
SF-STRING "Save as (filename without .gif)" ""
SF-ADJUSTMENT "Delay between frames" '(200 50 400 10 50 0 SF-SLIDER)
SF-OPTION "Zoom" '("100%" "200%" "300%" "400%")
SF-OPTION "Inner border (requires a tile)" '("Rounded corners" "Normal" "None")
SF-COLOR "Border color" '(0 0 0)

Scripting Engine: 
GIMP Version: 
Subscribe to Comments for "banana-sprites"