Menu

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.

Show posts Menu

Messages - ponderitus

#31
Development / Re: combos...again
February 12, 2019, 10:09:34 AM
ok cool that sounds like a good way to go about it, waaaaaaaaay to advanced for what i can do at the moment though so ill look into it later when I'm hopefully more adept
#32
Development / Re: video mode
February 12, 2019, 10:06:16 AM
wow, that fixed everything. thanks for all your help over the last few days. As for the translating I dont really know how id do that, I learnt all that i know from Christopho's tutorials a few years back and then reading scripts. I wish they had never finished there's still so so much to learn. As for now though the game can switch between English and French no problem so maybe its ok already? (French probably makes no sense as i cant speak it lol)
#33
Development / Re: combos...again
February 11, 2019, 03:37:26 PM
I was thinking about making a punch then kick just so that punch isnt constantly being spammed, i was trying to make Dbz characters and even though it looks pretty cool them spamming punching, it just got me thinking, this is where i got to with them...

https://www.youtube.com/watch?v=wREFt_7-HqE&feature=youtu.be
#34
Development / combos...again
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?
#35
Development / Re: video mode
February 11, 2019, 09:01:58 AM
yes that worked for switching it, now when i open the pause_options after changing shader, or starting the game with one active i get this

Info: Shader: 'hq2x'
Error: In on_started: scripts/menus/pause_options.lua:53: bad argument #1 to create (Bad field 'text' (string expected, got shader))
stack traceback:
[C]: at 0x01774540
[C]: in function 'create'
scripts/menus/pause_options.lua:53: in function <scripts/menus/pause_options.lua:32>
[C]: in function 'start'
scripts/menus/pause_submenu.lua:126: in function 'next_submenu'
scripts/menus/pause_map.lua:100: in function <scripts/menus/pause_map.lua:87>

this is 32-60 of pause_options
function options_submenu:on_started()

  submenu.on_started(self)

  local font, font_size = language_manager:get_menu_font()
  local width, height = sol.video.get_quest_size()
  local center_x, center_y = width / 2, height / 2

  self.column_color = { 255, 255, 255}
  self.text_color = { 115, 59, 22 }

  self.video_mode_label_text = sol.text_surface.create{
    horizontal_alignment = "left",
    vertical_alignment = "top",
    font = font,
    font_size = font_size,
    text_key = "selection_menu.options.video_mode",
    color = self.text_color,
  }
  self.video_mode_label_text:set_xy(center_x - 50, center_y - 58)

    self.video_mode_text = sol.text_surface.create{ -------------------------------------------------line 53
    horizontal_alignment = "right",
    vertical_alignment = "top",
    font = font,
    font_size = font_size,
    text = sol.video.get_shader(),
    color = self.text_color,
  }


submenu

  local submenu_index = self.game:get_value("pause_last_submenu")
  submenu_index = (submenu_index % #submenus) + 1
  self.game:set_value("pause_last_submenu", submenu_index)
  sol.menu.start(self.game.pause_menu, submenus[submenu_index], false)


pause_map
  elseif command == "right" then
    self:next_submenu()
    handled = true


I know this option doesnt even work the same anymore, but it would be pretty cool to be able to flick the game into grayscale at the touch of a button, go even more retro and feel like you're on the gameboy  ;D
#36
Development / Re: video mode
February 08, 2019, 04:43:28 PM
i have no idea, this stuff is way to advanced for me to know whats happening, it was a miracle that i got it to work on 1.5 so when it broke changing to 1.6 i died a little inside.

id happily just take out the option to change the "graphics" like i have in the save_game menu. and just start the game in HQ2X. but i cant seem to take it out the options_menu or have the options_menu run correctly without it in
#37
Development / Re: video mode
February 08, 2019, 04:23:44 PM
yeah thanks, that worked for starting the game but doesnt work with the pause menu, im getting all this now

Error: In on_started: scripts/menus/pause_options.lua:27: bad argument #1 to create (Bad field 'text' (string expected, got shader))
stack traceback:
[C]: at 0x01774540
[C]: in function 'create'
scripts/menus/pause_options.lua:27: in function <scripts/menus/pause_options.lua:6>
[C]: in function 'start'
scripts/menus/pause_submenu.lua:126: in function 'next_submenu'
scripts/menus/pause_map.lua:100: in function <scripts/menus/pause_map.lua:87>
Error: In on_draw: scripts/menus/pause_options.lua:176: attempt to index field 'cursor_sprite' (a nil value)
stack traceback:
[C]: in function '__index'
scripts/menus/pause_options.lua:176: in function <scripts/menus/pause_options.lua:170>
Error: In on_draw: scripts/menus/pause_options.lua:176: attempt to index field 'cursor_sprite' (a nil value)
stack traceback:
[C]: in function '__index'
scripts/menus/pause_options.lua:176: in function <scripts/menus/pause_options.lua:170>


this second error errors about 100 times but i didnt want to copy it all in.
#38
Development / Re: video mode
February 07, 2019, 02:40:15 PM
yeah its in there,  along with the grayscale, 6xbrx and sepia, with the hq2x.frag.glsl,

as in, it was there beforehand so is not the fix
#39
Development / video mode
February 07, 2019, 09:51:14 AM
hey, i used to run this at the start of game set the video mode.
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 :-
-- 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
      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 :-
      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.
#40
Development / Re: help with 1.6
February 07, 2019, 12:54:38 AM
Ooh awesome thanks for the reply, I'll be looking at that 1st thing in the morning. Cant wait to get back into it all, dont know why i stopped tbh. Thanks for bringing out 1.6 i saw your vid on youtube and was instantly back

Got home, works perfectly. Thanks once again Lord Christopho
#41
Development / Re: help with 1.6
February 06, 2019, 05:09:42 PM
Hey Max, glad you came through, I've been keeping my eye on Oceans Heart. It's looking better and better each time i see it, I loved the enemy that runs away from you that you made, i see your graphics are included in the demo art as well, fair play.

Here's my Hud script, im pretty sure i ripped it from one of the solarus made games and then adapted it to work for me

-- Script that creates a head-up display for a game.

-- Usage:
-- require("scripts/hud/hud")

require("scripts/multi_events")
local hud_config = require("scripts/hud/hud_config")

-- Creates and runs a HUD for the specified game.
local function initialize_hud_features(game)

  if game.set_hud_enabled ~= nil then
    -- Already done.
    game:set_hud_enabled(true)
    return
  end

  -- Set up the HUD.
  local hud = {
    enabled = false,
    elements = {},
    showing_dialog = false,
    top_left_opacity = 255,
    custom_command_effects = {},
  }

  local item_icons = {}
  local action_icon
  local attack_icon

  function game:get_hud()
    return hud
  end

  -- Returns whether the HUD is currently shown.
  function game:is_hud_enabled()
    return hud:is_enabled()
  end

  -- Enables or disables the HUD.
  function game:set_hud_enabled(enable)
    return hud:set_enabled(enable)
  end

  function game:get_custom_command_effect(command)

    return hud.custom_command_effects[command]
  end

  -- Make the action (or attack) icon of the HUD show something else than the
  -- built-in effect or the action (or attack) command.
  -- You are responsible to override the command if you don't want the built-in
  -- effect to be performed.
  -- Set the effect to nil to show the built-in effect again.
  function game:set_custom_command_effect(command, effect)

    hud.custom_command_effects[command] = effect
  end

  -- Destroys the HUD.
  function hud:quit()

    if hud:is_enabled() then
      -- Stop all HUD elements.
      hud:set_enabled(false)
    end
  end

  -- Call this function to notify the HUD that the current map has changed.
  local function hud_on_map_changed(game, map)

    if hud:is_enabled() then
      for _, menu in ipairs(hud.elements) do
        if menu.on_map_changed ~= nil then
          menu:on_map_changed(map)
        end
      end
    end
  end

  -- Call this function to notify the HUD that the game was just paused.
  local function hud_on_paused(game)

    if hud:is_enabled() then
      for _, menu in ipairs(hud.elements) do
        if menu.on_paused ~= nil then
          menu:on_paused()
        end
      end
    end
  end

  -- Call this function to notify the HUD that the game was just unpaused.
  local function hud_on_unpaused(game)

    if hud:is_enabled() then
      for _, menu in ipairs(hud.elements) do
        if menu.on_unpaused ~= nil then
          menu:on_unpaused()
        end
      end
    end
  end

  -- Called periodically to change the transparency or position of icons.
  local function check_hud()

    local map = game:get_map()
    if map ~= nil then
      -- If the hero is below the top-left icons, make them semi-transparent.
      local hero = map:get_entity("hero")
      local hero_x, hero_y = hero:get_position()
      local camera_x, camera_y = map:get_camera():get_position()
      local x = hero_x - camera_x
      local y = hero_y - camera_y
      local opacity = nil

      if hud.top_left_opacity == 255
        and not game:is_suspended()
        and x < 88
        and y < 80 then
        opacity = 96
      elseif hud.top_left_opacity == 96
        and (game:is_suspended()
        or x >= 88
        or y >= 80) then
        opacity = 255
      end

      if opacity ~= nil then
        hud.top_left_opacity = opacity
        for i, element_config in ipairs(hud_config) do
          if element_config.x >= 0 and element_config.x < 72 and
              element_config.y >= 0 and element_config.y < 64 then
            hud.elements[i]:get_surface():set_opacity(opacity)
          end
        end
      end

      -- During a dialog, move the action icon and the sword icon.
      if not hud.showing_dialog and
        game:is_dialog_enabled() then
        hud.showing_dialog = true
        action_icon:set_dst_position(0, 54)
        attack_icon:set_dst_position(0, 29)
      elseif hud.showing_dialog and
        not game:is_dialog_enabled() then
        hud.showing_dialog = false
        action_icon:set_dst_position(26, 51)
        attack_icon:set_dst_position(13, 29)
      end
    end

    return true  -- Repeat the timer.
  end

  -- Returns whether the HUD is currently enabled.
  function hud:is_enabled()
    return hud.enabled
  end

  -- Enables or disables the HUD.
  function hud:set_enabled(enabled)

    if enabled ~= hud.enabled then
      hud.enabled = enabled

      for _, menu in ipairs(hud.elements) do
        if enabled then
          -- Start each HUD element.
          sol.menu.start(game, menu)
        else
          -- Stop each HUD element.
          sol.menu.stop(menu)
        end
      end

      if enabled then
        sol.timer.start(hud, 50, check_hud)
      end
    end
  end

  -- Changes the opacity of an item icon.
  function hud:set_item_icon_opacity(item_index, opacity)
    item_icons[item_index].get_surface():set_opacity(opacity)
  end

  for _, element_config in ipairs(hud_config) do
    local element_builder = require(element_config.menu_script)
    local element = element_builder:new(game, element_config)
    if element.set_dst_position ~= nil then
      -- Compatibility with old HUD element scripts
      -- whose new() method don't take a config parameter.
      element:set_dst_position(element_config.x, element_config.y)
    end
    hud.elements[#hud.elements + 1] = element

    if element_config.menu_script == "scripts/hud/item_icon" then
      item_icons[element_config.slot] = element
    elseif element_config.menu_script == "scripts/hud/action_icon" then
      action_icon = element
    elseif element_config.menu_script == "scripts/hud/attack_icon" then
      attack_icon = element
    end
  end

  game:register_event("on_map_changed", hud_on_map_changed)
  game:register_event("on_paused", hud_on_paused)
  game:register_event("on_unpaused", hud_on_unpaused)

  -- Start the HUD.
  hud:set_enabled(true)
end

-- Set up the HUD features on any game that starts.
local game_meta = sol.main.get_metatable("game")
game_meta:register_event("on_started", initialize_hud_features)

return true
#42
Development / help with 1.6
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?
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

#43
Your scripts / Re: Deku/Turret Type Enemy
May 04, 2018, 02:31:22 AM
Hey, just thought I'd show you what I made with your code, I have made a wake_up animation for him which looks pretty cool but couldn't work out how to put a timer on the waking part so that it would show so I just left it out. seems to instantly go from asleep to awake...and if you adjust the timer in place already it goes mental for a moment and repeats. Still looks ok without it I think. Was going to make the nuts it shoots rebound and be able to kill him as well. I know the triple Octorok code has the ability to do that so I'll have a little look at that and see how it looks/works plus Agahnim also has that "ability" so there's at least 2 scripts for me to read through, hopefully I can figure it out.

https://www.youtube.com/watch?v=F-kEPrG9wKQ


Thanks or making this again. Really appreciate the effort...I'm sure someone else must be wanting this type of enemy as well. Since this video I've also added a wall on top of the enemy that removes when the enemy dies to stop being able to traverse whilst hurt and to stop being hurt (but not damaged) if you touch him. only works on the Y axis but meh, it's half the battle.

Just read you hope to have a demo next week, looking forward to that!
#44
Your scripts / Re: Deku/Turret Type Enemy
May 03, 2018, 04:14:42 AM
you know what, it works perfectly it was just me being an idiot as usual. That's awesome
#45
Your scripts / Re: Deku/Turret Type Enemy
May 02, 2018, 03:20:52 AM
This looks great man, only just seen it I've been stuck at work. I'll defo try to input this into my project. Still think you should make it into one of your mandrakes. maybe I'll try that.

Is the smoke effect coming from the chimney new? haven't noticed it before now, its nice.


Just tried to add it. I get this error

Error: In timer callback: [string "enemies/lib/turret.lua"]:281: attempt to call method 'go' (a nil value)

any idea how to fix that?