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.


Messages - froggy77

Pages: 1 ... 8 9 [10]
136
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).

137
Development / Re: Getting Started on a Mac
« on: 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"

138
Your projects / Solarus - ZL project
« on: 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















139
Development / Create an output file to debug your script
« on: April 13, 2015, 08:23:49 pm »
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

Code: [Select]
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
(...)

140
Development / Re: Help: Enemy throwing a projectile
« on: 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 ?

141
Bugs & Feature requests / Re: Hero keeps turning to the north
« on: March 29, 2015, 03:49:06 pm »
So it was not a bug. :)

142
Bugs & Feature requests / Re: Hero keeps turning to the north
« on: March 28, 2015, 08:06:07 pm »
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.

143
Bugs & Feature requests / Re: Opacity difference for static tiles
« on: February 11, 2015, 07:56:07 pm »
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.

144
Development / Re: Help: Enemy throwing a projectile
« on: 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.

145
Development / Help: Enemy throwing a projectile
« on: 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.

146
Bugs & Feature requests / Opacity difference for static tiles
« on: December 10, 2014, 01:25:47 am »
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.

147
Development / Re: Help: reactivate a switch without reloading the map
« on: December 07, 2014, 10:46:35 pm »
Thank you Christopho  :)
It may be possible to improve the script, but it works. I agree that you correct if you see an error.

Code: [Select]
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

148
Development / Help: reactivate a switch without reloading the map
« on: December 07, 2014, 01:15:05 pm »
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.

Code: [Select]
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


149
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
Code: [Select]
sprite:set_animation("test")This tries to work with the enemy sprite and not "enemy_killed.png"
So I put this instead.
Code: [Select]
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.
Code: [Select]
local sprite2 = enemy:create_sprite("enemies/enemy_killed")
What I know is that the problem exists between keyboard and chair. ;D

150
Hi,

I wonder if it is possible to call a sprite, during the "enemy:on_dying()", other than this sprite "enemies/enemy_killed" , for example, for a specific type of enemy.
"enemies/enemy_killed" would be the default sprite when nothing specified.

If so, what is the way to get it?

Thank you in advance.

Pages: 1 ... 8 9 [10]