Recent posts

#31
Development / Re: Need Help With Having an N...
Last post by Pamala Reyna - September 06, 2023, 11:52:13 AM
Try moving the NPC to the hero position 1 or 2 frames earlier. This produces the following delay effect.  Bad Time Simulator
#32
Your scripts / Re: [UPDATE 1.2] Dash Required...
Last post by wuckertrhea - August 24, 2023, 11:29:24 AM
Could you provide us an illustration of how this works, please? This file would be perfect for my Full Hyrule entities pack, which features eight unique dash rock variations.

How about making this script a "Lift Level Required" obstruction, similar to the big rocks in LttP?
#33
Your projects / Re: Minish Cap Maps in Solarus
Last post by Dianthus - July 11, 2023, 06:28:41 PM
Hi just wanted to mention i am still working on it.. Soon done with wind ruins area.

#34
Development / Re: Image/Ilustration as backg...
Last post by hzamoracon - June 25, 2023, 12:31:19 PM
Tried to do the same with a Legend of Mana image, separated it into tiles and giving the terrain features (traversable, wall, water, etc), then pasted the tiles in order on the map and everything looks fine, I didn't think it was so easy!
It had been a long time since I played an rpg creator and solarus always caught my attention as it was focused on ActionRPG, This is awesome!
I didn't know that the LoM backgrounds were also placed with tiles, thank you very much for the answer and also for the extra resources.
#35
Development / Re: Image/Ilustration as backg...
Last post by PhoenixII54 - June 25, 2023, 08:39:13 AM
*aaah, Legend of Mana...* hum hum

Yes, of course you can use full images as a background: all you need is a second set of invisible tiles that have all the basic terrain grounds, that you overlay on the desired borders. By the way, LoM actually uses tiles, but with many, many more base elements than the 2D Zelda games.

edit : while unrelated to the base question, here is the page for LoM on the Spriters resource site, especially the "background" section which is showing the maps and their different layers :https://www.spriters-resource.com/playstation/lom/
#36
Development / Image/Ilustration as backgroun...
Last post by hzamoracon - June 24, 2023, 01:10:15 PM
Hello, new here.
I was wondering if it is possible to place an image as the background instead of working with tiles, and just put collisions to guide the movement of the character. Something like Legend of Mana for ps1?
I would just like to make illustrations on a working video game as a demo.
I have tried with rpgmaker but I would like to avoid implementing the action-RPG part and would like to try with solarus.
Is there a possibility, any ideas?
Sorry if I'm posting in the wrong forum.
#37
Development / Re: What does this error mean?
Last post by lefthandedhero - June 05, 2023, 03:40:33 AM
Quote from: PhoenixII54 on June 04, 2023, 10:37:05 AM
The error message says that it can't find the "hero" entity.
The reason is that you never asked the engine to give it to you in the first place.

Since you intend to make  some generic behavior for the hero -hero_meta-, you should use the hero's metatable (using sol.main.get_metatable), and then define what you need here. it works the same as using the hero directly, but more like a model, so multiples heroes will get the same behavior.
If you know the concept of object-oriented programming, then think of modifying the class instead of the instances.

Thank you. This is very helpful.

I am familiar with object-oriented programming; I am a little rusty at using it since I haven't practiced using it in a few years, but I remember all the fundamental concepts.
#38
Development / Re: What does this error mean?
Last post by PhoenixII54 - June 04, 2023, 10:37:05 AM
The error message says that it can't find the "hero" entity.
The reason is that you never asked the engine to give it to you in the first place.

Since you intend to make  some generic behavior for the hero -hero_meta-, you should use the hero's metatable (using sol.main.get_metatable), and then define what you need here. it works the same as using the hero directly, but more like a model, so multiples heroes will get the same behavior.
If you know the concept of object-oriented programming, then think of modifying the class instead of the instances.
#39
Development / What does this error mean?
Last post by lefthandedhero - June 01, 2023, 02:39:32 AM
Recently, I created a script specifically for code related to the hero, that I called hero_meta. Here is the code that's currently in this script:

local MAX_BUFFER_SIZE = 48
function hero:on_position_changed(x,y,z)
  local hero = self
  if not hero.position_buffer then hero.position_buffer = {} end
  local hero = self
  local dir = hero:get_sprite():get_direction()
  table.insert(hero.position_buffer, 1, {x=x, y=y, layer=z, direction=dir})

  if #hero.position_buffer > MAX_BUFFER_SIZE then
    table.remove(hero.position_buffer)
  end
end


The purpose of this code is to establish a maximum distance away from the hero and create a table storing the hero's prior movements within that distance.

When I try to run the quest, I keep getting this error:
Quote
Error: In main: scripts/meta/hero_meta.lua:2: attempt to index global 'hero' (a nil value)

What does this error mean? Any idea what is causing it to occur?
#40
Development / Re: Need Help With Having an N...
Last post by lefthandedhero - June 01, 2023, 02:15:50 AM
Quote from: PhoenixII54 on May 29, 2023, 09:02:36 AM
Not sure, but what i would guess is that the on_position_changed event gets triggered the next frame after you stopped moving, so maybe try to have one extra entry in the table and use two indices: one for the current hero step and one for the
NPC that is always 2 steps behind the hero -modulo will be your friend.
By the way, OH uses a standard .solarus zip file so you should be able to check the source code

Thank you.

I asked the developer of Ocean's Heart for the code they used for this, and they provided it, so I have replaced my code with it.