Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Game art & music / Re: Original art
« Last post by henif on May 13, 2022, 09:43:02 AM »
Whenever you modify any sprite, make sure you use the last version, which is the best one. (The one you used is the last one, and all the others in the sample quest are the last versions too, so it is ok.)
12
General discussion / Re: Not Able To Communicate With Fellow Players
« Last post by GregoryWeber on April 04, 2022, 03:39:29 PM »
Maybe my issue has been resolved, recently my Discord got an update, and after the update, the Output Device changed. This article helped me to figure it out, and after changing it to the correct one, my issue was resolved.
13
General discussion / Not Able To Communicate With Fellow Players
« Last post by GregoryWeber on April 01, 2022, 03:41:27 PM »
Hey everyone. I use Discord to communicate with others. However, from a few days I cannot communicate with them. Is there a solution to this problem? How can I fix it? Please help me out.
14
Development / Re: Missing resources
« Last post by Christopho on March 28, 2022, 10:04:39 AM »
It is normal that the entities folder is empty: there are no custom entity scripts by default (but that might change in the future).
Which sprite is missing from destructibles?
15
Development / Missing resources
« Last post by HylianUsual on March 26, 2022, 08:54:50 PM »
Hi. I have Solarus v. 1.6.5 installed as a snap on Xubuntu 20.04 and I've just started a project. The "entities" folder is empty and I'm missing at least one sprite from "destructibles". Any help?
16
Development / Re: How to mantain the chest activated?
« Last post by leon on March 19, 2022, 08:30:07 PM »
Hello!

I made it!

Thank you for your help!
17
Development / Re: How to mantain the chest activated?
« Last post by leon on March 01, 2022, 07:47:56 PM »
Right, I will try again! Thank you!
18
Development / Re: How to mantain the chest activated?
« Last post by Christopho on February 23, 2022, 09:45:23 AM »
game:set_value() is documented here: https://www.solarus-games.org/doc/1.6/lua_api_game.html#lua_api_game_set_value
It sets a variable that can be saved in the savegame file, which is what you want if I understand correctly. So that the information (the switch state) is preserved when the player leaves and reenters the map, or even if they save and quit. You just need to choose a name for your saved variable, in my code snippet I put "mymap_interruptor_a" as an example but it is up to you to choose a relevant name. And the value is a boolean: true to indicate that the switch is activated, false (or unset) otherwise.

Then in map:on_started(), call game:get_value() to retrieve the state of the switch, and if it is saved as activated, then activate it with interruptor_a:set_activated(true).

If you are lacking Lua basics in general, I would recommend the Programming in Lua free guide: https://www.lua.org/pil/contents.html

PS: I just check tutorial 17. In that tutorial, I use the state of the treasure chest (which is automatically saved, as set by a checkbox in the quest editor) to guess the state of the switch, so actually I don't have to do all that.
19
Development / Re: How to mantain the chest activated?
« Last post by leon on February 22, 2022, 08:18:35 PM »

I´m sorry, I can´t understand (I´m noob).

What I must to learn to understand this line of code that you showed?
20
Development / Re: How to mantain the chest activated?
« Last post by Christopho on February 21, 2022, 10:29:06 PM »
The state of the switch is not saved automatically: you have to save it explicitly. In other words, this condition is always false in map:on_started() (when the map starts):
Code: [Select]
elseif interruptor_a:is_activated() then
But you can save the state of the switch yourself when the switch gets activated, with
Code: [Select]
game:set_value("mymap_interruptor_a", true)and test that in map:on_started().
Pages: 1 [2] 3 4 ... 10