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 - Starlock

#106
Development / Re: Trying to change key binding
August 24, 2015, 11:41:47 PM
I'm running 1.4.4 yet still it won't work. I feel like there must be some simple syntax error that I keep glossing over but nothing appears in error.txt besides that <eof> is expected near end on line 80... This is the full code with Diarandor's code example:
Code ( lua) Select
-- Script that creates a game ready to be played.

-- Usage:
-- local game_manager = require("scripts/game_manager")
-- local game = game_manager:create("savegame_file_name")
-- game:start()

local dialog_box_manager = require("scripts/dialog_box")

local game_manager = {}

-- Sets initial values for a new savegame of this quest.
local function initialize_new_savegame(game)
  game:set_starting_location("house")
  game:set_max_money(100)
  game:set_max_life(12)
  game:set_life(game:get_max_life())
end

-- Creates a game ready to be played.
function game_manager:create(file)

  -- Create the game (but do not start it).
  local exists = sol.game.exists(file)
  local game = sol.game.load(file)
  if not exists then
    -- This is a new savegame file.
    initialize_new_savegame(game)
  end

  local dialog_box

  -- Function called when the player runs this game.
function game:on_started()
  -- Prepare the dialog box menu and the HUD.
  game:initialize_dialog_box()
  hud = hud_manager:create(game)
  pause_menu = pause_manager:create(game, exists)
  -- more code that I am using... and:
  -- Configure some joypad buttons. [Change this for a menu later!]
  game:set_command_keyboard_binding("action", "space_bar")
  game:set_command_keyboard_binding("attack", "e")
  game:set_command_keyboard_binding("item_1", "q")
  game:set_command_keyboard_binding("item_2", "w")
end

    dialog_box = dialog_box_manager:create(game)
  end

  -- Function called when the game stops.
  function game:on_finished()

    dialog_box:quit()
    dialog_box = nil
  end

  function game:on_paused()

    game:start_dialog("pause.save", function(answer)
      if answer == 2 then
        game:save()
      end
      game:set_paused(false)
    end)
  end

  local rupee_icon = sol.surface.create("hud/rupee_icon.png")
  local rupee_text = sol.text_surface.create()
  rupee_text:set_font("8_bit")

  function game:on_draw(dst_surface)

    rupee_icon:draw_region(0, 0, 12, 12, dst_surface, 10, 220)
    rupee_text:set_text(game:get_money())
    rupee_text:draw(dst_surface, 25, 225)
  end


  return game
end

return game_manager


#107
Development / Re: Trying to change key binding
August 24, 2015, 10:17:58 PM
The game is able to run again now but the code still doesn't seem to affect the keys as it still uses the c key... I might try looking in the roth source code to see if it has anything that might make this work
#108
Development / Re: Trying to change key binding
August 24, 2015, 10:01:13 PM
I tried that code and it gave me the error

Error: In on_finished: [string "scripts/game_manager.lua"]:83: bad argument #2 to set_command_keyboard_binding (string or nil expected, got string)      :-\
#109
Development / Trying to change key binding
August 24, 2015, 09:33:41 PM
I tried to change the key binding for when you attack after obtaining the sword from the c key to the e key but whenever I load the game it still remains on the c key.
The code i used was

function game:on_character_pressed(key)
if key == "e" then
game:get_command_keyboard_binding("attack")   
   end
  end
#110
Development / problem with scrolling to different maps
August 19, 2015, 10:50:25 PM
I'm trying to have the player be able to scroll between different maps but on one map it works fine but on the other the character wont appear going one way and appears on the wrong map the other way.

      ------------
     |       |        |
     |  1   |    3  |
     |       |------|
     |       |    2   |
      ------------

When going from 3 to 1 or 1 to 3 it works fine but when going from 2 to 1 the character appears at the top of 1 instead of near the middle/bottom and when going from 1 to 2 the player wont even appear. I've tried changing locations but it doesnt seem to be doing any good.
#111
Thanks that worked perfectly  :D
#112
Whenever I attempt to test my quest, all walls are able to be partially walked through from behind and stop the hero a few pixels to early when walking forward. I don't understand why this is and the tiles are all correctly sized. Am I using the wrong type of pattern or is this a bug?
#113
I was able to fix the problem it turned out to be my antivirus program that was deleting the dlls.  Thanks anyway  :)
#114
Every time I attempt to run the quest either or solarus it says an error that there is a missing .dll.For the quest editor lua51 is missing and for solarus the libmodplug-1 is missing but they appear before I run the application then they suddenly are deleted. I don't know why this is happening so could anyone please help with this?