Author Topic: Bonjour j'ai un petit problème  (Read 423 times)

Raytarra

  • Newbie
  • *
  • Posts: 3
    • View Profile
Bonjour j'ai un petit problème
« on: April 12, 2017, 03:03:32 pm »
Je suis en pleine création d'un jeux zelda problème:Error: In on_finished: [string "main.lua"]:21: attempt to index upvalue 'game_manager' (a boolean value)

Jerelink

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Bonjour j'ai un petit problème
« Reply #1 on: April 12, 2017, 06:13:10 pm »
Bonjour, pour que les membres de ce forum puissent t'aider au mieux il nous faudrait plus de détails.
Peux-tu nous joindre ton script "main.lua" pour commencer ?

Raytarra

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Bonjour j'ai un petit problème
« Reply #2 on: April 12, 2017, 09:11:57 pm »
ok

voila mon Lua :
-- This is the main Lua script of your project.
-- You will probably make a title screen and then start a game.
-- See the Lua API! http://www.solarus-games.org/doc/latest

require("scripts/features")
local game_manager = require("scripts/game_manager")

-- This function is called when Solarus starts.
function sol.main:on_started()

  -- Setting a language is useful to display text and dialogs.
  -- sol.language.set_language("en")

  local solarus_logo = require("scripts/menus/solarus_logo")

  -- Show the Solarus logo initially.
  sol.menu.start(self, solarus_logo)

  -- Start the game when the Solarus logo menu is finished.
  solarus_logo.on_finished = function()
    game_manager:start_game("save1.dat")
sol.language.set_language("fr")
  end

end

-- Event called when the player pressed a keyboard key.
function sol.main:on_key_pressed(key, modifiers)

  local handled = false
  if key == "f5" then
    -- F5: change the video mode.
    sol.video.switch_mode()
    handled = true
  elseif key == "f11" or
    (key == "return" and (modifiers.alt or modifiers.control)) then
    -- F11 or Ctrl + return or Alt + Return: switch fullscreen.
    sol.video.set_fullscreen(not sol.video.is_fullscreen())
    handled = true
  elseif key == "f4" and modifiers.alt then
    -- Alt + F4: stop the program.
    sol.main.exit()
    handled = true
  elseif key == "escape" and sol.main.game == nil then
    -- Escape in title screens: stop the program.
    sol.main.exit()
    handled = true
  end

  return handled
end
 



Raytarra

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Bonjour j'ai un petit problème
« Reply #3 on: April 12, 2017, 09:12:23 pm »
sinon le dossier et a la fin

Diarandor

  • Hero Member
  • *****
  • Posts: 781
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Bonjour j'ai un petit problème
« Reply #4 on: April 13, 2017, 01:21:57 pm »
The error message is completely clear: your game_manager variable has a boolean value and not a list with functions. It makes no sense to call "game_manager:start_game" if game_manager is a boolean. You are doing something wrong.

You should first study the code of scripts that work until you understand all. Never start by modifying a code that you do not fully understand.

MetalZelda

  • Hero Member
  • *****
  • Posts: 508
    • View Profile
Re: Bonjour j'ai un petit problème
« Reply #5 on: April 15, 2017, 02:04:53 pm »
Ca a a voir avec le script game_manager a tout les coups, envoi le script voir