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

#76
Game art & music / Re: Original art
September 01, 2018, 07:30:08 PM
Ahoy there! I bring good news: princess Robyne is now a fully playable hero (also, more new weapon animations will be added in the future). This testing video shows a few of the new animations: https://www.youtube.com/watch?v=wxctLsoPHmc

As always, feedback is welcome.
#77
Development / Re: custom entity and map limit
August 28, 2018, 01:09:02 PM
This does not seem trivial. I would try this:
1) Use "entity:on_obstacle_reached(movement)" to see when the NPC finds an obstacle and then check if the NPC is at the border of the map and looking outside (usethe bounding box coordinates and NPC direction). You can also do this with "on_position_changed", but it requires more work.
2) Then, use "set_ignore_obstacles()" to allow the NPC enter or go out of the map.

You can make a script to define an initialization function on NPCs (that is, to define this function in 1 line for each NPC), so that you avoid repeating code.
#78
I still don't see the aim of this. You can play Solarus on any OS and use controllers and gamepads, or am I wrong?
#79
1) Solarus is not an emulator, so your request makes no sense.
2) Solarus is multiplatform, so you can play in any device (if you get the compiled engine for that OS).
#80
Or Seiken Densetsu 3.
#81
There is another example in the project XD2. (The metal ball.)
#82
A nice video tutorial explaining the basics of Aseprite for beginners:
https://www.youtube.com/watch?v=Md6W79jtLJM
#83
And he should also define that function in the metatable, so that he does it only once. In case of more info needed in that function, he can use the custom properties in the editor.
#84
It will be possible with Solarus 1.6, with a new event function, and I think Christopho has already coded it. Chris has been working very hard, even harder than adamantium, on the engine, and from the more than 100 issues that there were before, less than 40 remain to do. That means Solarus 1.6 is coming very soon...
#85
Something like this may work (it is untested, so you should correct it if necessary).
Code (Lua) Select

-- Get the map coordinates of the cursor.
local map_meta = sol.main.get_metatable("map")
function map_meta:get_cursor_coordinates()
  local camera = self:get_camera()
  local mouse_x, mouse_y = sol.input.get_mouse_position()
  local cam_screen_x, cam_screen_y = camera:get_position_on_screen()
  local cam_x, cam_y, _, _ = camera:get_bounding_box()
  local pos_x = mouse_x - cam_screen_x + cam_x
  local pos_y = mouse_y - cam_screen_y + cam_y
  return pos_x, pos_y
end

-- Make the hero face the cursor.
local hero_meta = sol.main.get_metatable("hero")
function hero_meta:face_the_cursor()
  local hero = self
  local pos_x, pos_y = hero:get_map():get_cursor_coordinates()
  local dir = hero:get_direction4_to(pos_x, pos_y)
  hero:set_direction(dir)
end


You still have to import the script that contains these functions, and initialize a timer that will call "hero:face_the_cursor()" when necessary, as mentioned above. If we do all the work for you, you will not learn, so I will be leaving you here. Good luck!
#86
Quote from: llamazing on August 17, 2018, 01:51:00 AM
Updating the hero's facing direction every 1ms seems like a bad idea.

Unless he is making a shooter where the hero should always be aiming to the cursor, which we don't know.
#87
I recommend to add a function to update the direction of the hero. Something as simple as this should work:
Code (Lua) Select

function hero:face_the_cursor()
  local mouse_x, mouse_y = sol.input.get_mouse_position()
  local dir = hero:get_direction4_to(mouse_x, mouse_y)
  hero:set_direction(dir)
end

You can combine it, for instance, with a 1-millisecond-timer that calls the function "face_the_cursor" when necessary, or otherwise, with potatoes, ketchup and chicken wings.

PS1: Since the function "sol.input.get_mouse_position()" seems to calculate the position relative to the quest size, it may not work. I have never used/tested it. In that case, I leave the problem as an exercise for you.

PS2: my cats usally say catsup instead of ketchup.
#88
That (i.e. the hero throwing the item) can be avoided if you add some code to the corresponding event(s) on_key/command_pressed().
#89
Development / Re: Multiple enemies not acting the same
August 06, 2018, 08:23:15 AM
Some of your state variables, like 'attacking', are not local.
#90
That awesome feature will allow to have a hero of bigger or smaller size, which was a feature requested by many devs/artists using custom art of non-standard size. It will also allow to make a game like Minish Cap, where the hero can become smaller/bigger.