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 4
Development / Re: Strange problem with a "set_enabled()"
« on: January 16, 2020, 10:35:58 pm »
I don't know how to link scripts... :/

Development / Re: Strange problem with a "set_enabled()"
« on: January 16, 2020, 06:36:12 pm »
Thank you for the answer !

Here's the new error message
Code: [Select]
Error: In on_map_changed: scripts/multi_events.lua:39: callback must be a function!
stack traceback:
[C]: at 0x017de150
[C]: in function 'assert'
scripts/multi_events.lua:39: in function 'register_event'
scripts/fsa_effect.lua:210: in function 'setup_inside_lights'
scripts/fsa_effect.lua:225: in function 'on_map_changed'
scripts/effect_manager.lua:7: in function 'apply_effect'
scripts/effect_manager.lua:22: in function 'callback'
scripts/multi_events.lua:42: in function <scripts/multi_events.lua:41>

Development / Re: Strange problem with a "set_enabled()"
« on: January 16, 2020, 12:43:45 am »
This is the code for the light :

Code: [Select]
local light = ...
local game = light:get_game()
local map = light:get_map()
local light_mgr = require('scripts/lights/light_manager')

local radius = tonumber(light:get_property('radius')) or 120
local size = radius*2
local color_str = light:get_property('color') or '255,255,255'
local color = {color_str:match('(%d+),(%d+),(%d+)')}
for i,k in ipairs(color) do
  color[i] = k/256.0

local sqrt2radius = 1.41 * radius


--set light properties
light.radius = radius
light.color = color
light.excluded_occs = {}
light.halo = tonumber(light:get_property('halo'))
local dir_str = light:get_property('direction')
if dir_str then
  light.direction = {dir_str:match('(-?%d+),(-?%d+)')}
  for i,k in ipairs(light.direction) do
    light.direction[i] = k*1
light.cut = tonumber(light:get_property('cut'))
light.aperture = tonumber(light:get_property('aperture'))

local angle = light:get_property('angle')
if angle then
  light.aperture = math.cos((math.pi/180)* tonumber(angle))

local x,y = light:get_position()

local fire_dist = sol.shader.create('fire_dist')
local fire_sprite = light:get_sprite()
if fire_sprite then

-- Event called when the custom light is initialized.
function light:on_created()
  -- Initialize the properties of your custom light here,
  -- like the sprite, the size, and whether it can traverse other
  -- entities and be traversed by them.
  local size8 = math.ceil(size/8)*8

function light:draw_visual(dst,drawable,x,y)
  local cx,cy = map:get_camera():get_position()

function light:get_topleft()
  local lx,ly,ll = self:get_position()
  return lx-radius,ly-radius,ll

function light:draw_light(dst, camera)

  --dont draw light if disabled
  if not self:is_enabled() then

  --dont draw light if outside of the camera
  camera:set_layer(self:get_layer()) --TODO verify if this is not a shitty idea
  if not camera:overlaps(self) then

  -- get the shadow_map for this light
  local shad_map = light_mgr:compute_light_shadow_map(light)

  --draw 1D shadow as additive shadows
  self:draw_visual(dst,shad_map, self:get_topleft())

function light:draw_disturb(dst)

function light:track_entity(ent,dx,dy,dl)
    light:set_position(x+(dx or 0),y+(dy or 0), l+(dl or 0))

This is the one from "Le defi de Zeldo"

Development / Strange problem with a "set_enabled()"
« on: January 15, 2020, 09:39:33 pm »
Hello ! I have a strange problem with my code. I want to enable my custom entitiy "light" after a timer, it works but I have an error message in the consol... I really don't understand what this is about

Here's the code :
Code: [Select]
local map = ...
local game = map:get_game()

-- Explode the door and Kimos enter the room
local function animation()
  sol.timer.start(4000, function()
      name = "ex",
      layer = 2,
      x = 160,
      y = 208})"explosion")

-- Event called at initialization time, as soon as this map is loaded.
function map:on_started()


And here's the error message :

Code: [Select]
Error: In on_enabled: scripts/multi_events.lua:41: attempt to call upvalue 'callback' (a boolean value)
stack traceback:
[C]: in function 'callback'
scripts/multi_events.lua:41: in function 'previous_callbacks'
scripts/multi_events.lua:41: in function <scripts/multi_events.lua:40>
[C]: in function 'set_enabled'
maps/cutscenes/intro_1.lua:14: in function <maps/cutscenes/intro_1.lua:7>

I know how to read error message but I don't understand why this happen only with my custom entity.. No probleme with the door:set_enabled(false)

Thank you

Development / Re: Where the pause menu is launched in XD2 ?
« on: June 27, 2019, 12:57:38 pm »
Thank you for the answers
I actually make it work I don't know how but that's cool ^^

Development / Where the pause menu is launched in XD2 ?
« on: May 29, 2019, 10:08:06 pm »
Hello, I am searching where is the pause menu started in the scripts files of XD2 and how to launch it by myself ?
I'm currently trying to use the pause menu of XD2 with the some of the scripts of "Le defi de Zeldo". So I replaced the files for the menu and now, when I'm pausing the game, the game is paused but no menu are opening... Where do I need to say to the game where starting the pause menu ?


Development / Re: Error 1.5 -> 1.6
« on: December 27, 2018, 12:36:27 pm »
Okay, I will see what I can do

Thank you

Development / Error 1.5 -> 1.6
« on: December 27, 2018, 12:18:15 pm »
Hello, I have error since I updated my quest to 1.6... I don't know why, maybe some function has changed ? What I need to do

Code: [Select]
Error: bad argument #1 to sol.timer.start (game, item, map, entity, menu or sol.main expected, got table), will use a default context instead
stack traceback:
[C]: at 0x017e4540
[C]: in function 'start'
scripts/hud/hearts.lua:93: in function 'check'
scripts/hud/hearts.lua:158: in function 'new'
scripts/menus/savegames.lua:347: in function 'read_savegames'
scripts/menus/savegames.lua:51: in function <scripts/menus/savegames.lua:9>
[C]: in function 'start'
main.lua:53: in function <main.lua:50>
[C]: in function 'stop'
scripts/menus/title.lua:345: in function 'skip_menu'
scripts/menus/title.lua:218: in function <scripts/menus/title.lua:217>
(Thread 0xefc01c0)

Thank for the help

Development / Re: solarus-run.exe icon
« on: March 08, 2018, 01:38:05 am »
Sorry but I'm going to speak French.

J'ai pas mal regarder dans le github de solarus par moi même. Pour changer l'icone lors de la compilation il me suffirait de changer le "default_icon.png" (gui/ressources/images) avant de recompiler ?
J'ai une autre question : c'est le gitub de la 1.6, non ? -> Je ne vais pas avoir des problème à cause de ça après ?
Merci d'avance

Development / Re: solarus-run.exe icon
« on: March 07, 2018, 08:41:48 pm »
Ok thanks for the answer. The idea of the shorcut is not what I am wanted.

So what is the esiest way to recompile it? With what compiler (code blocks)? I'am a total beginner, do you think I can do it?

Development / solarus-run.exe icon
« on: March 07, 2018, 08:19:01 pm »
Hello, I don't know how to change the .exe icon. I have already done the pics with all the needed size but I don't know how to set it to the .exe which launch the game directly.
Thank to help me  :)

Development / Re: Convert US colour to PAL
« on: February 21, 2018, 10:04:58 pm »
Thank you so much ! This is exactly the type of answer I wanted !

Development / Convert US colour to PAL
« on: February 20, 2018, 11:45:02 am »
Hello I'm using a Pal version of the big Hyrule tileset availible on the forum, but the entities are still in the US colour, how can I fix that ?

Thank you

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 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!  :)

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

Pages: [1] 2 3 4