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

#91
Thanks Christopho, but I continue with my first idea. Obviously, I will also use your new feature.
I manage to get this table that will fill the empty areas. For now, it's just a LUA function that I must adapt to Solarus .  ;)

LUA FUNCTION:

Code (LUA) Select
-- TEST -- WIP --

-- Function to initialize a table which will contain values (x, y , width, height) in order to draw the opposite rectangles to 'tbl' to fill a surface.
-- 'tbl' is not the new table, but the table which contains values.

local function init_opposite_table(tbl)

    -- Length of the original table
    local length = #tbl
   
    -- Clone this table in a temporary table
    local t_temp = {}
    k, v = next(tbl, nil)
    while k do
        t_temp[k] = v
        k, v = next(tbl,k)
    end
   
    -- Then, add x and y of opposite corners in this new table
    for i = 1, length do
        local l = #t_temp + 1
        t_temp[l] = {}
        t_temp[l][1] = t_temp[i][1] + t_temp[i][3]
        t_temp[l][2] = t_temp[i][2] + t_temp[i][4]
    end
   
    -- Function to initialize a simple table (for example for t_x and t_y)
    -- 'tbl' is not the new table, but the table which contains values.
    -- TODO: replace 320 and 240 by sol.video.get_window_size() in Solarus
    local function init_simple_table(tbl, key, min, max)
   
        -- Create a temporary table
        local t = {}
        -- Insert minimun and maximum values
        if min ~= nil then
            t[#t + 1] = min
          else
              t[#t + 1] = 0
        end
        if max ~= nil then
            t[#t + 1] = max
        else
            if key == 1 then
                max = 320
            elseif key == 2 then
                max =    240
            end
            t[#t + 1] = max
        end
        -- Add entries in the table
        for k in pairs(tbl) do
            t[#t + 1] = tbl[k][key]
        end
        -- Create another temporary table
        -- and delete duplicate entries
        local t_no_dup = {}; 
        for _, v in pairs(t) do
            t_no_dup[v] = v
        end
        -- Clear the first temporary table
        local t = {}
        -- Sort
        for k in pairs(t_no_dup) do
            t[#t + 1] = k
        end
        table.sort(t)
        -- Return the result
        return t
    end
   
    -- Initialize a table for x and a table for y
    local t_x = init_simple_table(t_temp, 1)
    local t_y = init_simple_table(t_temp, 2)
   
    -- Max values for x and y
    local vx_max = math.max(unpack(t_x))
    local vy_max = math.max(unpack(t_y))
   
    -- Create a temporary table
    -- Merge rectangles that are on the same line (the width is changed) when possible.
    local t_temp = {}
    for ky, vy in pairs(t_y) do
        if vy < vy_max then
            local x
            local y
            local width
            local height = t_y[ky + 1] - vy
            for kx, vx in pairs(t_x) do
                if vx < vx_max then
                    for i = 1, length do
                        if x == nil then
                            x = vx
                            y = vy
                        end
                        if vx == tbl[i][1] and vy >= tbl[i][2] and vy < (tbl[i][2] + tbl[i][4])  then
                            width = vx - x
                            if width > 0 then
                                local l = #t_temp + 1
                                t_temp[l] = {x, y , width, height, ky}
                            end                           
                            x = (tbl[i][1] + tbl[i][3])
                        end
                    end
                else
                    width = vx - x
                    local l = #t_temp + 1
                    t_temp[l] = {x, y , width, height, ky}
                end
            end
        end
    end
   
    -- Create a table from the previous temporary table
    -- Merge the rectangles which have the same x and the same width (the height is changed) when possible
    local opp_tbl = {}
    local max_n = #t_temp
    local count = 0
    for j in pairs(t_temp) do
        local height = t_temp[j][4]
        local ky = t_temp[j][5]
        local var = 1
        if     t_temp[j][5] ~= nil then
            for n = j, max_n do
                if t_temp[j][1] == t_temp[n][1] and t_temp[j][3] == t_temp[n][3] and ky ~= t_temp[n][5] then
                    if (ky + var) == t_temp[n][5] then
                        t_temp[n][5] = nil
                        var = var + 1
                        height = height + t_temp[n][4]
                    end
                end
            end
            t_temp[j][5] = nil
            count = count + 1
            opp_tbl[count] = t_temp[j]
            opp_tbl[count][4] = height
        end
    end
    return opp_tbl
end


-- Original table
local t_lights = {{108, 46, 34, 19}, {19, 212, 85, 28}, {174, 4, 86, 54}, {44, 32, 53, 166}}

-- Initialize the opposite table
local t_nolight = init_opposite_table(t_lights)




PRINT:

Code (LUA) Select

-- Print tables to test the results
print("-------- t_lights --------")
print("x", "y","w","h")
print("---------------------------")
t = t_lights
for k in pairs(t) do
    print(t[k][1], t[k][2], t[k][3], t[k][4])
end
print("-------------")
print("rectangles " .. #t_lights)
print("-------------")
print("-------- t_nolight --------")
print("x", "y","w","h")
print("---------------------------")
t = t_nolight
for k in pairs(t) do
    print(t[k][1], t[k][2], t[k][3], t[k][4])
end
print("-------------")
print("rectangles " .. #t_nolight)
print("-------------")
print("TOTAL " .. #t_lights + #t_nolight)
print("---------------------------")



RESULTS:

-------- t_lights --------
x    y    w    h
---------------------------
108    46    34    19
19    212    85    28
174    4    86    54
44    32    53    166
-------------
rectangles 4
-------------
-------- t_nolight --------
x    y    w    h
---------------------------
0    0    320    4
0    4    174    28
260    4    60    54
0    32    44    166
97    32    77    14
97    46    11    19
142    46    32    12
142    58    178    7
97    65    223    133
0    198    320    14
0    212    19    28
104    212    216    28
-------------
rectangles 12
-------------
TOTAL 16
---------------------------

Here the result in picture:

       
  • yellow rectangles = table named "t_lights" (4 rectangles)
  • black rectangles = table named "t_nolight" (12 rectangles)



Here the result if I had not optimized the function. There would be too many rectangles... :o

#92
General discussion / Re: Noob Alert!!
July 17, 2016, 03:42:47 PM
Welcome Eric C to our small but growing community! One day, Solarus will kill Rpg Maker :D . It will be a mass exodus of Rpg Maker communities to our forum :P .
lol "Noob Alert!!" I like the name of the topic. It shows that Solarus is not so easy to understand for a newbie. Solarus is a ARPG engine and RPG Maker more a TRPG engine. However, make a good ARPG project on Rpg Maker without knowing ruby and workaround/hack is difficult, but make a good ARPG project on Solarus without knowing lua a little is almost impossible.
That 's why, I say it would be nice to have also some examples with explanation on lua commands and simple functions in a topic. Then, explain how these examples can be used in a Solarus project.

Thank you Zefk, I did not know Tutorialpoint Online. It would certainly replace repl that I use for lua tests. I like the vertical split screen in repl, but Tutorialpoint Online seems to offer more options for a project.  In fact, maybe I will use both :-\ .
#93
Development / Re: Solarus 1.5 development snapshot
July 13, 2016, 01:47:52 AM
Merci Christopho!

I encountered a small problem with the last snapshot and I would like to share to the community how I solved it.
I worked on an old snapshot of Solarus v1.5 ( "solarus-1.5.0-snapshot-20151107-win32") and I wanted to use the last version (solarus-1.5.0-snapshot-20160712-win32).
Impatient as a child discovering a new toy, I started the project to test new functionalities 8) . When the map was loading, ouch!!!  :'(
Quote[Solarus]Error: Failed to load map: ...5.0-snapshot-20160712-win32/solarus/data/maps/memory.dat:1: bad argument #1 to properties (Bad field 'min_layer' (integer expected, got nil))

I think you will  not have this problem if your previous version was a v1.4 or a not too old snapshot of v1.5.
If you have that kind of error:
- Just edit your quest.dat and change 'solarus_version = "1.5"' into 'solarus_version = "1.4"'.  Of course, save  quest.dat.
- Then execute "solarus-quest-editor" to start the upgrade; your *.dat of your maps will be modify automatically.
- In your *.dat, you will see new lines in the properties:
  min_layer = 0,
  max_layer = 2,
#94
Quotetechnically those are still rectangles. You could get them in the same way you would get the yellow parts, but just imagining where the connecting lines would be between them.
Draw the biggest black rectangle you can find in the non-yellow space, and where there's an oddly shaped corner, fill it in with another separate rectangle.
==> I had the same idea but for now , I have a little trouble to think the script in its entirety.

QuoteAlso, if you're trying to paint in the empty space, you can draw on the surface before you draw whatever goes in the yellow, and draw the yellow spaces afterward, and whatever's in the yellow should be drawn over whatever you filled the surface with before...
==> My first idea is to use dynamic tiles for lights in the editor and then add black rectangles by a script. If I work with the black parts from the editor , I move mistakenly tiles ; Moreover, the mapping is more difficult and less flexible. I move anything !  >:(

QuoteIf you're doing a 'lighting' script, where yellow spaces would be lights you want to 'cut out' of the blackness, I might have to rethink how to do that.. its something I've been wanting to try too.
==> Yes I'm trying to make a lighting script for example to light/extinguish a candle on a table.

QuoteStill, if you could define your yellow blocks before they're drawn... there should be a way to replace the black area with a transparent space... by specifying an shape made of some color like 0xFFFFFF00, which is pure white, but with 0 alpha opacity...
==> It is a very good idea if it is possible with the engine. I'm going to test this.  :)

QuoteMaybe that helps maybe not. Get back to us if you come up with something that does, I'd like to see it.
Thank you for taking the time to answer me. Ok
#95
Hello,

Is it possible to get the opposite region of several regions in a surface?
In this example, there are several yellow rectangles and I would like to get the black part.

#96
Development / Re: Error message with hud
June 23, 2016, 08:15:03 PM
I checked and made many tests. Rename hud.lua to hud_old.lua. Create a new hud.lua and copy lines inside. I think your file is corrupted.
#97
Development / Re: Error message with hud
June 21, 2016, 11:53:45 PM
I would put "local hudmenu = require("menus/hud")" above "local hud" (and not at the beginniing of your script).
      -- Create the game (but do not start it).
-- blablabla

      local dialog_box
      local hudmenu = require("menus/hud")
      local hud


If it does not solve your problem, then ... :'(, are you sure the paths of your scripts?
#98
Your projects / Re: Tower Defense with Solarus
May 10, 2016, 08:07:07 PM
I knew that a tower-defense game was possible with Solarus Engine, but I did not know it was possible to display so many enemies in the same time. :o
Very promising project !
In your game, it would be nice to recover some money when you destroyed the towers.
Quote- special items ?
Yes why not, for example, to reduce the cost of towers, or to improve a fire effect or an ice effect according to a specialization.
#99
Development / Re: Diablo like health/magic?
January 31, 2016, 07:00:26 PM
+1 Diarandor.

Then Starlock must find a solution, for example with a cross-multiplication, to compare one life to the max life. 1 pixel is equal to 1 life if you have max_life = 39 (the height of the health orb), but if max life is different, 1 pixel will not represent 1 life.  You should reorganize the sprites of the picture in a 48x48 grid like this, it will help you to draw region and also to create animation.

The idea of this orb is very interesting for an old-school game.  ;)

EDIT: So interesting that I'm trying to fix and improve your script.  :P  I will give you the result tomorrow.

EDIT 2: Not exactly, tomorrow...

SEE ATTACHMENT.

Code (Lua) Select

    -- DIABLO STYLE HEALTH ORB
-- Script by Starlock from an another script (magic_bar.lua) written by Christopho.
-- Modified by froGgy.

-- v 1.0:
-- First version posted by Starlock. It was named 'life_bar'
    -- v 2.0:
-- Tested with SOLARUS version 1.5
-- Script renamed to 'health_orb'. So need changes in ../data/scripts/hud/hud.lua
-- Correction of problems to draw surfaces.
-- Adding get_pixel(l, m). See explanation below.
-- Adding animations (container_surface replaced by container_sprite), so need ../data/sprites/hud/health_orb.dat
-- and need this line 'sprite{ id = "hud/health_orb", description = "HUD: Health Orb" }' in ../data/project_db.dat
-- Adding calls to the sounds.
-- Sprites reorganized in the image. Need new ../data/sprites/hud/health_orb.png


    local health_orb = {}


-- Explanation of this local function named 'get_pixel(l, m)'
-- 39 is orb height. So if you change the orb size, replace 39 and 38 by your own values. Idem in rebuild_surface()
-- 1 pixel is equal to 1 life if you have max_life = 39, but if max_life is different, 1 pixel will not represent anymore 1 life,
-- that's why this function is useful.
-- Parameters: l is life and m is max_life.
local function get_pixel(l, m)

  local result = (39 * l)/m
  local e, d = math.modf(result)
  if e == 0 or d >= 0.5 and e ~= 38 then
e = math.ceil(result)
  end
  return e
end

    function health_orb:new(game)

      local object = {}
      setmetatable(object, self)
      self.__index = self
     
      object:initialize(game)
     
      return object
    end

    function health_orb:initialize(game)

      self.game = game
      self.surface = sol.surface.create(48, 48)
      self.health_orb_img = sol.surface.create("hud/health_orb.png")
      self.container_sprite = sol.sprite.create("hud/health_orb")
  self.container_sprite:set_animation("normal")
      self.life_displayed = self.game:get_life()
  self.life_pixel_displayed = 0
      self.max_life_displayed = 0
 
  self:check()
      self:rebuild_surface()
    end

function health_orb:on_started()

    -- This function is called when the HUD starts or
    -- was disabled and gets enabled again.
    -- Unlike other HUD elements, the timers were canceled because they
    -- are attached to the menu and not to the game
    -- (this is because the hearts are also used in the savegame menu).
      self.danger_sound_timer = nil
      self:check()
      self:rebuild_surface()
end

    -- Checks whether the view displays the correct info
    -- and updates it if necessary.
    function health_orb:check()

      local need_rebuild = false
      local max_life = self.game:get_max_life()
      local life = self.game:get_life()

      -- Maximum health
      if max_life ~= self.max_life_displayed then
        need_rebuild = true
        self.max_life_displayed = max_life
self.life_pixel_displayed = get_pixel(self.life_displayed, self.max_life_displayed)
      end

      -- Current health
      if life ~= self.life_displayed then
        need_rebuild = true
        local increment
        if life < self.life_displayed then
          increment = -1
        elseif life > self.life_displayed then
          increment = 1
  if self.game:is_started()
and self.life_displayed % 4 == 0 then
sol.audio.play_sound("heart")
          end
        end
        self.life_displayed = self.life_displayed + increment
for i = 1, get_pixel(1, self.max_life_displayed) do
self.life_pixel_displayed = get_pixel(self.life_displayed , self.max_life_displayed)
end
      end

  -- If we are in-game, play animations and a sound if the life is low.
      if self.game:is_started() then
  if self.game:get_life() <= self.game:get_max_life() / 4
  and not self.game:is_suspended() then
-- Show animations "danger..." of the empty container sprite if not already done.
need_rebuild = true
if self.container_sprite:get_animation() ~= "danger" then
  self.container_sprite:set_animation("danger")
end
if self.danger_sound_timer == nil then
  self.danger_sound_timer = sol.timer.start(self, 250, function()
self:repeat_danger_sound()
  end)
  self.danger_sound_timer:set_suspended_with_map(true)
end
  else
if self.container_sprite:get_animation() ~= "normal" then
  self.container_sprite:set_animation("normal")
  need_rebuild = true
end
  end
      end

      -- Redraw the surface only if something has changed.
      if need_rebuild then
        self:rebuild_surface()
      end

      -- Schedule the next check.
      sol.timer.start(self.game, 50, function()
        self:check()
      end)
    end

function health_orb:repeat_danger_sound()

  if self.game:get_life() <= self.game:get_max_life() / 4 then
sol.audio.play_sound("danger")
self.danger_sound_timer = sol.timer.start(self, 750, function()
self:repeat_danger_sound()
end)
self.danger_sound_timer:set_suspended_with_map(true)
  else
self.danger_sound_timer = nil
  end
end

    function health_orb:rebuild_surface()

      self.surface:clear()
     
      -- Empty container
  self.container_sprite:draw(self.surface)
     
      -- Current health
  self.health_orb_img:draw_region(3, (42 - self.life_pixel_displayed), 42, self.life_pixel_displayed, self.surface, 3, (42 - self.life_pixel_displayed))
end

    function health_orb:set_dst_position(x, y)

      self.dst_x = x
      self.dst_y = y
    end

    function health_orb:on_draw(dst_surface)

      if self.max_life_displayed > 0 then
        local x, y = self.dst_x, self.dst_y
        local width, height = dst_surface:get_size()
        if x < 0 then
          x = width + x
        end
        if y < 0 then
          y = height + y
        end
     
        self.surface:draw(dst_surface, x, y)
      end
    end

    return health_orb


________________________

In ../data/scripts/hud/hud.lua with other elements:

-- blablabla
  local health_orb_builder = require("scripts/hud/health_orb")
-- blablabla
-- Then, example of position!
  menu = health_orb_builder:new(game)
  menu:set_dst_position(-104, 6)
  hud.elements[#hud.elements + 1] = menu

________________________

In ../data/project_db.dat:
sprite{ id = "hud/health_orb", description = "HUD: Health Orb" }

________________________

In a ../data/sprites/hud/health_orb.dat with the health_orb.png:

animation{
  name = "danger",
  src_image = "hud/health_orb.png",
  frame_delay = 200,
  frame_to_loop_on = 0,
  directions = {
    { x = 0, y = 48, frame_width = 48, frame_height = 45, origin_x = 0, origin_y = 0, num_frames = 4 },
  },
}
animation{
  name = "normal",
  src_image = "hud/health_orb.png",
  directions = {
    { x = 48, y = 0, frame_width = 48, frame_height = 45, origin_x = 0, origin_y = 0 },
  },
}
#100
Thanks Metalzelda  :)
If someone has tested this xp and level system, please tell me if my tutorial is clear and if it works correctly in your game.

I will update the first post as I just do it for initialize_hero().
#101
Development / Re: Possible to create a level up system?
January 28, 2016, 10:08:28 PM
QuoteBut with my method, I have xp value in the buffer (with other values found in the saveX.dat) + in the metatable which also used memory: I think my method is stupid, and I should avoid to insert data in the metatable.
For people who will read my previous post in several months, know that I have improved the functions.

See in this topic: HUD: ZL - level (LVL) & experience (XP). The xp system is more complete.
#102
Development / HUD: ZL - level (LVL) & experience (XP)
January 28, 2016, 06:54:26 PM
HUD - ZL - level (LVL) & experience (XP)



I try to create a game system with points of experience and levels for my Zelda-like project.
Starlock sent me an email: "I was also planning on making an xp system and was hoping I could see your code and fiddle around with it :P"
So I share my work if this could be useful for others...

____________________

SCRIPT

Here is the main script for the HUD. See in attachment.
Put this script in '../data/scripts/hud/lvl_and_xp.lua'

In this script there is a table:
self.t_xp_to_levelup = {100, 200, 300, 400, 500, 600, 700, 800}

You are level 1 and you need 100 xp  to level up.
You are level 2 and you need 200 xp  to level up.
You are level 3 and you need 300 xp  to level up.
...
You are level 8 and you need 800 xp  to level up.
Then level 9 appears and xp counters are blocked (800/800). They appears in green because I used 'small_green_digits' font that I think you have got.
Put  your own values. Obviously, it will not be 100, 200, 300 etc.. ;)
You are not limited to 8 values.

____________________

IMPORTANT

You will have to add some lines in certain lua files. See below.
I hope I don't forget something.  ;D

____________________

IMAGE

Copy this image. See in attachment.

../data/sprites/hud/lvl_and_xp_icon.png

_________________

POSITION IN THE HUD

In '../data/scripts/hud.lua' , you need declare the position of lvl and xp elements.
(-104, 16) is an example.


  ---- Create each element of the HUD.
  -- blablabla

  local lvl_and_xp_builder = require("scripts/hud/lvl_and_xp")

-- blablabla

  menu = lvl_and_xp_builder:new(game)
  menu:set_dst_position(-104, 16)
  hud.elements[#hud.elements + 1] = menu


-- blablabla

____________________

SAVEGAME FILE

In "../data/scripts/game_manager.lua", and more precisely in the "function game_manager:create(file)", we have to declare two values for a new savegame file. Also add 'current_level = 0'  and 'current_xp = 0' in your existing savegame files.

--  if not exists then
    ---- This is a new savegame file.
   -- blablabla

game:set_value("current_level", 0)
game:set_value("current_xp", 0)

--  end
-- blablabla

____________________

FUNCTIONS TO ADD, SET or GET XP and LEVEL

In '../data/scripts/quest_manager.lua', because I think it is practical to add or set or  get xp and level of our hero, I added some functions.
All these functions are not necessaries, but they are very useful in debug console to test.
hero:set_level(3) is equal to game:set_value("current_level", 3)
hero:add_level(1) so  'current_level = 4' in your 'saveX.dat' if you save the game.
hero:get_level() is equal to game:get_value("current_level")
hero:set_xp(100)    is equal to  game:set_value("current_xp", 100)
hero:add_xp(10)   so  'current_xp = 110' in your 'saveX.dat' if you save the game. hero:add_xp(number) is the most useful for enemies.
hero:get_xp()  is equal to  game:get_value("current_xp")


Code (lua) Select

-- Initializes some behavior of our hero.
local function initialize_hero()

  local hero_meta = sol.main.get_metatable("hero")
 
  -- ZL --  Functions for levels of our hero
  function hero_meta:set_level(lvl)

    if type(lvl) == "number" then
local game = self:get_game()
game:set_value("current_level", lvl)
else
        print("Error in hero:set_level(lvl), lvl should be a number.")
    end
  end
  function hero_meta:add_level(lvl)

    if type(lvl) == "number" then
local game = self:get_game()
local current_level = game:get_value("current_level")
game:set_value("current_level", current_level + lvl)
else
        print("Error in hero:add_level(lvl), lvl should be a number.")
end
  end
  function hero_meta:get_level()

local game = self:get_game()
local current_level = game:get_value("current_level")
return current_level
  end
  -- ZL --  Functions for experience points of our hero
  function hero_meta:set_xp(xp)

    if type(xp) == "number" then
local game = self:get_game()
game:set_value("current_xp", xp)
else
        print("Error in hero:set_xp(xp), xp should be a number.")
    end
  end
  function hero_meta:add_xp(xp)

    if type(xp) == "number" then
local game = self:get_game()
local current_xp = game:get_value("current_xp")
game:set_value("current_xp", current_xp + xp)
else
        print("Error in hero:add_xp(xp), xp should be a number.")
end
  end
  function hero_meta:get_xp()

local game = self:get_game()
local current_xp = game:get_value("current_xp")
return current_xp
  end

end



Edit: Sorry, don't forget to  initialize_hero() !!!
Code (Lua) Select

function quest_manager:initialize_quest()

  -- blablabla
  initialize_hero()
  -- blablabla

end


____________________

ENEMIES

In your scripts for enemies where you have declared their behavior  (e.g  ../data/enemies/lib/slime_behavior.lua),
just add a variable named for example "properties.xp" in your 'function behavior:create(enemy, properties)'. I don't know, but the name of your function is perhaps different.

In my example, I decided to define xp according to life, damage and speed of the enemy.
properties.xp = properties.xp or (properties.life * properties.damage * properties.normal_speed)

In this example, I added xp in the 'function enemy:on_dying()', I think it is logical, but you can do differently:

  function enemy:on_dying()
 
local hero = enemy:get_map():get_entity("hero")
hero:add_xp(properties.xp)

  end
#103
Development / Re: Is hero:on_taking_damage() broken ?
January 24, 2016, 02:06:17 AM
There is no problem with your script.
I added this line "hero_mode = true" in save1.dat and I added your script in quest_manager.lua.
After "game:remove_life(damage)", I even added this line to test:
print ("hero_mode = ", game:get_value("hero_mode"), "so damage =", damage, "and get life = ", game:get_life())
In debug mode, I typed
game:set_value("hero_mode", false)
and damage returns to normal, so it works.
#104
Development / Re: Save Game
January 17, 2016, 08:15:09 PM
@DevilStrawsz:

  • What is your operating system?
  • Where comes from your 'data' directory?   I guess it comes from an english tutorial but which one?
  • Original version of Solarus : ?  In your first post, you wrote "This quest is made for Solarus 0.9 but you are running Solarus 1.4.5", so I guess it was a 0.9.
  • I tested your project and I also have this message loading your project: 'Error: Error in string data file: [string "text/strings.dat"]:10: attempt to call global 'dialog' (a nil value)'.
    I think you made something wrong converting your project. When I open the 'data/languages/en/text/strings.dat' file of your project, the content is not correct, because according to me, it should not contain "Dialogs show when the hero obtains a treasure". I deleted the content of this file and I had no more error in the console.
  • There is also a problem with the game_manager:create("save1.dat") but I don't know why :(
    There is no error in the console.

  • I said you to rename your directory named '$HOME/.solarus/tuto_quest_en' into '$HOME/.solarus/tuto_quest_en_old'
    (or  for Windows, '%UserProfile%\.solarus\tuto_quest_en' into '%UserProfile%\.solarus\tuto_quest_en_old' ),
    not  'write_dir = "tuto_quest_en" into 'write_dir = "tuto_quest_en_old".
    OK now it does not matter, when we started your quest, a 'tuto_quest_en_old' is created in our  '$HOME/.solarus/.

  • I think you have a useless subdirectory named 'data' in your directory named 'data'. In other words, another project without maps in your project. Delete this directory will not solve your problem, but it will be cleaner.
#105
Development / Re: Save Game
January 16, 2016, 08:04:50 PM
I think you wrote the solution
Quote from: DevilStrawsz on January 15, 2016, 11:35:24 PM
(...)
The Solarus Write Directory is already set.
(...)
Quote from: DevilStrawsz on January 16, 2016, 02:06:25 AM
  -- Directory where your quest will write its savegames and setting files.
  -- It will be a subdirectory of '$HOME/.solarus/', automatically created by
  -- the engine. Its name should identify your quest, to avoid confusion with
  -- other Solarus quests that might also be installed on the user's machine.
  -- You must define it before you can use savegames or setting files.
  -- Uncomment the line below and set its value to the name of that directory:
   write_dir = "tuto_quest_en",

In the directory $HOME/.solarus/ or  %UserProfile%\.solarus (for Windows),
it may be that there is an existing subdirectory named "tuto_quest_en".
Just rename it into, for example, "tuto_quest_en_old" and restart the Quest Editor to update the version.