Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - froggy77

#1
I'm planning on making a pretty dark, gothic, Halloween inspired tileset.
It's not for my project, so it won't be in 4 colors. It's just to improve my pixel art and put this style of game boy that I love on hold. It will last just 1 or 2 months. This tileset should look like Alttp or Mc or whatever in order to fit into most projects.


Thank you for voting many. Please do not vote twice: It's on the forum OR on Discord (#resource-packs).


Style =  Other. Please specify the game as an example. You can speak on Discord.
#2
Hello,

Here is in the attached file a python script to add in GIMP. It is supposed to be useful for pixel artists but also for those who rip game maps.

This one is not a Script-Fu, but a Python-Fu. My first script in Python... :)  This is a beta version, I hope there will be not too many bugs. Please save your work before. Don't hesitate to report bugs.

See attachment file.

What is this kind of script?
It is explained here: https://docs.gimp.org/en/gimp-filters-python-fu.html


Where to copy it?
Unzip the folder before to copy it the right place.There are often two directories. You can find their path in:
"Edit" > "Preferences" > "Folders" > "Plug-Ins"


Some explanations
- It appears in the menu /Filters/pixelart-tileset-extractor of GIMP
- It extracts tiles from a tilemap to build quicker a tileset. This excludes tiles from the existing tileset, if any.

Example:
1 min 20 to extract the tiles from this image of 2560x2048 pixels (this represents 20480 tiles of 16px). Here, there is no existing tileset (so it is the layer's name that appears). If there was a tileset, I should have selected it (in "Tileset:")  and tiles already known would have been excluded from the created tileset ("New tileset").


#3
Development / Question on "open" animation of doors
February 02, 2019, 12:51:43 AM
Hello all,

I read in  "Solarus documentation" that for door entities,
Quote"The sprite of a door must define animations "open" and "closed". Animations "opening" and "closing" are option" ...
But I don't find out examples of "open" animations. There are only "closed", "opening" and "closing" animations in different projects I checked.

I'm trying to add one with only one frame, but the frame disappears after the "opening" animation even if I loop it. In fact, this is not exactly a door but a portcullis;  I would like the lower part to be visible when it is open.
I know that I could place a tile (from the tileset) under the "door" entity.  This unnecessarily increases the number of tiles in the tileset.

So why do that when the documentation says that an "open" animation is possible even if I don't know how for the moment?  ;)
#4
Hello,

I created another script to be used with GIMP that it is supposed to be useful for pixel artists.
The aim is to rescale a charset.

I made a lot of tests but only on Gimp v 2.10.6, so I hope there will be not too many bugs. Please save your work before.
Don't hesitate to report bugs.

See attachment file or this link

What is this kind of script?
It is explained here: https://docs.gimp.org/en/gimp-concepts-script-fu.html
(There is often a translation of docs.gimp.org pages, just replace "en" by "fr" to get for example the french page: https://docs.gimp.org/fr/gimp-concepts-script-fu.html , it italian, es spanish, de ...)

Where to copy it?
It is explained here:  https://docs.gimp.org/en/install-script-fu.html

Some explanations

       
  • First, configure your image grid according to current tiles.
  • Then, start the script. It appears in the menu /Filters/pixelart-rescale-charset of GIMP
  • Next, set the new values.
  • Finally, press OK and pray it works!


#5
Hello,

I created another script to be used with GIMP that it is supposed to be useful for pixel artists.
The aim is to change RGB colors of an image or a selection. I got the idea of ​​this script thanks to this topic "Convert US colour to PAL"

This is a beta version, I hope there will be not too many bugs. Please save your work before. ::)
Don't hesitate to report bugs.

See attachment file

What is this kind of script?
It is explained here: https://docs.gimp.org/en/gimp-concepts-script-fu.html
(There is often a translation of docs.gimp.org pages, just replace "en" by "fr" to get for example the french page: https://docs.gimp.org/fr/gimp-concepts-script-fu.html , it italian, es spanish, de ...)

Where to copy it?
It is explained here:  https://docs.gimp.org/en/install-script-fu.html

Some explanations

- It appears in the menu /Filters/pixelart-change-rgb of GIMP
- It opens a pop-up window where you can change Red, Green and Blue values.
By default, I add 32 to all colors, but you can change these values editing the script.
SF-ADJUSTMENT    "Red"       '(32 -255 255 1 10 0 SF-SLIDER)
SF-ADJUSTMENT    "Green"   '(32 -255 255 1 10 0 SF-SLIDER)
SF-ADJUSTMENT    "Blue"      '(32 -255 255 1 10 0 SF-SLIDER)
- It allows to add or subtract a value to Red Green Blue (RGB) of the selection or the image and draw the result into another image.
- Maximum of 256 colors in your image or in your selection.
- If there is a selection, only the selected layer and its selection are taken into account.
- If there is no selection, all layers are taken into account.
#6
Hello,

I created a script to be used with GIMP that it is supposed to be useful for pixel artists.
The aim is to get the colors palette of an image and to help to detect the similar colors that could be replaced.

This is a beta version, I hope there will be not too many bugs. Please save your work before. ::)
Don't hesitate to report bugs.

See attachment file


What is this kind of script?
It is explained here: https://docs.gimp.org/en/gimp-concepts-script-fu.html
(There is often a translation of docs.gimp.org pages, just replace "en" by "fr" to get for example the french page: https://docs.gimp.org/fr/gimp-concepts-script-fu.html , it italian, es spanish, de ...)

Where to copy it?
It is explained here:  https://docs.gimp.org/en/install-script-fu.html

Some explanations

- It appears in the menu /Filters/pixelart-get-palette of GIMP
- It opens a pop-up window where you can change the width and the height of the "tile" which represents one color.
By default, I put width = 16 pixels and height = 10 pixels, but you can change these values editing the script.
SF-ADJUSTMENT    "Width"        '(16 1 50 1 10 0 SF-SLIDER)
SF-ADJUSTMENT    "Height"        '(10 1 50 1 10 0 SF-SLIDER)
- It allows to get palette of the selection or the image and draw it into another image.
- There is a maximum of 256 colors in your image or in your selection, otherwise the script will not work.
- If there is a selection, only the selected layer and its selection are taken into account.
- If there is no selection, all layers are taken into account.
- For the moment, the script does not sort colors. Maybe in the future.


Several years ago, I posted some scripts on http://registry.gimp.org/ but the site is still in maintenance. So, why not to share it to Solarus community which is one of my favorite forum and where I noticed several gimp users and pixel artists... ;)
#7
Hello,

I would like to add an intermediate animation for chests. "closed" and "open" are the basic animations. I added, in the .dat files, an "opening" animation which it could be in 1 or 2 frames according the size of the chests.

How woud you proceed in lua scripts?


Sorry, I have lost a lot of skills in lua and even about Solarus in general, because I have not worked on it for several months.
Moreover, there are now in the last versions, scripts "features" and "multi_events" which is all the more new and difficult for me.
But instead, I improved my pixel art skills a bit  ;) . I will soon update my topic on the project.
#8
Hello,

I would like to get a list of all .dat files in ./data/maps/

e.g.:
./data/maps/cave_1f.dat ./data/maps/cave_2f.dat
./data/maps/inside_store.dat
./data/maps/library.dat
./data/maps/lost_woods.dat
./data/maps/outside_store.dat
./data/maps/outside_west.dat
./data/maps/shop.dat
./data/maps/test_map.dat
./data/maps/water_temple_1f.dat
./data/maps/water_temple_2f.dat
./data/maps/water_temple_final_room.dat
I found out a solution but it's quite complicated.
How would you do?
#9
Hello,

Is it possible to get the opposite region of several regions in a surface?
In this example, there are several yellow rectangles and I would like to get the black part.

#10
Development / HUD: ZL - level (LVL) & experience (XP)
January 28, 2016, 06:54:26 PM
HUD - ZL - level (LVL) & experience (XP)



I try to create a game system with points of experience and levels for my Zelda-like project.
Starlock sent me an email: "I was also planning on making an xp system and was hoping I could see your code and fiddle around with it :P"
So I share my work if this could be useful for others...

____________________

SCRIPT

Here is the main script for the HUD. See in attachment.
Put this script in '../data/scripts/hud/lvl_and_xp.lua'

In this script there is a table:
self.t_xp_to_levelup = {100, 200, 300, 400, 500, 600, 700, 800}

You are level 1 and you need 100 xp  to level up.
You are level 2 and you need 200 xp  to level up.
You are level 3 and you need 300 xp  to level up.
...
You are level 8 and you need 800 xp  to level up.
Then level 9 appears and xp counters are blocked (800/800). They appears in green because I used 'small_green_digits' font that I think you have got.
Put  your own values. Obviously, it will not be 100, 200, 300 etc.. ;)
You are not limited to 8 values.

____________________

IMPORTANT

You will have to add some lines in certain lua files. See below.
I hope I don't forget something.  ;D

____________________

IMAGE

Copy this image. See in attachment.

../data/sprites/hud/lvl_and_xp_icon.png

_________________

POSITION IN THE HUD

In '../data/scripts/hud.lua' , you need declare the position of lvl and xp elements.
(-104, 16) is an example.


  ---- Create each element of the HUD.
  -- blablabla

  local lvl_and_xp_builder = require("scripts/hud/lvl_and_xp")

-- blablabla

  menu = lvl_and_xp_builder:new(game)
  menu:set_dst_position(-104, 16)
  hud.elements[#hud.elements + 1] = menu


-- blablabla

____________________

SAVEGAME FILE

In "../data/scripts/game_manager.lua", and more precisely in the "function game_manager:create(file)", we have to declare two values for a new savegame file. Also add 'current_level = 0'  and 'current_xp = 0' in your existing savegame files.

--  if not exists then
    ---- This is a new savegame file.
   -- blablabla

game:set_value("current_level", 0)
game:set_value("current_xp", 0)

--  end
-- blablabla

____________________

FUNCTIONS TO ADD, SET or GET XP and LEVEL

In '../data/scripts/quest_manager.lua', because I think it is practical to add or set or  get xp and level of our hero, I added some functions.
All these functions are not necessaries, but they are very useful in debug console to test.
hero:set_level(3) is equal to game:set_value("current_level", 3)
hero:add_level(1) so  'current_level = 4' in your 'saveX.dat' if you save the game.
hero:get_level() is equal to game:get_value("current_level")
hero:set_xp(100)    is equal to  game:set_value("current_xp", 100)
hero:add_xp(10)   so  'current_xp = 110' in your 'saveX.dat' if you save the game. hero:add_xp(number) is the most useful for enemies.
hero:get_xp()  is equal to  game:get_value("current_xp")


Code (lua) Select

-- Initializes some behavior of our hero.
local function initialize_hero()

  local hero_meta = sol.main.get_metatable("hero")
 
  -- ZL --  Functions for levels of our hero
  function hero_meta:set_level(lvl)

    if type(lvl) == "number" then
local game = self:get_game()
game:set_value("current_level", lvl)
else
        print("Error in hero:set_level(lvl), lvl should be a number.")
    end
  end
  function hero_meta:add_level(lvl)

    if type(lvl) == "number" then
local game = self:get_game()
local current_level = game:get_value("current_level")
game:set_value("current_level", current_level + lvl)
else
        print("Error in hero:add_level(lvl), lvl should be a number.")
end
  end
  function hero_meta:get_level()

local game = self:get_game()
local current_level = game:get_value("current_level")
return current_level
  end
  -- ZL --  Functions for experience points of our hero
  function hero_meta:set_xp(xp)

    if type(xp) == "number" then
local game = self:get_game()
game:set_value("current_xp", xp)
else
        print("Error in hero:set_xp(xp), xp should be a number.")
    end
  end
  function hero_meta:add_xp(xp)

    if type(xp) == "number" then
local game = self:get_game()
local current_xp = game:get_value("current_xp")
game:set_value("current_xp", current_xp + xp)
else
        print("Error in hero:add_xp(xp), xp should be a number.")
end
  end
  function hero_meta:get_xp()

local game = self:get_game()
local current_xp = game:get_value("current_xp")
return current_xp
  end

end



Edit: Sorry, don't forget to  initialize_hero() !!!
Code (Lua) Select

function quest_manager:initialize_quest()

  -- blablabla
  initialize_hero()
  -- blablabla

end


____________________

ENEMIES

In your scripts for enemies where you have declared their behavior  (e.g  ../data/enemies/lib/slime_behavior.lua),
just add a variable named for example "properties.xp" in your 'function behavior:create(enemy, properties)'. I don't know, but the name of your function is perhaps different.

In my example, I decided to define xp according to life, damage and speed of the enemy.
properties.xp = properties.xp or (properties.life * properties.damage * properties.normal_speed)

In this example, I added xp in the 'function enemy:on_dying()', I think it is logical, but you can do differently:

  function enemy:on_dying()
 
local hero = enemy:get_map():get_entity("hero")
hero:add_xp(properties.xp)

  end
#11
Hello,

I would like an object that can regenerate.
But, my problem is that when I tick the option to regenerate, there are two animations of destruction:
First, there is an animation of destruction (with the sound) when the hero begins to lift an object
and then, there is the same animation and the same sound when the hero is destroying this objet (after having throwing it).
The first animation is OK for a "flower bomb", not too ugly for a bush, but strange for a rock or something in wood.

Is there a way to have two animations and sounds or even delete the first animation of destruction and its sound?
I tried with metables, but I did not succeed.

Thanks in advance.
#12
Development / Problem with fade_in and fade_out methods
October 04, 2015, 06:53:51 PM
Hello,

I don't know if there is a bug with the following methods:
drawable:fade_in([delay], [callback])
and
drawable:fade_out([delay], [callback])

I make maybe some mistakes in the use of these methods. :-[
These methods work, but at the end, the chosen colors are not exactly the same.
When I picked the color in an image editor (e.g. Gimp), I can see it's darker.
It is as if the surface kept a little transparency at the end of my fade_in() . Even when I used surface:clear()

So instead of writing this,
self.bg_surface:fade_in()

I write this:
self.bg_surface:fade_in(20, function () self.bg_surface:set_opacity(255) end)

This workaround may not work with text_surface, because there is no text_surface:set_opacity(opacity)
Is there a solution?
#13
I see this method  'pickable:get_followed_entity()' exists so I guess it is possible to attach a pickable heart to a custom entity  would return together to the hero.
Perhaps with movements? But how then appoint an unnamed pickable heart created automaticcally by the engine?I can get the sprite with a table, but not the entity.
#14
Hello,

Unless I am mistaken, only surfaces have the following method in drawable objects (surfaces, text surfaces and sprites):
surface:set_opacity(opacity)

drawable:set_opacity(opacity) would be a good  feature, isn't it?
#15
Development / HUD: ZL Hearts
May 24, 2015, 06:35:56 PM
----------------------------
HUD - "ZL HEARTS"
version 1.0


Attachment:  HUD - ZL Hearts.zip
----------------------------

- Explanation:
This stuff will help you to change the appearance of the health bar in your Solarus project.
The first heart represents the first four lives... OK stop! No further explanation!. A picture is worth a thousand words;

Example 1:
The original health bar (here, there are 15.5/20 hearts or 15.5 * 4 = 62 lives on 80) will be replaced by this smaller bar:


Example 2:
I played with the console to test "game:set_life()" and "game:set_max_life()"



- Tested with Solarus v1.4.2

- IMPORTANT !!! Save your files before replacing them!

- Copy these files in your Solarus project. The file path may differ from yours.

..\data\sprites\hud\empty_heart.dat    (There are 6 animations instead of 2 animations if you compare with the original data file.)

..\data\sprites\hud\hearts.png      (Some graphics are edited from a Zelda game. For copyright reasons, don't sell your project! )

..\data\scripts\hud\hearts.lua      (This file contains the main script edited from a original one by Christopho.)

..\data\scripts\hud\hud.lua      (It is not necessary to replace this file. The script contains a few more lines than the original created by Christopho. Keep yours and see below )
1st choice:
Copy the "hud.lua" file or add/replace these lines if you want to align element to right  when the player wins a new  heart container.
(...)
local hearts = hearts_builder:new(game)
hearts:set_dst_position(- (game:get_max_life() + 16), 6)
hud.elements[#hud.elements + 1] = hearts
local nb_max_hearts_displayed = game:get_max_life() / 4
(...)
local nb_max_hearts = game:get_max_life() / 4

if nb_max_hearts ~= nb_max_hearts_displayed then
nb_max_hearts_displayed = nb_max_hearts
hearts:set_dst_position(- (game:get_max_life() + 16), 6)
end
(...)


2nd choice:
Keep your "hud.lua" file if you want to align element to left when the player wins a new heart container.
Just adjust the x value of  hearts:set_dst_position(-104, 6)
Perhaps you should also change the value of x hearts.surface = sol.surface.create(116, 11) in the "hearts.lua" file.


EDIT:
- Erratum: For empty_heart.dat, I said there were "6 animations instead of 4 animations",  but it's "6 animations instead of 2 animations"
- Images were hosted at an ISP, so I attached them directly at the forum,  as I did with the .zip file.
You just have to be connected to see images.

#16
Hello,

Is it possible to resize a surface with something like "surface:set_size()" that seems to not exist?

I would like to to do it in a "rebuild_surface' function.


Thanks in advance.
#17
Your projects / Solarus - ZL project
April 14, 2015, 11:03:36 PM
Quelques graphiques qui sont en cours pour un projet Zelda-like. Si vous avez des critiques, je suis preneur! /
Some graphics that are in progress for a Zelda-like project. If you have critics, I'm interested!  ;)


ENEMY:

Sorcier Rouge / Red Wizard




NPCs:


Très inspiré par Hamlet le cochon dans Illusion of Time. / Very inspired by Hamlet the pig in Illusion of Gaia. image














#18
I am a beginner in lua scripting , but I would like to share something that helped me to debug a problem in a lua script.
This will be useful only for newbies like me ;)
I simply redirected the outcome of variables into a new text file to better understand what was wrong with my script .
Just add these lines in the script by replacing, of course, the name of your variables.
For my part , I inserted these lines in a loop.

- Here an example with 3 variables: var1, var2 and booleanvar

file = io.output (io.open ("my_debug.txt", "a +"))
io.write ("variable1 =" ,var1 , "\tvariable2 =", var2, "\t", "\tboolean variable =")
if booleanvar then
io.write ("true")
else
io.write ("false")
end
io.write ("\n")
io.close (file)


- Info:
"\t" means tab
so "\t", "\tboolean variable =" will generate 2 tabs.

"\n" creates a new line in the file.

Further explanation here and here
(Sorry but it's in French)


- In "my_debug.txt" that will be created in your Solarus project, you will get lines like these:
(Of course DO NOT name your output file "error.txt")

Quote
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =true
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =false
variable1 =232   variable2 =277      boolean variable =true
variable1 =338   variable2 =413      boolean variable =false
variable1 =338   variable2 =413      boolean variable =false
variable1 =338   variable2 =413      boolean variable =false
variable1 =338   variable2 =413      boolean variable =false
(...)
#19
Development / Help: Enemy throwing a projectile
February 07, 2015, 08:25:24 PM
Is there an explanation somewhere on the way to create an enemy that throws something like a fireball?
The enemy would throw the projectile only if the hero is quite close and if the enemy  can see him.
#20
Hello,

There is a small bug on tiles whose colors have an alpha channel (for example, on the semi-transparent tiles).
"Solarus Quest Editor" (map or tileset) complies with the transparency of the image editor (Gimp), but in-game it's a little more opaque.
By cons, if we pass this tile in "dynamic tile", it is OK.
So the problem is on static tiles of any layer (low, intermediate or high).

To test, just add a dark color and a little transparent tile in the tileset (example: opacity 30 with Gimp), take the white for the background in the tileset options,
than during the mapping, take the static tile and make another which is converted to dynamic tile.
In the game, we can see the difference in color. The static tile is darker.
I use Solarus Engine v1.3.