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.


Messages - dpro_games

Pages: [1] 2 3
1
Development / Compile for RETROPIE ?
« on: January 09, 2018, 08:09:21 pm »
Hello there,
I have already all setup on my raspberry pi 3 to create a solarus console with retropie. All work, I mean there are the main project which work pretty well. As mentioned here https://github.com/RetroPie/RetroPie-Setup/wiki/Solarus I can add my own game. BUT, how can I do that? I developed my game on windows with solarus 1.5.3. I have my "data.solarus" and now... What do I am supposed to do with all this?

Thanks for your help!  :)

2
Development / Re: Save file ?
« on: November 24, 2017, 09:22:13 am »
Okay thank for the answer  :)
But I think I will bring my computer to school, it will be easier than ask someone to create the file from an administrator session... Moreover, I'm not sure than the problem come from there.
I mean when I run the game the console show:

Info: Solarus 1.5.3
Info: Opening quest 'C:/Users/--my_name--.TLPU090/Desktop/solarus'


And stop here, but I don't really know what happened

3
Development / Save file ?
« on: November 24, 2017, 09:09:30 am »
Hello, I working on a project with the solarus engine in my school but I can run the quest. I think the probleme come from the save file which cannot be created because of my "student session" can't write on the local disk but only on a serveur. So, how can I change the path to say to solarus than it need to create the file on the serveur and load the save from it ?

Thank you to help me  :)

4
Development / Re: How to use: chest:on_opened() ?
« on: July 12, 2017, 06:54:13 pm »
I found by myself, that's work !  :D
I use this line:
Code: [Select]
hero:start_treasure(treasure_item, [treasure_variant, [treasure_savegame_variable, [callback]]])To give the treasure to the hero when he open the chest.

Thanks you for helped me !  :D :D

5
Development / Re: How to use: chest:on_opened() ?
« on: July 12, 2017, 06:33:15 pm »
It work but there is still a problem... When I open the chest, the value is increase but the hero don't get the sword in the chest. May I need to give the sword by the code but I don't know the line which give the item like if the player open a chest...
Thank to help me.

6
Development / Re: How to use: chest:on_opened() ?
« on: July 11, 2017, 05:04:32 pm »
I just want to detect when the chest is open to open a door.

7
Development / Re: How to use: chest:on_opened() ?
« on: July 11, 2017, 04:55:15 pm »
Thank for the answere
With this code
Code: [Select]
function sword_chest:on_opened(sword, 1, "sword_chest_save")
  hero:unfreeze()
  chest_open = chest_open + 1
  test()
end

I have another error
Error: Failed to load script 'maps/dungeons/tuto/place_holder': [string "maps/dungeons/tuto/place_holder.lua"]:5: <name> or '...' expected near '1'

I don't understand why...

8
Development / [SOLVED] How to use: chest:on_opened() ?
« on: July 11, 2017, 12:16:00 pm »
Hello, I create this code to increment a value when this chest is open but I have this error :
Error: Failed to load script 'maps/dungeons/tuto/place_holder': [string "maps/dungeons/tuto/place_holder.lua"]:5: <name> or '...' expected near '"sword"'

Code: [Select]
function sword_chest:on_opened("sword", 1, "sword_chest_save")
  hero:unfreeze()
  chest_open = chest_open + 1
  test()
end

9
Development / Re: In trouble with pause menu
« on: June 30, 2017, 12:01:04 am »
Je n'ai rien compris à comment le corriger (je suis débutant complet...)
Ou se trouve le code à changer et par quoi le remplacer ?

Merci pour la reponse !

10
Development / In trouble with pause menu
« on: June 29, 2017, 11:21:29 pm »
Hello, i'm using the exact same code as the christopho's project (mecuris chest) for the pause menu and the game over menu...
(pause.lua/pause_inventory.lua/pause_map.lua/pause_options.lua/pause_quest_status.lua/pause_submenu.lua/game_over.lua)
https://github.com/solarus-games/zelda-mercuris-chest/tree/dev/data/scripts/menus
But there is a strange bug when the player die... the game over menu work very well but if the player choose to continue the game (with save or without save...) when the pause button is pressed during the game after the choice, the menu is completely broken... the images are superimposed on the others ect... I don't know why. But when we quit the game and restart the save all is back as before...

Please help me ! Thank

11
Development / Re: Small Key HUD ?
« on: April 05, 2017, 06:26:28 pm »
Ça marche enfin !!  ;D
Vraiment merci de m'avoir accordé du temps pour m'aider ! J'ai compris plein de chose sur le fonctionnement de Solarus !

Et un gros GG pour avoir conçu le moteur de mes rêve: Solarus !   :)

12
Development / Re: Small Key HUD ?
« on: April 05, 2017, 05:56:24 pm »
Juste, comment faire pour que ma variable qui compte les clés soit égale a zéro aux début du jeu et pas a "nil" ?

13
Development / Re: Small Key HUD ?
« on: April 05, 2017, 05:22:20 pm »
Ah oui pardon, je suis débile...  ;D

Code: [Select]
-- Script that creates a head-up display for a game.

-- Usage:
-- require("scripts/hud/hud")

require("scripts/multi_events")
local hud_config = require("scripts/hud/hud_config")

-- Creates and runs a HUD for the specified game.
local function initialize_hud_features(game)

  -- Set up the HUD.
  local hud = {
    enabled = false,
    elements = {},
  }

  for _, element_config in ipairs(hud_config) do
    local element_builder = require(element_config.menu_script)
    local element = element_builder:new(game, element_config)
    if element.set_dst_position ~= nil then
      -- Compatibility with old HUD element scripts
      -- whose new() method don't take a config parameter.
      element:set_dst_position(element_config.x, element_config.y)
    end
    hud.elements[#hud.elements + 1] = element
  end

  -- Destroys the HUD.
  function hud:quit()

    if hud:is_enabled() then
      -- Stop all HUD elements.
      hud:set_enabled(false)
    end
  end

  -- Returns whether the HUD is currently enabled.
  function hud:is_enabled()
    return hud.enabled
  end

  -- Enables or disables the HUD.
  function hud:set_enabled(enabled)

    if enabled ~= hud.enabled then
      hud.enabled = enabled

      for _, menu in ipairs(hud.elements) do
        if enabled then
          -- Start each HUD element.
          sol.menu.start(game, menu)
        else
          -- Stop each HUD element.
          sol.menu.stop(menu)
        end
      end
    end
  end

  -- Returns whether the HUD is currently shown.
  function game:is_hud_enabled()
    return hud:is_enabled()
  end

  -- Enables or disables the HUD.
  function game:set_hud_enabled(enable)
    return hud:set_enabled(enable)
  end

  -- Call this function to notify the HUD that the current map has changed.
  local function hud_on_map_changed(game, map)

    if hud:is_enabled() then
      for _, menu in ipairs(hud.elements) do
        if menu.on_map_changed ~= nil then
          menu:on_map_changed(map)
        end
      end
    end
  end

  -- Call this function to notify the HUD that the game was just paused.
  local function hud_on_paused(game)

    if hud:is_enabled() then
      for _, menu in ipairs(hud.elements) do
        if menu.on_paused ~= nil then
          menu:on_paused()
        end
      end
    end
  end

  -- Call this function to notify the HUD that the game was just unpaused.
  local function hud_on_unpaused(game)

    if hud:is_enabled() then
      for _, menu in ipairs(hud.elements) do
        if menu.on_unpaused ~= nil then
          menu:on_unpaused()
        end
      end
    end
  end

  game:register_event("on_map_changed", hud_on_map_changed)
  game:register_event("on_paused", hud_on_paused)
  game:register_event("on_unpaused", hud_on_unpaused)

  -- Start the HUD.
  hud:set_enabled(true)
end

-- Set up the HUD features on any game that starts.
local game_meta = sol.main.get_metatable("game")
game_meta:register_event("on_started", initialize_hud_features)
return true

14
Development / Re: Small Key HUD ?
« on: April 05, 2017, 04:36:12 pm »
J'ai de nouveau un problème au niveau du HUD cette fois, mais il me semble que j'ai presque réussis...

Le code du HUD pour la small_key :

Code: [Select]
-- The small_key counter shown in the game screen.

local small_key_builder = {}

local small_key_icon_img = sol.surface.create("hud/small_key_icon.png")

function small_key_builder:new(game, config)

  local small_key = {}

  local digits_text = sol.text_surface.create({
    font = "white_digits",
    horizontal_alignment = "left",
    vertical_alignment = "top",
  })
  local small_key_displayed = game:get_value("small_keys_save")

  local dst_x, dst_y = config.x, config.y

  function small_key:on_draw(dst_surface)

    local x, y = dst_x, 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

    small_key_icon_img:draw(dst_surface, x + 8, y)
    digits_text:draw(dst_surface, x, y + 10)
  end

end

return small_key_builder

Mais j'ai une erreur :

Error: In on_started: [string "scripts/hud/hud.lua"]:21: attempt to index local 'element' (a nil value)

Voici le script de la clé :

Code: [Select]
local item = ...
local game = item:get_game()

function item:on_created()

  self:set_shadow("small")
  self:set_brandish_when_picked(false)
  self:set_sound_when_picked("picked_small_key")
end

function item:on_obtaining(variant, savegame_variable)
 
  local count = game:get_value("small_keys_save") or 0
  game:set_value("small_keys_save", count + 1)
end

15
Development / Re: Small Key HUD ?
« on: April 05, 2017, 03:08:02 pm »
Ca marche !! Merci beaucoup !!  :)

Pages: [1] 2 3