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

#61
sol.main.game does not exist yet (i.e. is nil) at the time your script is executed. And your script is executed the first time you require() it, so most likely long before you assign something to sol.main.game.
#62
Development / Re: Cutscene troubles (as menu)
October 10, 2018, 01:33:10 PM
You can add an initialization function to your cutscene table, and store the game from there:
Code (lua) Select

local cutscene = {}

function cutscene:initialize(game)
  cutscene.game = game
end

function cutscene:on_started()

...

and call this function just before starting your menu.
#63
We fixed some performance issues in Solarus 1.6. Can you compile the dev branch of the repository to see if you still have the problem?
#64
Development / Re: How to filter an entity iterator?
September 25, 2018, 09:35:34 PM
We are planning to do this in Solarus 1.7: https://gitlab.com/solarus-games/solarus/issues/843
#65
General discussion / Re: We have moved
September 20, 2018, 12:28:42 PM
And here is the link: https://discord.gg/yYHjJHt
#66
Yes ! I will definetely think about this in future maps.
#67
Development / Re: Solarus 1.6 early?
September 02, 2018, 11:01:44 AM
Early 1.6 development versions can be used at your own risks :)
#69
I think you may have a confusion between your bomb item and your bomb counter.

If you replace "bomb" by a simpler item in your code (like "lamp"), I guess it will work.

Bombs like the bow & arrows: in my games, I have
- an item for the bow (which is saved and has a counter),
- another item for arrows (which is not saved but its effect is to increase the bow counter),
- and even a third one for the quiver (which is saved and whose effect is to change the maximum value of the bow counter).
It may seem complicated, but when you think about it, you don't have a lot of other choices.

Bombs work exactly the same in my games:
- an item "bombs_counter" for the bombs counter (which is saved and has a counter),
- another item "bomb" for individual bombs (which is not saved but its effect is to increase the bombs counter),
- and even a third one "bomb_bag" (which is saved and whose effect is to change the maximum value of the bombs counter).

So, once you understand that, it does not make sense to set the variant of item "bomb" to 1, since it is not an item that has a saved possession state (assuming your items are named like mine!). So, I guess you should just change the amount of the bombs counter instead of trying to give a bomb item.

Code (lua) Select

game:get_item("bombs_counter"):add_amount(1)
#70
Custom properties are a new feature of 1.6, so not released yet.
#71
Hmmm when there is a treasure in a chest, the hero always brandishes it. If you let the chest empty (no treasure), then really nothing happens and your on_opened() event can do what you want (including giving an item without brandishing it).

But when I start suggesting that, I realise that you are not really using any feature of chests anymore. So maybe you should use a custom entity instead.

PS: hero:start_treasure() does brandish the treasure. Use game:get_item("thing"):set_variant/amout() to give an item silently.
#72
As its name implies, brandish_when_picked affects picked treasures.

You can customize when happens when a chest is open, using the chest:on_opened() event: http://www.solarus-games.org/doc/1.6/lua_api_chest.html#lua_api_chest_on_opened
#73
Development / Re: Hero state question
August 09, 2018, 11:53:36 PM
There is no hero:set_state() function because depending on the state you want, there are different parameters needed. Like in the treasure state, you need to specify which treasure you want. For this reason, there are separate functions instead. The one you want is hero:unfreeze(). It unblocks the hero, that is, it restores control to the player.
#74
The bug also happens in my games and still with 1.6. I guess we had never noticed before :)
https://gitlab.com/solarus-games/zelda-xd2-mercuris-chess/issues/133
#75
Development / Re: Side scrolling functionality
August 08, 2018, 09:11:43 AM
This is a known issue. The side-scrolling script does not support jumping correctly yet.