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

Messages - froggy77

#136
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.
#137
It is not a crash of the engine. The problem with enemy:on_dying() is just that, too much frames in an animation don't have time to finish ; We do not see then all the frames.
I even added a timer. It is replaced too soon by sprite "enemies/enemy_killed" and there is only one possible animation for "killed" (for a single monster).
#138
Development / Re: Getting Started on a Mac
April 19, 2015, 07:54:20 PM
Im' not a MAC user, but in general, if you get this kind of messages in a terminal, it means that you type something wrong in your command.
I see in your first post /Users/Jamie/Documents/Solarus Game Maker/solarus-1.3.1-OSX/solarus/solarus
Maybe you have spaces in the name of your path and install_name_tool considers that there are too many arguments in the command.

So if I were you, I would try renaming "Solarus Game Maker" by "Solarus_Game_Maker"
or just add double quote to your path "/Users/Jamie/Documents/Solarus Game Maker/solarus-1.3.1-OSX/solarus/solarus"
#139
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














#140
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
(...)
#141
Development / Re: Help: Enemy throwing a projectile
March 29, 2015, 03:57:45 PM
"The latest release of ZSDX (1.9) works with Solarus 1.3."sorry I did not know. Indeed there are some examples .
I managed to create an enemy that shoots fireballs when the hero is far enough. Fireballs go straight.
The enemy fled just when the hero is approaching. If the hero is near and its back is turned , the enemy attacks like a coward.

Now what I would like to do is that the enemy only shoot when there is no obstacle in front of him.
If there is a house or a wall between the enemy and the hero , the enemy still shoots and I would like to avoid that.
I try with entity:test_obstacles(dx, dy, [layer]) but I don't really understand it.
Is this method tests the presence of an obstacle every x and y of the "vector" or simply the end point ?
What would be the right approach ?
#142
So it was not a bug. :)
#143
the bread, if I were you , I would try with an empty map and I would try to start the game on this map.
It may be, for example , the configuration of an enemy or an NPC that would do this.
#144
It works with black (#000000) and replacing the opacity of 30 % to 31.4 %.
There is probably a difference in the 'behavior' between dynamic and static tiles.
#145
Development / Re: Help: Enemy throwing a projectile
February 08, 2015, 04:53:22 PM
Sorry but examples in ZSDX are too complicated and most seem too different from version 1.3 of Solarus Game Engine.
#146
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.
#147
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.
#148
Thank you Christopho  :)
It may be possible to improve the script, but it works. I agree that you correct if you see an error.

local map = ...
local game = map:get_game()

function light_switch:on_activated()

  if light_tile:is_visible() then
light_tile:set_visible(false)
   else
light_tile:set_visible(true)
  end
  light_switch:set_activated(false)
end

function light_switch:on_inactivated()

  light_switch:get_sprite():set_animation("activated")
end
#149
Hello,

I don't understand how to activate/reactivate a simple switch without reloading the map.
I works for crystal blocks, I would like the same behavior for a "light switch" to turn on / turn off the light and I would select my own sprites.

It's the same problem for the switch in the "test map" called Outside B2 (Village) of the tutorial. If I want to disappear again the ladder of the map, how should I do?
Once enabled, the switch (crystal) remains in yellow and can not be hit with the sword.


local map = ...
local game = map:get_game()

function light_switch:on_activated()

  light_tile:set_visible(false)
end

function light_switch:on_inactivated()

  light_tile:set_visible(true)
end

#150
Thank you for answering. For now, it does not work. :(
I kept the sprite "sprites/enemies/enemy_killed.png", but added several animations to it (Just a change of colors to test).
I simply copied / pasted the lines from enemy_killed.dat and put y = 32.
So I get two animations in enemy_killed.dat ("killed" and "test")

In   function enemy:on_dying(),   I added
sprite:set_animation("test")
This tries to work with the enemy sprite and not "enemy_killed.png"
So I put this instead.
local sprite2 = enemy:get_sprite()
sprite2:set_animation("test")

This tries to work too with the enemy sprite.and not "enemy_killed.png"

OK, so I tried another thing, I copied my new lines from enemy_killed.dat to paste them into .dat of the enemy.
It's not OK, because the enemy sprite is replaced too soon and then there is the usual animation called "killed".
Moreover, the animation is either too fast (I played with the "frame_delay") or incomplete  because the sprite is killed.

I even deleted the pixels to make transparent the "killed" animation.
I tried with  a create_sprite, but Solarus crashes and I have nothing in error log.
local sprite2 = enemy:create_sprite("enemies/enemy_killed")

What I know is that the problem exists between keyboard and chair. ;D