Recent posts

#81
Development / Re: Playable Ocarina and Day a...
Last post by Christopho - December 13, 2022, 04:48:12 PM
Hi! Nice to see that you enjoy creating your game with Solarus and that you are making progress :)

One way to create a day and night cycle is to use timers. You can create a timer that fires every X milliseconds, where X is the length of a day in your game. When the timer fires, you can increment the current time of day and update the lighting and music in your game accordingly.

To create a playable ocarina, you can use the input system to detect when the player presses certain buttons on the keyboard or gamepad. You can then use that information to play a sound effect and display a visual effect on the screen to simulate the ocarina being played.

If you have not programmed in Lua before, it may take some time to learn the language and understand how to use it with Solarus. I recommend the Programming in Lua online book for that. Once you know some basics about Lua, good places to help you get started are the Solarus tutorials and documentation, the forums here and Discord.

I hope this helps and good luck with your game!
#82
Development / Playable Ocarina and Day and N...
Last post by sun_yok - December 13, 2022, 12:49:24 PM
First of all, I want to thank all of y'all!! Just found out about Solarus this weekend and this is a blessing, I've been trying to do an idea of a game for years and only with two days using Solarus I already achieved a long time dream, now I'm switching my game to Solarus, I already made some progress on other Engine, but now I want to find out the way to do on Solarus, if y'all can help me I will be very grateful

I want to create a day and night cycle that works in: day and night/30days/4weeks/4months, anybody knows how to achieve it?

And I also wanna do a playable ocarina

I never programmed in lua, actually, the only program that I ever programmed with was RPG Maker, but I already achieved things in Solarus that makes me feel like when I was trying to learn RPG Maker when I was young.

Well, any help would be great, because I am trying to make my game works for at least 8 years, hope I finally have found a way to do it trough Solarus :)
#83
Development / Are there any examples for the...
Last post by gzuk - November 06, 2022, 11:48:09 AM
Hello, I read on the forums that you could use the new module coroutine_helper.lua to build cutscenes, to avoid endlessly nested callbacks.

However, I couldn't get it to work. I could only get one-time events to work, like playing a sound. I couldn't get the "only if game available" features to work, probably because I didn't make the game available in the right way.

Is there perhaps a working coroutine_helper game or example available, that uses the more complicated "only if game available" features, like dialogue, or characters moving around?

Many thanks for an answer!  :)
#84
Game art & music / Re: Lake Tileset with Animatio...
Last post by embarrassfat - October 30, 2022, 05:11:00 AM
This looks amazing. I like the logs.
#85
Development / Re: Making 3 wall blocks get d...
Last post by aaa - October 27, 2022, 05:14:58 PM
Thank you so much!!!
#86
Development / Re: Making 3 wall blocks get d...
Last post by Christopho - October 27, 2022, 08:57:26 AM
Check the new tutorial playlist here: https://www.youtube.com/playlist?list=PLzJ4jb-Y0ufwkbfy49F_NrLtxCAiGJw5r
Episode #57 covers exactly that (making something happen when torches are lit), but you first need all the basics including custom entities (episode #54). Have fun!
#87
Development / Making 3 wall blocks get delet...
Last post by aaa - October 27, 2022, 05:25:04 AM
Hello! I have little to no experience with programming, but I want to make a room with a route blocked by 3 wall blocks, and I want the route to become accessible once 2 torches are lit. How can I do that? Thank you very much!
#88
Development / Re: Make 2nd hero un-attackabl...
Last post by gzuk - September 24, 2022, 09:18:03 PM
Thank you very much. I've checked out your additions, and the on_attacking_hero function works very well. If you define it on both heroes and leave it empty, then the heroes won't hurt each other any more, like for a coop game.

I'll play around some more with the multiple heroes, and make a new post when something else comes up.
#89
Development / Re: Make 2nd hero un-attackabl...
Last post by stdgregwar - September 21, 2022, 11:02:48 AM
Hello !

You are right disabling friendly fire is a lacking feature. I added a way to do it in this merge request : https://gitlab.com/solarus-games/solarus/-/merge_requests/1421

It adds the `on_attacking_hero` event that can be used to short circuit the default behavior and decide what to do. To disable the friendly fire quest-wide you can add the event to the hero's metatable.

Thank you for testing the multiplayer features !

#90
Development / Re: Make 2nd hero un-attackabl...
Last post by gzuk - September 19, 2022, 08:57:48 PM
I saw that you can call state:set_can_be_hurt on a state object. And in the parameter function you could probably check if the attacker is another hero, and then do nothing. But I'd have to set that on all the default states ("free", "running", "sword swinging" etc.), and I don't know where these states are created or stored. Does anyone know how I could get a handle on all the default states?