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

#16
To begin with, this issue does not affect the game play at all and everything works. It is just an annoying warning.

I have this code on a different map.
Code ( lua) Select
  function slime:on_removed()
    bookcase:set_enabled(false)
  end


When I leave the map and go to a different map, I get a warning from the previous map: (I checked and "bookcase" does not exist on the new map.)
Error: In on_removed: [string "maps/chain_village/zark_house.lua"]:17: attempt to index global 'bookcase' (a nil value)

Please note: I did not remove the bookcase and it does the same thing when I tested it with a chest entity.

Code ( lua) Select
function slime:on_removed()   
    if not chest:is_open() then
      sol.audio.play_sound("secret")
    end
end


Error: In on_removed: [string "maps/chain_village/zark_house.lua"]:21: attempt to index global 'chest' (a nil value)


I get around the warning by using a save variable.

Code ( lua) Select
  function slime:on_removed()
    if not game:get_value("zark_house_enemy_defeated") == true then
      bookcase:set_enabled(false)
    end
   
    if not game:get_value("zark_house_enemy_defeated") == true then
      if not chest:is_open() then
        sol.audio.play_sound("secret")
      end
    end

    game:set_value("zark_house_enemy_defeated",true)
  end
#17
@Christopho
No loop, but it seems the "opening" frame delay was the problem. The frame delay was at: 0 ms

It works now. Thank you Christopho!
#18
Development / Re: Required Sound Effects?
July 26, 2018, 08:20:14 PM
Well, this is just a hunch, but did you check the project_db.dat?

They probably still exist there if you did not delete the sounds from the editor.
#19
Bugs & Feature requests / Re: door function issue?
July 26, 2018, 07:51:01 PM
I am pretty sure. Here is an image to prove it. I made sure all the animations existed as stated in the documentation.



Also, I mentioned the function door:is_opening() working.

Code ( lua) Select
 
sol.timer.start(1000, function()
  if door_1:is_opening() == true then
    hero:teleport("chain_village/underground_miniboss", "boss_destination", "fade")
  end
  return true
end)


#20
Version: Solarus 1.5.3
OS: Linux

This might be a bug?

I tried using door:on_opened(), but it seems to not be working. I double checked the name and everything. This function is called during an opening of a door, right?

Code ( lua) Select
function door_1:on_opened()
  print("opened door")
  hero:teleport("chain_village/underground_miniboss", "boss_destination", "fade")
end


The same occurred with door:is_open(). The door is indeed open, but nothing happens.

Code ( lua) Select
 
sol.timer.start(1000, function()
  if door_1:is_open() == true then
    hero:teleport("chain_village/underground_miniboss", "boss_destination", "fade")
  end
  return true
end)


The function door:is_opening() worked.

Code ( lua) Select
 
sol.timer.start(1000, function()
  if door_1:is_opening() == true then
    hero:teleport("chain_village/underground_miniboss", "boss_destination", "fade")
  end
  return true
end)


#21
Added:
GrafX2 - It has unique tools for creating pixel art. It is available for many platforms including Android and Linux. YouTube Tutorials

News:
June 18, 2017 - GraphicsGale became a freeware!
#22
Development / Re: [Solved]Pass multiple entities?
July 22, 2018, 05:36:06 PM
@Diarandor
Thank you for pointing me to the function map.get_entities_by_type(type).

I just have to say Solarus is spectacular. It was really that simple. Here is a little working piece of code.

Code ( lua) Select
sol.timer.start(1000, function()
for bomb in map:get_entities_by_type("bomb") do
  if bomb:overlaps(test) then
    test:set_enabled(false)
  end
end
  return true
end)
#23
Development / [Solved]Pass multiple entities?
July 22, 2018, 01:14:15 AM
Would it be possible to pass more than one entity through a method?

For example,
Code ( lua) Select
entity:overlaps(entity)

Code ( lua) Select
map:get_entites("bomb"):overlaps(test)
#24
Development / Re: [Solved]Bomb overlap assistance
July 21, 2018, 11:38:01 PM
Oh, this is a little hilarious. I forgot to add a name to the created entity. It works now.

Code ( lua) Select
  local x, y, layer = hero:get_position()
  local direction = hero:get_direction()
  if direction == 0 then
    x = x + 16
  elseif direction == 1 then
    y = y - 16
  elseif direction == 2 then
    x = x - 16
  elseif direction == 3 then
    y = y + 16
  end

  map:create_bomb{
    name = "bomb",
    x = x,
    y = y,
    layer = layer
  }

--bomb test
sol.timer.start(1000, function()
if map:has_entities("bomb") and bomb:overlaps(test) then
      test:set_enabled(false)
    end
  return true
end)




#25
Development / Re: Bomb overlap assistance
July 21, 2018, 08:37:48 PM
I actually tried map:has_entities() and creating the bomb beforehand. I thought it was the timer, but that was not the case after some more testing.

Code ( lua) Select
local x, y, layer = hero:get_position()
  local direction = hero:get_direction()
  if direction == 0 then
    x = x + 16
  elseif direction == 1 then
    y = y - 16
  elseif direction == 2 then
    x = x - 16
  elseif direction == 3 then
    y = y + 16
  end

  map:create_bomb{
    x = x,
    y = y,
    layer = layer
  }

--bomb test
sol.timer.start(1000, function()
    if map:has_entitiy("bomb_1") and bomb_1:overlaps(test) then
      test:set_enabled(false)
    end
  return true
end)


Error: In on_started: [string "maps/soulia_forest/soulia_forest.lua"]:80: attempt to call method 'has_entitiy' (a nil value)

I also tried:

Code ( lua) Select
sol.timer.start(1000, function()
for bomb in map:get_entities("bomb") do
  if bomb_1:overlaps(test) then
      test:set_enabled(false)
  end
end
  return true
end)


As well as...

Code ( lua) Select
sol.timer.start(1000, function()
  if map:has_entities("bomb") and bomb_1:overlaps(test) then
    test:set_enabled(false)
  end
  return true
end)

#26
Development / [Solved]Bomb overlap assistance
July 21, 2018, 09:58:18 AM
Okay, I want an entity to be disabled when a bomb is placed on it. I am guessing that it is not working because the bomb is not created before the start of the map.
Code ( lua) Select
--bomb test
sol.timer.start(1000, function()
    if bomb_1:overlaps(test) then
      test:set_enabled(false)
    end
  return true  -- To call the timer again (with the same delay).
end)


Error: In on_started: [string "maps/soulia_forest/soulia_forest.lua"]:57: attempt to index local 'bomb_1' (a nil value)


#27
Quote from: Max on July 19, 2018, 05:38:13 AM
Zefk, I do the exact same thing. But you have to admit, it's not great to export the entire image, set up the animations, then have to re-export the image for every change. It'd be a lot easier to view animations in the app your animating in.
@max
I use the Export Layers Plugin. It would be a pain to export lots of layers one at a time. On another note, registry.gimp.org is gone!?
https://github.com/khalim19/gimp-plugin-export-layers/releases
https://web.archive.org/web/20171209015125/http://registry.gimp.org/node/28268

Updated: Extension links.

Also, I use the merge visible layers... if I need to export a single image. You should see it near the bottom when right clicking a layer.

QuoteIt'd be a lot easier to view animations in the app your animating in.
This is very true. Gimp should learn from Solarus and make a sprite editor.

Although, Gimp does have - filters > animation > playback
#28
@Max
Good point.

Script above: Here

Okay, I finalized the scrolling credits script. You can get the script above for now until I add it to the script section. One can either load it or modify it for require.

Feature added:
+Change direction of the scrolling credits
+Change whether the game pauses during the start of credits (as in suspend)
+Change skip speed and the key's letter
#29
@Bagu
This video is similar to the one I learned from when I used Photoshop for some pixel art, but I use Gimp and Krita now.
https://www.youtube.com/watch?v=rLdA4Amea7Y

@Max
I just use the Solarus sprite editor to check animation.

#30
The "gif" is choppy, but the scrolling credits is working fine on my computer. I think I will go ahead and finalize the script for the book. I should also release a demo in the script section of the forum.

Edit: Did further tests and added a few more features. I updated the script above.

On another note, I made changes on Github: Changelog