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.


Topics - Starlock

Pages: [1] 2 3
1
Development / How do drawables work
« on: 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.

2
Development / Can an enemy activate a switch?
« on: 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.

3
Development / Multiple ground sprites?
« on: 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.

4
Development / How does the overworld map menu work?
« on: 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  :)

5
Development / Stop slide on ice?
« on: 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

6
Development / Problem with timer
« on: 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
  1.   if torch_light:get_sprite():get_animation() == "lit" or torch_light_2:get_sprite():get_animation() == "lit" or
  2.   torch_light_3:get_sprite():get_animation() == "lit" then
  3.       map:set_entities_enabled("torchbridge", true)
  4.         sol.timer.start(3500, function()
  5.  
  6.           map:set_entities_enabled("torchbridge", false)
  7. torch_light:get_sprite():set_animation("unlit")
  8. torch_light_2:get_sprite():set_animation("unlit")
  9. torch_light_3:get_sprite():set_animation("unlit")
  10.       end)
  11.     end

7
Development / How to specify custom attack sprite
« on: 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
  1. function enemy:on_custom_attack_received(attack, sprite)
  2.   if attack == "thrown_item" and attack:get_sprite() == "entities/boss3block" then
  3.   enemy:hurt(1)
  4.   enemy:remove_life(1)
  5.   end
  6. end

This was my attempt but it gives me an error that the get_sprite() is calling a nil value

8
Development / Can fire have variants?
« on: 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?

9
Development / Stop hero animation outside collision
« on: 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
  1.   entity:add_collision_test("overlapping", function()
  2.     if entity:overlaps(hero) then
  3.       hero:set_animation("spring")
  4.     end
  5.     return true
  6.   end)

10
Development / Trouble with dialog function syntax
« on: August 24, 2016, 07:15:38 pm »
Hey, I started working on the dialog box for the level up system, and it is supposed to show a dialog that allows you to pick a stat to boost, but if a stat is maxed out, it will show a dialog allowing to boost the other two, and if two are maxed out, it should boost the last stat. I've tried multiple different things, and it continues to just show the same dialog, so I decided it might be easier to ask on the forums.

This is the chunk of code:

Code: Lua
  1.         -- Level up
  2.           if self.current_xp_displayed >= xp_to_levelup then
  3.                 self.game:set_value("current_level", current_level + 1)
  4.                 difference = current_xp - xp_to_levelup
  5.                 self.game:set_value("current_xp", difference)
  6.                 current_xp = self.game:get_value("current_xp")
  7.                 self.current_xp_displayed = 0
  8.                 self.current_xp_displayed_length = string.len(self.current_xp_displayed)
  9.     self.game:start_dialog("levelup", current_level + 1, function()
  10.       if self.game:get_max_life(60) then
  11.         self.game:start_dialog("leveluphealthmax", function(answer)
  12.           if answer == 2 then
  13.             self.game:start_dialog("levelupmana", self.game:get_max_magic() + 10)
  14.             self.game:set_max_magic(self.game:get_max_magic() + 10)
  15.             self.game:set_magic(self.game:get_max_magic())
  16.           elseif answer == 3 then
  17.             self.game:start_dialog("levelupstamina", self.game:get_max_stamina() + 10)
  18.             self.game:set_max_stamina(self.game:get_max_stamina() + 10)
  19.             self.game:set_stamina(self.game:get_max_stamina())
  20.         end
  21.       end)
  22.       elseif self.game:get_max_magic(200) then
  23.         self.game:start_dialog("levelupmanamax", function(answer)
  24.           if answer == 2 then
  25.             self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
  26.             self.game:add_max_life(5)
  27.             self.game:set_life(game:get_max_life())
  28.           elseif answer == 3 then
  29.             self.game:start_dialog("levelupstamina", self.game:get_max_stamina(), self.game:get_max_stamina())
  30.             self.game:add_max_stamina(10)
  31.             self.game:set_stamina(game:get_max_stamina())
  32.          end
  33.        end)
  34.       elseif self.game:get_max_stamina(200) then
  35.         self.game:start_dialog("levelupstaminamax", function(answer)
  36.           if answer == 2 then
  37.             self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
  38.             self.game:add_max_life(5)
  39.             self.game:set_life(game:get_max_life())
  40.           elseif answer == 3 then
  41.             self.game:start_dialog("levelupmagic", self.game:get_max_magic(), self.game:get_max_magic())
  42.             self.game:add_max_magic(10)
  43.             self.game:set_magic(game:get_max_magic())
  44.       elseif self.game:get_max_life(60) and
  45.              self.game:get_max_magic(200) then
  46.                self.game:start_dialog("levelupstamina", self.game:get_max_stamina(), self.game:get_max_stamina())
  47.                self.game:add_max_stamina(10)
  48.                self.game:set_stamina(game:get_max_stamina())
  49.       elseif self.game:get_max_life(60) and
  50.              self.game:get_max_stamina(200) then
  51.                self.game:start_dialog("levelupmagic", self.game:get_max_magic(), self.game:get_max_magic())
  52.                self.game:add_max_magic(10)
  53.                self.game:set_magic(game:get_max_magic())
  54.       elseif self.game:get_max_magic(200) and
  55.              self.game:get_max_stamina(200) then
  56.                self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
  57.                self.game:add_max_life(5)
  58.                self.game:set_life(game:get_max_life())
  59.             end
  60.          end)
  61.       else self.game:start_dialog("levelupall", function(answer)
  62.           if answer == 2 then
  63.             self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
  64.             self.game:add_max_life(5)
  65.             self.game:set_life(game:get_max_life())
  66.           elseif answer == 3 then
  67.             self.game:start_dialog("levelupmagic", self.game:get_max_magic(), self.game:get_max_magic())
  68.             self.game:add_max_magic(10)
  69.             self.game:set_magic(game:get_max_magic())
  70.           elseif answer == 4 then
  71.             self.game:start_dialog("levelupstamina", self.game:get_max_stamina(), self.game:get_max_stamina())
  72.             self.game:add_max_stamina(10)
  73.             self.game:set_stamina(game:get_max_stamina())
  74.          end
  75.        end)
  76. end
  77. end)
  78. end
  79. end

11
Development / Initial game values in zsdx
« on: May 03, 2016, 04:16:11 am »
Hey, I've just started to try and implement @froggy77 's level and xp system. However, his system is based around zelda roth and my game is based around zsdx code.

http://forum.solarus-games.org/index.php/topic,520.0.html

I believe the problem is declaring new savegame values, however nothing I've tried seems to work. I tried changing everything to roth, but that turned out to be a lot more trouble than I expected. I tried putting the values at the end of the savegames code and that didn't seem to do anything. Where should initial values be saved in zsdx?

12
Development / 2 Item Related Questions
« on: April 05, 2016, 06:42:24 pm »
Hey, I'm continuing to work on items and just had 2 questions regarding what is possible.

1) For a gust type spell, is it possible for the amount of pushback to be changed/doubled, or is the pushback static

2) Can there be an item like the magic ring from ALTTP that can half the amount of magic needed to cast spells?

13
Development / Teletransporter item
« on: March 19, 2016, 03:54:14 am »
Hey I'm currently working on the map for one of the final dungeons in my game. My plan is to create a portal gun type item that shoots entities that can create teletransporters when they collide with a special portal wall. Before I design the entire dungeon around this item I was wondering if such a thing is even doable  :P

14
Development / Entity not working, no error
« on: March 10, 2016, 03:15:10 am »
I'm trying to make a vine entity that can only be destroyed by using fire. There's no error, but the entity doesn't get destroyed when fire is used.
Code: Lua
  1. local entity = ...
  2. local map = entity:get_map()
  3.  
  4. function entity:on_created()
  5.   self:set_size(16, 16)
  6.   self:set_traversable_by("hero", false)
  7.   self:create_sprite("entities/bush_vine")
  8.  
  9.     if entity:get_type() == "fire" then
  10.       sol.audio.play_sound("jump")
  11.       self:remove()
  12.    end
  13. end
  14.  
  15. function entity:on_removed()
  16.   self:get_sprite():set_animation("destroy")
  17. end

15
Development / Scrolling dialog selections?
« on: February 09, 2016, 06:18:52 pm »
Hey, I'm planning to implement a crafting system that involves talking to NPCs and they will show a selection of craftables and the regents required to make them. I figured it would be easier to make this as a dialog that displays craftables and checks if you have the regents when you select it. Is it possible to have more than 4 selection in a dialog that you can scroll through or would I have to create a menu for a crafting system to be possible

Pages: [1] 2 3