[RESOLU] Besoin d'aide pour le dialogue de début

Started by Delltus, December 07, 2017, 03:26:43 PM

Previous topic - Next topic
December 07, 2017, 03:26:43 PM Last Edit: December 08, 2017, 12:40:48 AM by Delltus
Bonjour j'ai un petit soucis que j'arrive pas à régler, je souhaiterais afficher un message via script mais une erreur apparaît qui est la suivante.
le script viens du projet "Zelda-Roth".

L'erreur en question:
https://gyazo.com/d0a91c3f9f4252c6adc769027aa9b671

Je pense savoir d'ou viens le problème après avoir chercher, mais j'arrive pas à le corriger, si je mais cette ligne en commentaire pas de message d'erreur.
game:start_dialog("link_house.zelda_message", function()

Avec le ligne en commentaire:
https://gyazo.com/fc13845fc51b371895c90fc3fdbbeb6e

Languages:
https://gyazo.com/048ff3a8168cfcbafd4613b7e69c1159

Voici le script de la map en question:
local map = ...
local game = map:get_game()

local night_overlay = sol.surface.create(map:get_size())
local alpha = 192
night_overlay:fill_color({0, 0, 64, alpha})

function map:on_started(destination)

  if destination ~= from_intro then
    night_overlay:clear()  -- No night.
    return
  end

  -- The intro scene is playing.
  -- Let the hero sleep for two second.
  game:set_pause_allowed(false)
  snores:get_sprite():set_ignore_suspend(true)
  bed:get_sprite():set_animation("hero_sleeping")
  hero:freeze()
  hero:set_visible(false)
  sol.timer.start(map, 2000, function()
    -- Show Zelda's message.
    game:start_dialog("link_house.zelda_message", function(answer)
    sol.timer.start(map, 1000, function()
        -- Wake up.
        snores:remove()
        bed:get_sprite():set_animation("hero_waking")
        sol.timer.start(map, 500, function()
          -- Jump from the bed.
          hero:set_visible(true)
          hero:start_jumping(0, 24, true)
          game:set_pause_allowed(true)
          game:set_hud_enabled(true)
          bed:get_sprite():set_animation("empty_open")
          sol.audio.play_sound("hero_lands")

          -- Start the savegame from outside the bed next time.
          game:set_starting_location(map:get_id(), "from_savegame")

          -- Make the sun rise.
          sol.timer.start(map, 20, function()
            alpha = alpha - 1
            if alpha <= 0 then
              alpha = 0
            end
            night_overlay:clear()
            night_overlay:fill_color({0, 0, 64, alpha})

            -- Continue the timer if there is still night.
            return alpha > 0
          end)

        end)
      end)
    end)
end

-- Show the night overlay.
function map:on_draw(dst_surface)

  night_overlay:draw(dst_surface)
end


Je vous remercie d'avance pour votre aide je débute en programmation lua et j'apprend à utiliser Solarus pour mon apprentissage en essayant de comprendre la mécanique des autres projet déjà crée  :).

Comme le dit le message d'erreur, tu as une erreur de syntaxe ligne 60 à cause d'une parenthèse.

Pour info, tu peux copier-coller les erreurs qui s'affichent dans le terminal (pas besoin de faire des captures d'écran donc).

Quote from: Christopho on December 07, 2017, 03:36:40 PM
Comme le dit le message d'erreur, tu as une erreur de syntaxe ligne 60 à cause d'une parenthèse.

Pour info, tu peux copier-coller les erreurs qui s'affichent dans le terminal (pas besoin de faire des captures d'écran donc).

Merci pour ton message, j'ai corriger le soucis mais il y a une autre erreur qui est venu

https://gyazo.com/14ebe2cb100672e79aad265833379f93

game:start_dialog("link_house.zelda_message", function()

Est-ce que tu peux copier-coller les erreurs qui s'affichent dans le terminal au lieu de faire des captures d'écran stp ?

Quote from: Christopho on December 07, 2017, 04:26:51 PM
Est-ce que tu peux copier-coller les erreurs qui s'affichent dans le terminal au lieu de faire des captures d'écran stp ?

QuoteInfo: Solarus 1.5.3
Info: Opening quest 'C:/Users/Florian/Desktop/Projet Zelda'
Info: Sound volume: 100
Info: Music volume: 100
Info: Joypad support enabled: true
Info: 2D acceleration: yes
Info: Turbo mode: no
Info: Video mode: normal
Info: LuaJIT: yes (LuaJIT 2.0.3)
Info: Lua console: yes
Info: Simulation started
Error: In timer callback: [string "maps/Depart.lua"]:25: bad argument #1 to start_dialog (No such dialog: 'link_house.zelda_message')

As the error says, your dialog with id "link_house.zelda_message" is missing.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

Quote from: Diarandor on December 07, 2017, 07:41:01 PM
As the error says, your dialog with id "link_house.zelda_message" is missing.

https://gyazo.com/14ebe2cb100672e79aad265833379f93

elle est bien présente c'est pour ça que je comprend pas le soucis.


As Chris says, you may have forgotten to activate a language, or maybe you have activated English instead of French (which does not exist in your project).
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

Oui c'est surement ça vue qu'ils y avais aucune langue j'ai juste copier coller le dossier, la langue ce configure ou ?

It can be done in some of your initialization scripts, like the scripts main.lua or game_manager.lua, or other similar script.
Check the API to know how to do it: http://www.solarus-games.org/doc/1.5/lua_api_language.html
In your case, this line should be enough for now:
Code (Lua) Select
sol.language.set_language("fr")
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."