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]
1
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?

2
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.
 sol.video.set_mode("hq2x")

but now in 1.6 i get this :-
"Warning: The function sol.video.set_mode() is deprecated since Solarus 1.6. Use sol.video.set_shader() instead."

but when i change this :-
Code: [Select]
-- This function is called when Solarus starts.
function sol.main:on_started()
-- Set Video Mode.
 sol.video.set_shader("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.
        sol.video.switch_mode()
        self.video_mode_text:set_text(sol.video.get_mode())
      else

Warning: The function sol.video.switch_mode() is deprecated since Solarus 1.6. Use sol.video.set_shader() instead.
Warning: The function sol.video.get_mode() is deprecated since Solarus 1.6. Use sol.video.get_shader() instead.

but when i change that to :-
Code: [Select]
      if self.cursor_position == 1 then
        -- Change the video mode.
--        sol.video.switch_mode()
sol.video.set_shader()
    --    self.video_mode_text:set_text(sol.video.get_mode())
self.video_mode_text:set_text(sol.video.get_shader())
      else

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.

3
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

4
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()
  sol.audio.play_sound("chest_small")
end

5
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
  girl:set_visible(true)
  fake_girl:set_visible(false)
  else
  girl:set_visible(false)
  fake_girl:set_visible(true)

local npc_movement_2 = sol.movement.create("target")
  npc_movement_2:set_speed(64)
--  npc_movement_2:set_smooth(true)
  npc_movement_2:set_ignore_obstacles(true)
  npc_movement_2:set_target(girl)
  npc_movement_2:set_ignore_obstacles(true)
  npc_movement_2:start(fake_girl, function()
  girl:set_visible(true)
  fake_girl:set_visible(false)
  game:start_dialog("girl.down_here")
  game:set_value("open_walk", true)
end)
end

function girl:on_interaction()
    game:start_dialog("girl.hello")
end

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

6
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
   worker_npc:remove()
   else
      game:start_dialog("meeting.1")
      hero:freeze()
      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:set_ignore_obstacles(true)
      worker_npc:is_traversable()
      path_movement:set_speed(64)
      path_movement:start(worker_npc, function()
      worker_npc:remove()
      game:set_value("meeting_quest_1", true)
      hero:unfreeze() 
      end)
   end
end

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]
map:on_started(function()
if game:get_value("meeting_quest_1") then
worker_npc:remove()

7
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)
  end

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

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

 if game:get_value("sword_search_quest_started") then
    game:start_dialog("Guy3.has_sword")
    else
         game:start_dialog("Guy3.search")
  end
end

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

If anyone can help I'd appreciate it

8
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.

9
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

10
Development / Inventory
« on: March 03, 2017, 09:00:17 pm »
Can anyone explain how to get a pause menu (inventory and such) to work?

I'm only trying to get the one that Christopho uses in his French tutorial, I cant understand French so I'm just following what he does on his screen. I would be happy with the ALTTP inventory. I just need something which will enable me to switch between items.

Any help is greatly appreciated.

11
Development / [SOLVED] Help please? dialog and water
« on: February 15, 2017, 03:02:28 am »
Could anyone help please I've got a couple issues since I've updated to 1.5.2

1. I can't get any dialog to load even though it is 100% there
Eg
Error: Missing treasure dialog '_treasure.flippers.1'

2. On collision with water (without flippers) the hero doesn't jump anymore he just drowns. He used on jump on collision with water (or lava)

Any help will be greatly appreciated

Pages: [1]