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 - Diarandor

Pages: [1] 2 3 ... 49
Development / Re: Zelda Roth Reproduced Intro Help
« on: June 26, 2017, 12:12:51 pm »
Probably, but I am not sure if that is the same thing, and also I don't know which license has that code (it could be incompatible with GPL).

Anyway, you cannot directly add a library without coding something in the engine (the C++ part).

Development / Re: Zelda Roth Reproduced Intro Help
« on: June 26, 2017, 02:14:38 am »
To do that zoom with that camera angle we may need something like this:
Or maybe just a normal zoom (maybe this can already be done).

I don't remember if there are already requests for these features in github.

Development / Re: Zelda Roth Reproduced Intro Help
« on: June 25, 2017, 11:09:12 am »

Ok, the error is exactly in line:
Code: Lua
  1. frescos[i]:set_xy(0, 16)
which means that
Code: [Select]
frescos[i] is nil, or in other words, your image has not been created in the previous line:
Code: Lua
  1. frescos[i] = sol.surface.create("menus/intro/intro" .. i .. ".png")
which in turn means that the id of the image (this one: "menus/intro/intro" .. i .. ".png") is not correct.
(The image has not been created by the engine since that file does not exist; there is something wrong in that string.)

Development / Re: Zelda Roth Reproduced Intro Help
« on: June 25, 2017, 09:56:57 am »
The error is in line 33 of your script (could you post the code of all the script?).
It says that you are trying to index (access an attribute) of a nil variable (the variable has nothing attached so you cannot access the attribute and hence you get an error; you need a list to access an attribute).

Development / Re: Jump movement direction4 error?
« on: June 24, 2017, 08:16:57 am »
I found the problem. The problem is that the facing direction will not change because function entity:on_movement_changed() is inside the function entity:on_created().
It is good to see that there is no engine bug this time and all is fixed. (The less bugs it has, the sooner we will have new features added by Chris.  ;D) Yes, we should close the github issue.

Development / Re: Jump movement direction4 error?
« on: June 24, 2017, 06:09:37 am »
Sorry for my arrogance before, but I am under too much stress these days.
I have now tried the script directly (I didn't before, I had only read the code).

After "cleaning" the code a bit, it works, so I confirm that there is no bug (unless someone can prove that I am wrong  :P).
The problem is just that the script is not well coded, in the following parts:

I tested it with a custom_entity script. There is a line of code missing since "metatable_entity" is not defined, but I guess that it is
Code: Lua
  1. metatable_entity = ...

and in that case "metatable_entity" is not really a metatable in the formal sense (I think).

1) Your events on_interaction() and on_movement_changed() are not called the first time you create a jump, because they are defined inside your function "metatable_entity:jump". These events should be defined outside that function. Although the variable quick_movement is not defined outside the function "jump", you can still access the movement with entity:get_movement().

2) This part is really confusing and gives problems:
Code: Lua
  1.   sol.timer.start(450, function()
  3.     function quick_movement:on_finished()
  4.       set_stop_aniamtion = true
  5.     end
  7.     if set_stop_aniamtion == true then
  9.                  self:get_sprite():set_animation(finish_animation) --finish_animation
  10.    return false
  11.     end
  13.    return true
  14.   end)
If your jump ends in less than 450 ms, the event quick_movement:on_finished() would never be called since it would be defined after the movement has ended. Actually you do not need a timer, and should probably write something like this instead of the above code:
Code: Lua
  1.     function quick_movement:on_finished()
  3.       entity:get_sprite():set_animation(finish_animation)
  4.     end

I can paste a copy of the modified script if you want. It works and the sprite of the custom entity is always facing the direction of the jump, which I believe is what you wanted (otherwise I did not understand your final purpose).

And I insist that having a clean code is more important that it may appear, not only for finding bugs, but also to make the code understandable to others who want to help you.

Development / Re: Jump movement direction4 error?
« on: June 23, 2017, 07:23:53 pm »
I cannot understand anything. You did not explain properly what you are doing and what is the problem. And there is too much unnecessary information in the explanations.

-The image does not help at all. We cannot even know which entity is the hero, or what you are doing.
-In your explanations I cannot understand "what" is facing "what". All is unclear.
-You should learn to debug properly before we get crazy with your code.

Try this function instead:
Code: Lua
  1.   function self:on_movement_changed()
  2.      print("Movement Direction: " .. quick_movement:get_direction4())
  3.      print("Entity Initial Direction: " .. self:get_direction())
  4.      self:set_direction(quick_movement:get_direction4())
  5.      print("Entity Final Direction: " .. self:get_direction())
  6.   end

Now, tell us the printed values that you get in the console, and what really happens in the game when you test it.
(We need more information. But only the useful one.)
I have tested the function custom_entity:set_direction() and it works perfectly for me, at least with the main sprite, so I cannot find functions that work in a wrong way as you say.

If you can write a new script with the MINIMAL and SIMPLEST code necessary to reproduce the bug, that would help a lot.

Development / Re: Jump movement direction4 error?
« on: June 23, 2017, 05:42:19 pm »
I will try to find out what is the problem.

Anyway, some advices that you should take seriously into account to write better code:

1) This was already pointed out by MetalZelda but you did not change it:
Lines 121-136 of your "Entity Create Jump Method" and lines 174-189 of your "Entity Jump Method" can be shortened in a clearer way with only 2 lines:
Code: Lua
  1. self:set_direction((hero:get_direction() + 2) % 4)
  2. game:start_dialog(dialog)
(You were repeating too much code unnecessarily.) If you don't understand the math, just ask.

2) This is just a matter of taste(not so important), but lines like:
Code: Lua
  1.   if speed == nil then
  2.     speed = 40
  3.   end
can be also written (in a shorter way) like
Code: Lua
  1.   speed = speed or 40
(Check the "or" and "and" operators in the Lua maual for more info.)

Development / Re: On_interaction error?
« on: June 23, 2017, 07:35:27 am »
I confirm the bug. Check the github issue for more info.

Development / Re: Jump movement direction4 error?
« on: June 23, 2017, 07:07:39 am »
Could you post the full code of each script again? (The newest version.)

Also, indicate the filename of each script above its code. Then, if you want to comment something about the code, you only need to give the script name and the line number. (Copy-pasting isolated pieces of code does not help at all!!!)

Game art & music / Re: Original art
« on: June 23, 2017, 04:15:45 am »
Ahoy there! Not much progress yet, but you may like this: the remastered "bow" animation for Eldran.

A newer version will include the arrows in the shooting animation. Also, walking with the bow is a planned feature, so there will be new animations for Eldran stopped/walking while he is aiming with the bow.

Development / Re: Heart Fully Replenished - Help
« on: June 22, 2017, 12:22:53 am »
Hello! What would be the command to restore all life when you pick up a heart container? I know the logic but not the command = /

Ahoy there! There is not a single command to do that.
But if you already know the logic, you can easily do it.

You will find here the tools and commands that you may need:
The rest is just Lua, but I leave it as a programming exercise for you. ;)

PS: you can also find the code you need in any Solarus game made by Christopho.  :)

Game art & music / Re: Tilesets for Oni-Link Begins: Solarus Edition
« on: June 21, 2017, 09:47:09 pm »
Chris has confirmed that he has already uploaded a snapshot in the dev version 1.6 with the feature. :D

Game art & music / Re: Tilesets for Oni-Link Begins: Solarus Edition
« on: June 21, 2017, 05:23:37 pm »
Hi @ffomega! I inform you about these good news:

Check this:

Maxs1789 has already coded the feature to move several tile patterns simultaneously, selected by using a rectangle, in the tileset editor (and Chris will soon upload a snapshot with this feature for the dev version 1.6). This feature is very useful for two purposes:

1) Creation of art of new tilesets, including both the tileset and png images. (This is my case, because I may decide to relocate tile patterns during the art creation.)

2) Creation of huge tilesets (just like yours, @ffomega). In case you decide to move/relocate some group of tile patterns to other part of the image/tileset, this feature may save many hours (or even weeks) of your life!!!! So take this feature into account when you work with tilesets :)

Development / Re: [QUESTION] Traversable prickles?
« on: June 21, 2017, 04:58:16 pm »
Maybe using dynamic tiles metatable and apply bad ground if id = spikes

Since dynamic tiles are entities, you can redefine it's behavious on creation time

I agree with MetalZelda: this is probably one of the most elegant ways to code it. (Create normal tiles and replace them with custom entities immediately after their creation, which can be done from the tiles metatable.)

Note that you can allow the spike tiles to be resizable, but in this case you need the custom entity to create as many sprites as 16x16 rectangles you have in your spikes tile.

Pages: [1] 2 3 ... 49