Recent Posts

Pages: 1 ... 8 9 [10]
91
Your scripts / Re: Custom delay for dialogs
« Last post by froggy77 on March 06, 2019, 09:53:50 pm »
Thank you for sharing. This little effect for the dialog box is a good idea.
92
Your scripts / Custom delay for dialogs
« Last post by boaromayo on March 06, 2019, 02:22:36 pm »
This feature took two and a half hours of programming and testing last night to get this right, but here it is!

I made some modifications to the dialog_box.lua script in the Solarus 1.6 sample quest. For this script add-on, the dialog can pause for any amount of time instead of using the default dialog box script, which only allows for a 1-second delay.

To get this working, use the '$' character, along with the '|' (pipe) character, then in between brackets, set the amount of time (in milliseconds) the dialog is paused, like so:

$|[sec]: the delay in milliseconds (Don't forget the '|' character!)

Sample dialog here:
Code: [Select]
dialog{
  id = "beavers.eater.1",
  text = [[
$|\[500\].$|\[1000\].$|\[1000\].$|\[1000\]I was hungry.
]]
,
}

Note: When editing the dialogs.dat file directly, you will have to type a backslash before putting in the brackets. When handling it in the editor, it's not needed.

Here is the script in action:



The modified dialog box.lua script is attached below (script is under the GNU GPL v3 license, script author by Christopho, special thanks to him!).
93
Your projects / Re: Solarus - ZL project
« Last post by froggy77 on March 05, 2019, 10:57:20 pm »
Preview for the second one that I named 'Monster' :-[ The sprite sheet and date files will be posted certainly tomorrow.In fact, this monster looks a lot like the original made by LUNARSIGNALS. It's a kind of Yokai.

Quote
EDIT: Voilà! See attachment files.



94
Your scripts / Simple Leveling up system
« Last post by Miguelink 64 on March 05, 2019, 05:31:12 am »
Hello, while I was doing my homework I got an idea from a simple algorithm I solved in my head (I get really bored making homework), I coded it, put it to test and everything works fine. Since I won't use it for my game, I'll share it here in case someone else who is new on programming (like me) or just too lazy wants to add a leveling system to their game, here it is:


Code: [Select]
-- Leveling up System by Miguelink 64.

-- First make a leveling up item on your items folder, I used a +2 to max hp for every level up.
-- heart_container
local item = ...
local game = item:get_game()

function item:on_obtaining()
  game:add_max_life(2)
  game:set_life(game:get_max_life())
end

-- Add to your dialogs a _treasure dialog for the item, mine says "Level up!".

-- You must copy this script to your enemies you want to give you exp.
local exp = 1 -- Change this to the wanted experience given by killing the enemy.

function enemy:on_dead()
  if game:get_value("level") ~= game:get_value("max_level") then
    game:set_value("experience",game:get_value("experience") + exp)
    if game:get_value("experience") >= game:get_value("max_experience") then -- Checks if you can level up
      hero:start_treasure("heart_container") -- You can change this for your leveling up item.
      game:set_value("max_experience",game:get_value("max_experience") * 2) -- Doubles the amount needed to level up next time.
      game:set_value("experience",0) -- Resets experience
      game:set_value("level",game:get_value("level") + 1) -- Level up
    end
  end
end

-- You must copy this script to your initial game script under
-- function initial_game:initialize_new_game(game)
  game:set_value("max_experience",50) -- Max experience needed to level up from level 1 to level 2
  game:set_value("experience",0) -- Creates experience
  game:set_value("max_level",20) -- Max level achievable
  game:set_value("level",1) -- Start at level 1

Welp, have fün.
95
Bugs & Feature requests / Re: Cut Vines
« Last post by llamazing on March 05, 2019, 01:26:51 am »
Syntax highlighting is actually broken on the forums right now...
96
Development / Re: Question on "open" animation of doors
« Last post by froggy77 on March 04, 2019, 10:27:34 pm »
Ok thanks, I will have to find a solution for this.
97
Your projects / Re: Solarus - ZL project
« Last post by froggy77 on March 04, 2019, 10:05:28 pm »
Preview of the first dungeon door that I will post normally tomorrow. Just a few final checks before posting the sprite sheet.
I'm inspired by a creation of LUNARSIGNALS (on OGA; see https://opengameart.org/content/overhead-action-rpg-forest).
The other two dungeon entrances will be posted after and are more similar to her/his work.They are doors and enemies at the same time.

It is a kind of teaser  ;) in a 400% zoom.

Quote
EDIT: Voilà. See attachment files. boss_slime.dat sholud be placed in a folder named "enemies. The other two dat files should be place with "doors"

Quote
EDIT2: New dungeon_door_slime_dat_files.zip, because "dying" animation should not loop in boss_slime.dat


The same monster but when it has  been defeated:

98
Bugs & Feature requests / Re: Cut Vines
« Last post by Max on March 04, 2019, 07:10:59 pm »
Yeah, of course! : )

Lots of that kind of different perspectives and ideas just comes from familiarity with the toolset of the API, it'll come in time!
100
Bugs & Feature requests / Re: Cut Vines
« Last post by gmanplays@gmail.com on March 04, 2019, 06:44:07 am »
See, that's why I come here. I would've never thought to use another type of enemy because of my association of (practically) inanimate vines with the inanimate hammer pegs. No, there wasn't I was just making an effort. Thanks for giving me the perspective, and I'll make sure to color-code next time.
Pages: 1 ... 8 9 [10]