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

#31
Development / Re: Issue with playing music
January 19, 2018, 12:04:27 AM
That didn't seem to work. The music still restarts whenever you go from one map to another. Isn't it not supposed to restart regardless if it's the same song, like what it says on the wiki?

"If you set the music name to the same music that is already playing, or to the special value "same", then this function does nothing: the music keeps playing (it does not restart) and the second parameter is ignored."
#32
Development / Issue with playing music
January 18, 2018, 09:52:14 PM
Whenever I go from one map to another, the song will restart despite it being the same song. I'm calling the sol.audio.play_music(music_id, [action]) from inside of the map:on_started() since there are three different songs that can play depending on your progress in the game. What do I need to do to stop the music from restarting?
#33
Development / How do drawables work
November 23, 2017, 06:08:43 AM
I'm trying to make a sort of mirror using a sensor that enables a sprite using the hero sprite. I want to keep the hero sprite only within the box of the mirror and to not show any of the sprite outside of the mirror and drawable:draw_region() sounds like its something that could work, but I'm not exactly sure how to use it.
#34
Development / Can an enemy activate a switch?
October 26, 2017, 08:06:15 AM
I'm trying to make a projectile that activates a switch, but when I put in enemy:overlaps(entity) an error comes up saying that it expects an integer so I'm not sure what to do for this.
#35
Hey, could you post your current code?

You might have to make the declaration in the map:on_started() function It would be something like this

Code ( lua) Select
  if game:get_value("chestsavevalue") then yourchestname:set_enabled(true) else yourchestname:set_enabled(false) end

The functions you are talking about should look something like this:

Code ( lua) Select
for enemy in map:get_entities("yourenemy") do
  enemy.on_dead = function()
    if not map:has_entities("yourenemy") then
      yourchestname:set_enabled(true)
      sol.audio.play_sound("chest_appears")
    end
  end
end
#36
Development / Multiple ground sprites?
August 10, 2017, 06:23:19 PM
Is it possible to have multiple ground sprites for the same ground? Like if you have grey grass and green grass you would have different ground sprites for the hero depending on which color grass you are in.
#37
Development / How does the overworld map menu work?
July 16, 2017, 05:35:13 AM
Like the title says, I'm starting to try and make the overworld map for my quest,  but I'm not sure how to properly draw out the map? Does every 320x240 map become a 32x24 square on the overworld map? I just need someone to clearly state what would be the best way to tackle creating the world map. Thanks  :)
#38
Development / Stop slide on ice?
June 02, 2017, 04:44:15 AM
Hey, is it possible to make the hero stop sliding when walking on ice? When I use the hookshot while sliding the hero will slide but the hook leader will stay in the place from before the slide and if it hooks on something the hero will become stuck
#39
Development / Problem with timer
May 29, 2017, 09:48:25 PM
I'm trying to make a bridge that appears when at least one of three torches is lit. I'm having trouble making the timer work properly, since once the timer finishes there's a delay before it can activate again so you can't light the torch again in that time frame. Is there a way to make the timer instantly be activatable again after it finishes?

Here is my code(It is part of function map:on_update()):
Code ( lua) Select

  if torch_light:get_sprite():get_animation() == "lit" or torch_light_2:get_sprite():get_animation() == "lit" or
  torch_light_3:get_sprite():get_animation() == "lit" then
      map:set_entities_enabled("torchbridge", true)
        sol.timer.start(3500, function()

          map:set_entities_enabled("torchbridge", false)
torch_light:get_sprite():set_animation("unlit")
torch_light_2:get_sprite():set_animation("unlit")
torch_light_3:get_sprite():set_animation("unlit")
      end)
    end
#40
Development / How to specify custom attack sprite
December 29, 2016, 06:07:52 PM
I'm trying to create a boss that can only be hurt when attacked by a thrown item with a specific sprite but I'm not sure how to call the thrown items sprite in the enemy code.

Code ( lua) Select
function enemy:on_custom_attack_received(attack, sprite)
  if attack == "thrown_item" and attack:get_sprite() == "entities/boss3block" then
  enemy:hurt(1)
  enemy:remove_life(1)
  end
end


This was my attempt but it gives me an error that the get_sprite() is calling a nil value
#41
Development / Can fire have variants?
October 30, 2016, 04:16:45 AM
Would it be possible for fire to have multiple variants for something like a special ice block that could only be melted by a higher level version of fire?
#42
Development / Re: Stop hero animation outside collision
October 09, 2016, 05:37:26 PM
Won't that just make the hero unable to move? The hero should be able to move, the problem is that he stops moving when he attempts to use his sword. I'm thinking of using on_command_pressed but I'm not sure what to do to make the hero unable to do anything besides move.
#43
Development / Re: Stop hero animation outside collision
October 09, 2016, 02:52:54 AM
It works now, but is there a way to prevent the hero from using items during the collision? If an item is used the hero just ends up freezing.
#44
Development / Stop hero animation outside collision
October 08, 2016, 10:16:35 PM
I'm trying to make a collision test on a custom entity  that changes the hero animation while overlapping. Setting the animation works, but the animation persists outside of the entity until the hero stops moving. What do I do to fix this?

This is the chunk:

Code ( lua) Select
  entity:add_collision_test("overlapping", function()
    if entity:overlaps(hero) then
      hero:set_animation("spring")
    end
    return true
  end)
#45
Development / Re: Trouble with dialog function syntax
August 24, 2016, 08:31:01 PM
Thank you, Diarandor. That worked to solve the problem.    :D