Author Topic: Sword and Shield animation fail - Error: Missing treasure dialog  (Read 485 times)

Hawkinzon

  • Newbie
  • *
  • Posts: 10
    • View Profile
Hi,

Short description of the problem
When I load an item (e.g sword) I receive the sword and can use it, but there is no animation playing or any dialog showing up. and I also get the following error code.
Error: Missing treasure dialog: '_treasure.sword.1'

The problem is more described below this line


I have downloaded Solarus and is currently following a Zelda tutorial made by ChristophoZS on Youtube.com
I am in part 4 (link to video https://www.youtube.com/watch?v=768IFV1zBKU) of the tutorial were you create Items and treasures.

I have also downloaded the resources from ChristophoZS which contains the following:
items - This folder contains 3 LUA files (heart, shield and sword). Which all have different but pre-set codes to use
languages - This folder contains a subfolder named en which only means that the languages is for english usage.
subfolder en - The subfolder contains two other subfolders images which is empty and text which contains two DAT-files
subfolder text - The subfolder contains two DAT-files named dialogs.dat and strings.dat
dialogs.dat - This DAT-file contains the code for dialogs that should be played when a specific item is picked up. e.g sword 1 (courage sword)

Below is a example for how the code is written:

--------------------
-- Sword 1
dialog{
  id = "_treasure.sword.1",
  text = [[
You found the
Sword of Courage!

Use it to vanquish
your enemies!
]]
}
--------------------

As you can see above the code says that when Sword 1 is picked up in game a dialog (id=_treasure.sword.1) should be played and also what kind of text it should display.

I took these two folders (items and languages) and replaced them in my Quest -> data folder (As he showed in the tutorial). But there is no dialog showing up and there is also no animation played at all when i pick the sword up through, for an example, a chest. I have also tried to place the sword on the ground without success.

One thing that I should add is that the "Pick up item" sound is played when I pick the sword up.

If anyone knows what is wrong please get in touch with me, this ruins much of the gameplay.

See attachments for more informations and files

BR
Hawkinzon

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1043
    • View Profile
Re: Sword and Shield animation fail - Error: Missing treasure dialog
« Reply #1 on: January 22, 2017, 02:42:34 pm »
You have to set a language for dialogs to work. To do that, in main.lua you can just uncomment the line: sol.language.set_language("en")

PS: I will improve the error message so that it is more helpful: https://github.com/solarus-games/solarus/issues/1006
« Last Edit: January 22, 2017, 02:45:41 pm by Christopho »

Hawkinzon

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Sword and Shield animation fail - Error: Missing treasure dialog
« Reply #2 on: January 22, 2017, 07:47:19 pm »
Quote
You have to set a language for dialogs to work. To do that, in main.lua you can just uncomment the line: sol.language.set_language("en")

PS: I will improve the error message so that it is more helpful: https://github.com/solarus-games/solarus/issues/1006


Hi,

First of all, thank you for the help and thank you for a really great Tutorial!

To uncomment the line as suggested worked but I forgot that I had to add the language in the Quest engine, but otherwise it worked!! :)