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.


Messages - Miguelink 64

Pages: [1]
1
Your scripts / Re: Simple Leveling up system
« on: March 12, 2019, 07:11:10 pm »
I haven't read the whole API for LUA, that's why I thought it only accepted intergers, thanks for the feedback  ;D

2
Your scripts / Re: Simple Leveling up system
« on: March 08, 2019, 04:51:19 pm »
I didn't knew the exact amount needed to get that level, linear growing could be a good solution, but exponential is one most RPGs uses, since Lua only accepts intergers, that's the lowest I could get without getting too arithmetic to make a proper exponential growth,  thanks

3
Your scripts / Simple Leveling up system
« 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.

4
Your projects / Re: The legend of Zelda alttp Taizo Demo
« on: March 02, 2019, 03:19:38 am »
Ah, I misunderstood "hard version of ALTTP". Good choice, I think, and a great way to learn. If you didn't already hear, there's a discord many people are active on if you can't find any answers in the forums : )

If you could give an invite it would be cool

5
Your projects / Re: The legend of Zelda alttp Taizo Demo
« on: March 01, 2019, 08:31:31 pm »
Nice, looks like a great start! You've already got a lot of things working, looks like you're coming along!

A little feedback I have is that a remake of the entirety of ALTTP is quite a lot for a first project. Smaller projects, in my experience, are more likely to get finished.

Oh nonono, it's not a remake, it's actually a small project, just using alttp things to learn before going with a bigger project, most likely will be 2-3 dungeons and that's it
Thank you very much for your feedback!

6
Your projects / The legend of Zelda alttp Taizo Demo
« on: March 01, 2019, 04:06:24 pm »
As a first Project, I'm making a hard versión of alttp, I don't know a lot of programming but that doesn't stops me wanting to learn more.

Anyways, here is a link to a teaser I made for the demo: https://www.youtube.com/watch?v=RK-2-4Up9lc

Feed back is apreciated.

7
Your scripts / Simple dialog pause menu
« on: November 13, 2018, 09:20:47 pm »
Hi, I'm new in programming and I've recently discovered solarus, I've seen all Cristopho's tutorials so I started to make my own game, since Cristopho doesn't explain how to make a pause menú (only how to save with dialogs) I decided to make my own pause menu, but i lack the knowledge to do it, so i made a simple one that doesn't require to code a menu, only using the alttp dialog box system the pack already has, this is the code.


Code: ( lua) [Select]
  -- Event called when the game pauses
  function game:on_paused()
 
    game:start_dialog("pause.menu.question",function(answer) -- Opens the "menu"
 
        if answer == 1 then -- Items
 
          if game:has_item("boomerang") == true then -- Checks if you have an item
 
            game:start_dialog("pause.menu.items.1",function(answer) -- Shows item
 
              if answer == 1 then
 
                game:set_item_assigned(1,game:get_item("boomerang")) -- Assigns selected item to Slot 1
 
                sol.audio.play_sound("danger")
 
                game:set_paused(false)
 
              end
 
            end)
 
          else -- If you don't have items at all
 
            game:start_dialog("pause.menu.items.no_items")
 
            game:set_paused(false)
 
          end
 
        end
 
        if answer == 2 then -- Save and continue
 
          game:save()
 
          sol.audio.play_sound("danger")
 
          game:set_paused(false)
 
        end
 
        if answer == 3 then -- Save and Quit (Closes the game)
 
          sol.audio.play_sound("danger")
 
          game:save()
 
          sol.main.exit()
 
        end
 
        if answer == 4 then -- Continue
 
          sol.audio.play_sound("danger")
 
          game:set_paused(false)
 
        end
 
      end)
 
   end


If you want to copy it, paste it on the game_manager.lua script, under game:start() , add some dialog on your languages folder using the $? thing to make selectable text and thats it.
The only thing is that you must have to collect the equipment in order, and add a new dialog with all previous ítems + the new one, also do a new if-else over the already writen code, but at least you now have your pause menu. ;)

8
Development / Simple Dialog Pause Menu
« on: November 13, 2018, 04:14:09 pm »
Hi, I'm new in programming and I've recently discovered solarus, I've seen all Cristopho's tutorials so I started to make my own game, since Cristopho doesn't explain how to make a pause menú (only how to save with dialogs) I decided to make my own pause menu, but i lack the knowledge to do it, so i made a simple one that doesn't require to code a menu, only using the alttp dialog box system the pack already has, this is the code.


Code: ( lua) [Select]
  -- Event called when the game pauses
  function game:on_paused()
 
    game:start_dialog("pause.menu.question",function(answer) -- Opens the "menu"
 
        if answer == 1 then -- Items
 
          if game:has_item("boomerang") == true then -- Checks if you have an item
 
            game:start_dialog("pause.menu.items.1",function(answer) -- Shows item
 
              if answer == 1 then
 
                game:set_item_assigned(1,game:get_item("boomerang")) -- Assigns selected item to Slot 1
 
                sol.audio.play_sound("danger")
 
                game:set_paused(false)
 
              end
 
            end)
 
          else -- If you don't have items at all
 
            game:start_dialog("pause.menu.items.no_items")
 
            game:set_paused(false)
 
          end
 
        end
 
        if answer == 2 then -- Save and continue
 
          game:save()
 
          sol.audio.play_sound("danger")
 
          game:set_paused(false)
 
        end
 
        if answer == 3 then -- Save and Quit (Closes the game)
 
          sol.audio.play_sound("danger")
 
          game:save()
 
          sol.main.exit()
 
        end
 
        if answer == 4 then -- Continue
 
          sol.audio.play_sound("danger")
 
          game:set_paused(false)
 
        end
 
      end)
 
   end


If you want to copy it, paste it on the game_manager.lua script, under game:start() , add some dialog on your languages folder using the $? thing to make selectable text and thats it.
The only thing is that you must have to collect the equipment in order, and add a new dialog with all previous ítems + the new one, also do a new if-else over the already writen code, but at least you now have your pause menu. ;)

Pages: [1]