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 ... 47
1
General discussion / Re: 19 transitions
« on: May 18, 2017, 01:57:05 pm »
Remark: When the feature drawable:set_pixels is done, we could make some of these directly with code (without need of png images) and with a much smoother animation.

2
General discussion / Re: Design of graphs of dungeons
« on: May 18, 2017, 12:24:58 am »
Mark Brown has uploaded a new interesting video: https://youtu.be/1ewa26q76fE

3
General discussion / Re: Tunics id that impact the player stats ?
« on: May 15, 2017, 01:54:44 pm »
Unlocking heroes is a cool idea. You could make sidequests to help these heroes and, after completion, unblock them (I guess that was your idea). The remaining Eldran sprites will be ready in 2 months (this month I am too busy at work). If you need some new animations for your new weapons (ocarina, shovel, etc), just tell me to do them. I think it is good to have Eldran in your game, for "advertising" purposes and make him famous :)

4
Development / Re: How to add an "opening" animation for chests?
« on: May 11, 2017, 10:19:14 am »
You will need to do something similar for NPCs, and many other types of interactions with other entities (switches, carried entities, etc). That is a lot of work.

5
Development / Re: How to add an "opening" animation for chests?
« on: May 11, 2017, 07:40:20 am »
Ok, if you allow to do that then you are right, I did not think on that case.

6
Development / Re: How to add an "opening" animation for chests?
« on: May 10, 2017, 09:07:50 pm »
I think you are complicating things too much. You should just define custom_entity:on_interaction() for your custom chest. There is no need of checking distances and timers, or using the event on_key_pressed().

7
Development / Re: How to add an "opening" animation for chests?
« on: May 10, 2017, 12:45:11 pm »
Remark: using custom entities takes a bit more of work than using the chest metatable, since you would need to define the functions and events of the chest Lua API. On the other hand that solution allows much more customization on chests: for instance, you can make chests that can only be opened by one of the heroes and not by the others, or make chests that can be opened by throwing a pot.

8
Development / Re: How to add an "opening" animation for chests?
« on: May 10, 2017, 12:31:01 pm »
For your purposes with chests, I recommend to use normal chests in the map editor, just to have compatibility with the map editor. There are several ways to do this:
-Use a script that replaces chests with custom entities when a map is created, or when chests are created. This can be done directly by defining chest_metatable:on_created().
-Another way is to define chest_metatable:on_created() in order to define some events on the sprite of the chest, which would allow that animation to appear.

9
Development / Re: On_interaction error?
« on: May 09, 2017, 11:32:58 pm »
So you are using Solarus v1.5.0. Try to use version 1.5.3, does it happen too?

10
Development / Re: On_interaction error?
« on: May 09, 2017, 04:26:06 pm »
Just to be sure, have you checked both origin points? (There are 2, the one of the sprite and the one of the entity.)

11
Development / Re: On_interaction error?
« on: May 09, 2017, 02:23:10 am »
I am quite sure that on_interaction does not work in that way. I think that the hero must be facing the bounding box of the custom entity, and if that is the case, maybe the origin point of your custom entity sprite is wrong. Could you check if that is the problem?

12
Development / Re: On_interaction error?
« on: May 08, 2017, 08:18:37 pm »
Which is the custom entity in your image above?
If it is a sign, maybe you should check if the hero is facing it, but I am not sure if that is really necessary.

13
Development / Re: Quickest way to create and edit sprite sheets
« on: May 07, 2017, 11:57:02 pm »
Try Aseprite. It might be the best program for this type of pixel art. Many professional artists (and non-professional artists like me) use it.

Here there is a ranking from the Slant community with votes for the best pixel-art/sprite editors in this year 2017:
https://www.slant.co/topics/1547/~pixel-art-sprite-editors
(In that list, Aseprite is ranked 1st and paint.net is ranked 10th.)

14
Development / Re: Speed depending on a fixed duration ?
« on: May 05, 2017, 11:21:18 pm »
I cannot find any problem. Maybe we need more info to help, or it could be an engine problem (maybe with target movements?).
As a possible workaround, try to move the camera with a straight movement, and tell us if the speed change works.

15
Development / Re: Speed depending on a fixed duration ?
« on: May 05, 2017, 02:13:34 pm »
I thing I got it right, so, this should be right ?

Code: Lua
  1. local speed = sol.main.get_speed({
  2.                   target1 = {x = xx2, y = yy2},
  3.                   target2 = {x = x2 , y = y2},
  4.                   duration = 650,
  5.                 })

Code: Lua
  1. -- Function to have a speed depending on a distance
  2. -- The target speed is dependant of the time
  3. function sol.main.get_speed(speed)
  4.   local target1 = {x = speed.target1.x, y = speed.target1.y}
  5.   local target2 = {x = speed.target2.x, y = speed.target2.y}
  6.  
  7.   local result  = math.sqrt((target1.x - target2.x)^2 + (target1.y - target2.y)^2)
  8.  
  9.   return result / 2 * (speed.duration / 100) -- Speed may vary depending on the given duration
  10. end
  11.  

EDIT, might not be the right solution, if I test to measure the duration between the 2 movement, the arrival time isn't the same, even if a duration has been set

Some suggestions:
1-I might be wrong, but line 9 seems completely wrong, or I do not understand how you are doing this.
2-If you are only using that "sol.main.get_speed" in 1 cutscene, it is better to define it as a local function (because it is not needed elsewhere).
3-I would give the duration in milliseconds, but that is just a personal choice.
4-There is already a function sol.main.get_distance, which would shorten a bit line 7, and the code would be equivalent.

I propose the following code:
Code: Lua
  1. local hx, hy = hero:get_position()
  2. local c1_x, c1_y = 300, 200 -- Initial position for the camera.
  3. local c2_x, c2_y = 800, 150 -- Final position for the camera.
  4. local duration = 2000 -- In milliseconds. Duration of the movement.
  5. local distance = sol.main.get_distance(c1_x, c1_y, c2_x, c2_y)
  6. local speed = distance * (1000 / duration) -- In pixels per second.
  7.  

Pages: [1] 2 3 ... 47