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.

Topics - ponderitus

Pages: [1] 2
Development / how do you save a number?
« on: March 29, 2020, 11:21:12 am »
I've made a little script/ fishing game where your fish wins you prizes...everything works fine until i save and reopen the file...its basically:

Code: [Select]
if size <= 6 then
elseif size >
win = size
size reset to 0
and then theres a seperate npc with a dialog stating the win number:-
Code: [Select]
game:start_dialog("", win, function()

now if i move maps and come back in it all works fine...but if i save the game and return...the value of "win" is set back to nil, how do i get the value of win to save?

or do i need to make save variables for each
Code: [Select]
if win = 1 then
 game:set_value("win_is_1", true)
else if win 2 then.....

and then write out a dialog for each outcome?

Development / does anyone know what this means?
« on: March 17, 2020, 05:45:06 pm »
When i close the game on certain maps, this pops up...

Code: [Select]
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB

does anyone know what it means?

Development / how to make a 'code/password'
« on: September 21, 2019, 01:57:38 am »
Hey Guys, I was wondering how to make a sort of code or password, as in enemy must be killed in a certain order to open a door/make a chest that if they are killed in the right order then x will happen but if the wrong order then everything is reset....

where would i start with this?

so that (1,2,3) opens the door but all other variants eg, (3,2,1) (2,1,3) ect would reset?

literally stuck at the start with this one...

would i have to make a bunch of save variables for each on_killed? depending on which have been killed before it?

Development / :on_interaction_item(item_used)
« on: September 06, 2019, 05:35:02 pm »
I was wondering if you can make this item specific? it seems to activate if any item is

Code: [Select]
function custom_sensor_1:on_interaction_item(boomerang)"secret")

function npc_1:on_interaction_item(boomerang)"secret")

this would be activated if i used a bow or any item at all.

is there a different way to have something happen when an certain item is used in a specific place? maybe im looking in the wrong place?

Development / Seach for an entity?
« on: August 09, 2019, 11:13:20 am »
Hey, long time. I was working on an item the other day and wondered if there is a way to check for entities on the map on use..I was trying to make something that would freeze an enemy if it exists

Code: [Select]
function item:on_using()
  if entity type enemy then
    --function of item, function()
    --function of item

function item:check_enemy()
--check map for enemies

Development / stop_dialog
« on: March 07, 2019, 09:28:28 pm »
hey, how do you get a dialog box to close itself rather than having to have an action pressed? is this possible? Id only want to use this in "cutscenes" and such, not in regular interactions with npc's

Code: [Select]
game:start_dialog("this_needs_interupting", function()
  sol.timer.start(map, 1000, function()

according to the documentation this is possible but i cant seem to make it work, would it also need a different function if the dialog was more than 3 lines? (not a problem to make things 3 lines if dialogs can be "auto closed")

Development / combos...again
« on: February 11, 2019, 09:10:11 am »
I've been thinking about combo's again like many other before and i was wondering whether its possible to have one item call another within a timer to kind of...pretend its a combo

eg... 'item A' on use
       create timer, if 'item A' used again within timer then
        use 'item B'

would this be possible?
is this a stupid way to do it?
is there a better way?

Development / video mode
« on: February 07, 2019, 09:51:14 am »
hey, i used to run this at the start of game set the video mode.
Code: [Select]
function sol.main:on_started()
-- Set Video Mode."hq2x")

but now in 1.6 i get this :-
"Warning: The function is deprecated since Solarus 1.6. Use instead."

but when i change this :-
Code: [Select]
-- This function is called when Solarus starts.
function sol.main:on_started()
-- Set Video Mode."hq2x")

i now get this :-
"Error: In on_started: main.lua:15: bad argument #2 to set_shader (shader or nil expected, got no value)
stack traceback:
[C]: at 0x01a54540
[C]: in function 'set_shader'
main.lua:15: in function <main.lua:13>"

I have the same issue in options_menu
Code: [Select]
      if self.cursor_position == 1 then
        -- Change the video mode.

Warning: The function is deprecated since Solarus 1.6. Use instead.
Warning: The function is deprecated since Solarus 1.6. Use instead.

but when i change that to :-
Code: [Select]
      if self.cursor_position == 1 then
        -- Change the video mode.
    --    self.video_mode_text:set_text(

i now get this error :-
"Error: In on_command_pressed: scripts/menus/pause_options.lua:229: bad argument #2 to set_shader (shader or nil expected, got no value)
stack traceback:
[C]: at 0x018d4540
[C]: in function 'set_shader'
scripts/menus/pause_options.lua:229: in function <scripts/menus/pause_options.lua:200>"

I looked at the scripts for the development games and on github and they have the same script in pause_options.

Development / help with 1.6
« on: February 06, 2019, 02:09:04 pm »
Hey, I've been away for the longest time but the 1.6 update piqued my interest again. anyway i cant seem to get rid of this error message since updating, can anyone point me in the right path?
Code: [Select]
Info: Simulation started
Error: bad argument #1 to sol.timer.start (game, item, map, entity, menu or sol.main expected, got table), will use a default context instead
stack traceback:
[C]: at 0x018a4540
[C]: in function 'start'
scripts/hud/hud.lua:179: in function 'set_enabled'
scripts/hud/hud.lua:213: in function 'callback'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function <scripts/multi_events.lua:40>
(Thread 0x9f301c0)
Info: Simulation finished

Development / entity sounds
« on: May 13, 2017, 07:31:09 pm »
Does anyone know where the code is which selects the sounds entities make? I want to change the noise the chest makes when opening, I know how to change it for a chest on a map (as below), but i wanted to change all the sounds from the Alttp ones, like I also want to change the noise a block makes when pushed and so on.

function chest:on_opened()"chest_small")

Development / Script working part of the time
« on: May 12, 2017, 06:16:53 pm »
Hey, I've tried to make a simple npc script, but for some reason it only seems to work half the time....i can load the map and it will work....then literally close and re-open the console and it wont work anymore...then next time it might. It seems like it works about 20% of the time, can anyone tell me the reason for this? Just trying to make her walk at the 1st time on the map up to her point she will be at for the rest of the game and freeze the hero until she is there and has spoken her initial dialog, its the interaction bit at the end which seems to be failing i should mention

Code: ( lua) [Select]
local map = ...
local game = map:get_game()
local hero = map:get_hero()

if game:get_value("open_walk") then

local npc_movement_2 = sol.movement.create("target")
--  npc_movement_2:set_smooth(true)
  npc_movement_2:start(fake_girl, function()
  game:set_value("open_walk", true)

function girl:on_interaction()

I also wanted to make the hero freeze on map start until this quest but I haven't been able to make that function yet, i know its hero:freeze() then hero:unfreeze()

I moved the end at line 24 to 29 and that seemed to help a little but it's still failing about 60% of the time

Development / [Solved ]Trying to make an NPC disappear
« on: April 30, 2017, 02:02:35 am »
Hi guys, I've been trying to make a sensor which on activated a dialog will load from an NPC who will then walk off and vanish, I've tried to make it a save game variable so that the sensor and the NPC are gone forever after this. I can't seem to get my NPC to disappear when the map reloads, I realize the below will make him disappear when the sensor is activated again (which is what it is doing). Can anyone show me how to make it do what I need it to do. I tried lots of things but I can't seem to get it to work

Code: ( lua) [Select]
local meeting_quest_1 = false

function meeting_sensor:on_activated()
   if game:get_value("meeting_quest_1") then
      local path_movement = sol.movement.create("path")
      path_movement:set_path({ 2, 2, 2, 2, 2, 1, 1, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0 })
      path_movement:start(worker_npc, function()
      game:set_value("meeting_quest_1", true)

I kept getting these errors when i tried to get it working outside the sensor:on_activated
Error: attempt to index global 'worker_npc' (a nil value)
Error: attempt to index global 'meeting_sensor' (a nil value)
but as those are names of entities on my map...isnt that enough to use them just as : worker_npc:remove() ?

as in
Code: ( lua) [Select]
if game:get_value("meeting_quest_1") then

Development / [Solved] Trying to make an NPC dialog
« on: April 26, 2017, 04:00:40 am »
does anyone know how to make a dialog where the npc will respond 4 ways based on whether i have neither item, 1 of the required items or both.

none     -   need both
sword  -   need shield
shield  -   need sword
both     -   have both!

ive been able to get it so that if i have neither and then one item it works. but when i try to get both, or either, i either cant get it to work or i get 2 dialogs trying to play at the same time (need this and need both)

ive tried setting things like below, but after this i dont know where im going, or if this even right to begin with
Code: ( lua) [Select]
local shield_search_quest_started = false
local sword_search_quest_started = false
local items_search_quest_started = false

  local has_sword = game:has_item("sword")
  if has_sword then
  game:set_value("sword_search_quest_started", true)

  local has_shield = game:has_item("shield")
  if has_shield then
  game:set_value("shield_search_quest_started", true)

  local has_both = game:has_item("shield" and "sword")
  if has_both then
  game:set_value("items_search_quest_started", true)
 -- Guy3
function Guy3:on_interaction()

 if game:get_value("sword_search_quest_started") then

-- the other 2 dialogs would be
-- "Guy3.has_shield"
-- "Guy3.found"

If anyone can help I'd appreciate it

Development / [Solved] Item icons
« on: April 06, 2017, 06:30:45 am »
In languages when making a new dialog for an item, you have the properties section. Where are the icons kept/what determines what makes icon 2 a bow for example? I changed the entities/icons.png but still the old zelda icon comes up when the dialog is showing.

Development / get_variant in inventory
« on: March 16, 2017, 02:25:51 am »
Im making changes to my inventory names table and i was wondering whether it is possible to call a variant of an item from there? Could i call tunic variant 1 from there so i can also call variant 2/3 to be able to change tunic on pressed? Or would i have to just make 3 seperate tunic items? I know making the 3 seperate tunics would be easier.

Everything i have tried so far has resulted in errors

Pages: [1] 2