Recent Posts

Pages: 1 [2] 3 4 ... 10
Your scripts / Re: New rain script
« Last post by froggy77 on February 25, 2021, 11:34:29 PM »
'set_rain_mode' maps/hyrule/b3.lua:4: in main chunk
What does your file 'b3.lua' contain? Something like that?
Code: [Select]
local map = ...
local game = map:get_game()
function map:on_started()
   game:set_world_rain_mode("outside_world", "rain")
Your scripts / Re: New rain script
« Last post by PeterB on February 25, 2021, 09:46:16 PM »

I am no lua expert but it looks as though timers is not getting any value assigned to it.

Have you tried snow or hail, do they throw up errors as well?

I assume you are calling require("scripts/weather/rain_manager") from your game_manager script otherwise you wouldn't get an error.

If you copied the scripts across they should work so what else have you got in your map.lua script?

The scripts work for me in my game so I am at a loss.
Your scripts / Re: New rain script
« Last post by Svenibu on February 25, 2021, 09:08:36 PM »
i have imported the script in the link and i have the same problems.

i have tested game:set_rain_mode("rain")
Code: [Select]
function map:on_started()


I get a error in the console

Error: In maps/hyrule/b3: scripts/weather/rain_manager.lua:212: attempt to index upvalue 'timers' (a nil value)
stack traceback:
[C]: in function '__index'
scripts/weather/rain_manager.lua:212: in function 'stop_timers'
scripts/weather/rain_manager.lua:224: in function 'start_rain_mode'
scripts/weather/rain_manager.lua:59: in function 'set_rain_mode'
maps/hyrule/b3.lua:4: in main chunk
Your scripts / Re: New rain script
« Last post by PeterB on February 23, 2021, 09:12:35 PM »

Here is a link to a newer version of Children of Solarus rather than the old one in this post

I didn't add anything to main.lua so that may be part of the problem. I kept the same folder structure to save changing paths in the scripts and copied across -

scripts/teletransporter_meta (although i don't think this is required so could be commented out in the scripts?)
scripts/weather/hail, rain, snow and weather_manager
sprites/weather/rain and snow.png and dat

I also made sure that my scripts/multi_events wasn't missing anything from the Children of Solarus scripts/multi_events one (which it wasn't)

Then in the map.lua file of the map where you want the weather to appear you have to add

Code: [Select]
function map:on_started()

    game:set_world_rain_mode("your_world", "storm") or


If you have a look at the snow, rain or hail manager scripts they all have examples of how to get the effect you are after.

But only do one effect.

I hope that helps.
Your scripts / Re: New rain script
« Last post by Svenibu on February 23, 2021, 08:16:49 PM »
Hi PeterB,

i have the Script whether_manager, hail_manager, rain_manager, snow_manager.

i have testet require("scripts/weather/weather_manager.lua") in main.lua and in my quest_manager.lua.

In the map script i call in the function map:on_started game:set_world_rain_mode("outside_world", "rain") the name of my map is set a world is: outside_world

I have print("rain is loaded") in the weather_manager and the same in the rain_manager to test the script is loaded.

in the Console I geht no error.

Your scripts / Re: New rain script
« Last post by PeterB on February 21, 2021, 08:15:13 AM »

I assume you added the rain_manger script to your scripts as well?

Also does your map have the world as outside_world?


Your scripts / Magic Mirror (ALTTP) warp script
« Last post by PeterB on February 21, 2021, 08:10:27 AM »
Hi Guys,

Just thought I would share my script for my Magic Mirror item.

It allows you to transport between maps as in ALTTP.

Hopefully it should be self explanatory but if not please let me know.


Code: [Select]
-- Allows you to travel from Dark world maps to Light world maps
-- Maps need to have the same name or you need to work out how to
-- change to new map. My maps have the same world layout so you can
-- go to the same place/co-ordinates. The map id's however are slightly
-- different, i.e. dark_world/castle versus light_world/castle. Hence the
-- string.sub 11 characters to remove dark_world and add light_world
-- back in the teleport statement.

local item = ...
local game = item:get_game()
function item:on_started()

function item:on_using()
  local hero = game:get_hero()
  local map = item:get_map()
  local map_id = map:get_id()
  if map:get_world() == "dark_world" then -- go from dark_world back to light_world
    new_map = string.sub(map_id, 11)
    -- Teleport."warp")
    hero:teleport("light_world" .. new_map .. "", "_same", "fade") -- takes you to same position on light_world map

Your scripts / Re: New rain script
« Last post by Svenibu on February 19, 2021, 10:52:10 PM »
Hi Dirandor

can you help me with the weather script?

I have the script and the sprites imported.

I add the script weather_manager in my quest_manager script.

In the script from my map i have
add in the  the function map:on_started()

it doesn't rain in the testgame
Your projects / Re: Ocean's Heart
« Last post by Max on February 17, 2021, 12:45:12 AM »
It's not a stupid question! It just wouldn't work for controllers, which only have 4 face buttons, and I like to keep functional parity between input methods. Feel free to mod your copy to use that though, haha : )
Your projects / Re: Ocean's Heart
« Last post by Dianthus on February 16, 2021, 08:53:59 PM »
Hi Max!

Just a question regarding options. Have you considered adding an option for an extra button for items? I think it could work.
I naturally rest my fingers on z, x, c ,v with my left hand and have my right hand on the arrows.

Currently in Oceans Heart c is sword and x,v are items.. maybe z could be used for an item slot too? Or are there some other function I am forgetting that i need to have my pinky finger on, lol..

Just ignore it if its a stupid question.
Pages: 1 [2] 3 4 ... 10