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

#46
Development / Trouble with dialog function syntax
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) Select
-- Level up
  if self.current_xp_displayed >= xp_to_levelup then
self.game:set_value("current_level", current_level + 1)
difference = current_xp - xp_to_levelup
self.game:set_value("current_xp", difference)
current_xp = self.game:get_value("current_xp")
self.current_xp_displayed = 0
self.current_xp_displayed_length = string.len(self.current_xp_displayed)
    self.game:start_dialog("levelup", current_level + 1, function()
      if self.game:get_max_life(60) then
        self.game:start_dialog("leveluphealthmax", function(answer)
          if answer == 2 then
            self.game:start_dialog("levelupmana", self.game:get_max_magic() + 10)
            self.game:set_max_magic(self.game:get_max_magic() + 10)
            self.game:set_magic(self.game:get_max_magic())
          elseif answer == 3 then
            self.game:start_dialog("levelupstamina", self.game:get_max_stamina() + 10)
            self.game:set_max_stamina(self.game:get_max_stamina() + 10)
            self.game:set_stamina(self.game:get_max_stamina())
        end
      end)
      elseif self.game:get_max_magic(200) then
        self.game:start_dialog("levelupmanamax", function(answer)
          if answer == 2 then
            self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
            self.game:add_max_life(5)
            self.game:set_life(game:get_max_life())
          elseif answer == 3 then
            self.game:start_dialog("levelupstamina", self.game:get_max_stamina(), self.game:get_max_stamina())
            self.game:add_max_stamina(10)
            self.game:set_stamina(game:get_max_stamina())
         end
       end)
      elseif self.game:get_max_stamina(200) then
        self.game:start_dialog("levelupstaminamax", function(answer)
          if answer == 2 then
            self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
            self.game:add_max_life(5)
            self.game:set_life(game:get_max_life())
          elseif answer == 3 then
            self.game:start_dialog("levelupmagic", self.game:get_max_magic(), self.game:get_max_magic())
            self.game:add_max_magic(10)
            self.game:set_magic(game:get_max_magic())
      elseif self.game:get_max_life(60) and
             self.game:get_max_magic(200) then
               self.game:start_dialog("levelupstamina", self.game:get_max_stamina(), self.game:get_max_stamina())
               self.game:add_max_stamina(10)
               self.game:set_stamina(game:get_max_stamina())
      elseif self.game:get_max_life(60) and
             self.game:get_max_stamina(200) then
               self.game:start_dialog("levelupmagic", self.game:get_max_magic(), self.game:get_max_magic())
               self.game:add_max_magic(10)
               self.game:set_magic(game:get_max_magic())
      elseif self.game:get_max_magic(200) and
             self.game:get_max_stamina(200) then
               self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
               self.game:add_max_life(5)
               self.game:set_life(game:get_max_life())
            end
         end)
      else self.game:start_dialog("levelupall", function(answer)
          if answer == 2 then
            self.game:start_dialog("leveluphealth", self.game:get_max_life(), self.game:get_max_life())
            self.game:add_max_life(5)
            self.game:set_life(game:get_max_life())
          elseif answer == 3 then
            self.game:start_dialog("levelupmagic", self.game:get_max_magic(), self.game:get_max_magic())
            self.game:add_max_magic(10)
            self.game:set_magic(game:get_max_magic())
          elseif answer == 4 then
            self.game:start_dialog("levelupstamina", self.game:get_max_stamina(), self.game:get_max_stamina())
            self.game:add_max_stamina(10)
            self.game:set_stamina(game:get_max_stamina())
         end
       end)
end
end)
end
end
#47
Have you tried using sensors?

http://forum.solarus-games.org/index.php/topic,654.msg3356.html#msg3356

I think this might be able to help
#48
Do you have a default block sprite implemented into the game? My editor used to crash when I used the block before I created a sprite for the block.
#49
Your projects / Re: The Legend of Zelda
June 26, 2016, 01:30:05 AM
Sounds like you've been hard at work! Can't wait for a playable demo  ;D
#50
Game art & music / Re: Original art
June 18, 2016, 10:38:19 PM
The castle theme sounds phenomenal how long did it take you to put together?
#51
Hey Diarandor, I just finished listening to your boss theme which I thought was really nice and catchy.  :)

I voted for chip music since for a zelda like game with pixel art, chiptune music is fitting as well as nostalgic. However, a nice twist could be to combine chip and instrumental music using a program like FL Studio which can use chiptune plugins while still having higher quality sounds for some interesting music!
#52
GraphicsGale is also I good program which is what I use for all of my pixel art. The program is completely free, and only costs money if you want to use it to make gifs.

https://graphicsgale.com/us/
#53
Development / Initial game values in zsdx
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?
#54
Development / Re: 2 Item Related Questions
April 06, 2016, 12:40:42 AM
1) No, its like how if push_back is true for an enemy it gets pushed back when attacked. The gust would basically act as a stronger one that pushed the enemy back twice as much as any other attack would.

2) Thats basically what it is. Its similar to something like this: http://zelda.wikia.com/wiki/Blue_Ring and it could have various forms that can cut magic or stamina cost
#55
Development / 2 Item Related Questions
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?
#56
Development / Re: Scrolling dialog selections?
April 04, 2016, 04:31:26 AM
I'm continuing to make a few changes to the dialog box code to make a crafting system smoother. I tried to make it so you can close the dialog box at any time when it is being used for crafting.

Code ( lua) Select
function game:on_key_pressed(key)
  if key == "escape" and
  self.dialog.id == "_crafting" then
sol.menu.stop(dialog_box)
end
game.dialog_box = nil
end


I'm getting the error Error: In on_key_pressed: [string "scripts/dialog_box.lua"]:149: attempt to inde
x field 'dialog' (a nil value)

I was trying to test the code using a dialog called "give_crafting" so I'm unsure why dialog would be a nil value
#57
Development / Re: Scrolling dialog selections?
April 02, 2016, 12:25:43 AM
I was able to get the dialog box to function properly. It has Diarandor's animations and colors as well as the ability the make more than 2 answers to questions from the Return of the Hylian

https://github.com/Star-Lock/LongSteel/blob/master/dialog_box

#58
Development / Re: Scrolling dialog selections?
March 20, 2016, 10:18:11 PM
Yes

Error: In timer callback: [string "scripts/dialog_box.lua"]:492: attempt to index local 'text_surface' (a nil value)

Sorry I forgot to write that in originally

EDIT: github link to full code     https://github.com/Star-Lock/LongSteel/blob/master/dialog_box
#59
Development / Re: Scrolling dialog selections?
March 20, 2016, 08:09:28 PM
I've started to work on it by making a hybrid between the zelda roth and zsdx dialog boxes. I can get the box to appear, but it's giving me an error about the text_surface on this chunk of code...
Code ( lua) Select
    if not special then
   
    text_surface:set_text(text_surface:get_text() .. current_char)
   

    -- If this is a multibyte character, also add the next byte.
    local byte = current_char:byte()
    if byte >= 192 and byte < 224 then
      -- The first byte is 110xxxxx: the character is stored with
      -- two bytes (utf-8).
      current_char = line:sub(self.char_index, self.char_index)
      self.char_index = self.char_index + 1
      text_surface:set_text(text_surface:get_text() .. current_char)
    end


I'm a bit confused as to why it doesn't work when text_surface is used earlier in the code with no problem

EDIT: I would've posted the full code, but it was over the limit  :-\
#60
Development / Teletransporter item
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