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

Pages: [1] 2 3 ... 34
Your scripts / Re: New rain script
« on: November 18, 2017, 01:14:59 pm »
It is much better now, this is awesome, thanks for this awesome script !

Your scripts / Re: New rain script
« on: November 14, 2017, 04:26:24 pm »
Yes, snow should not be harder than this. But better to make it in a different script because the rain script is already very complex due to the smooth transition between different rain modes (the rain drop number and their properties, and the darkness value, vary very smoothly). If you can wait for Christmas holidays, I will probably make the snow script for then.

Snow can be easy to make, just by editing the rain script, it tooks me around 5 minutes to make sprites and edit stuffs and the result is ok (if you take out the green terrain which don't fit the snow weather)
The snow effect is better with the drop deviation variable

Great thing is, it is really easy to include the weather script with my day / night cycle, I don't see any problem so far

Your scripts / Re: New rain script
« on: November 12, 2017, 07:10:34 pm »
Oh wow, definately gonna use it for my project, this is gonna serve environment purpose I've tough some time ago
Wonder if other effects can be achieved just by modifying your script (snow)

Gonna look around if this script can fit in my Day / Night script

Development / Re: Variable music.
« on: November 01, 2017, 11:55:42 pm »
I should go like this

In your music directory, name your music like so 'music_name_0, music_name_1', etc, etc

In your code

Code: Lua
  1. local music = math.random(0, x) -- Where X = number of music with as name "music_name_"
  2. local function play_music()
  3."music_name_" .. music, function()
  4.     -- Re-random the music
  5.     -- Get the old number
  6.     local old = music
  8.     -- Set a new random value
  9.     music = math.random(0, x)  -- Where X = number of music with as name "music_name_"
  11.     -- Avoid repetition
  12.     if music == old then
  13.       -- Re-random the music number
  14.       music = math.random(0, x)  -- Where X = number of music with as name "music_name_"
  15.     end
  17.     -- Call the function to play another music
  18.     -- Remark, if you use "LOOPSTART" in the music metadata, the callback (this code essentially) will never be called.
  19.     play_music()
  20.   end)
  21. end
  23. -- Start the music. The only way to cancel the phase is to use
  24. play_music()

That's basic stuff but that's the way to go essentially.

If you want to play specific tracks rather than random one, you can do the same thing, just replace music = math.random(0, x) by music = (music + 1) % x (replace x by the number you want, this is the number of tracks you wanna play)

Development / Removing a sprite created through sol.sprite.create ?
« on: October 08, 2017, 05:18:54 pm »

I'm having troubble with cutscenes and sprites management.
I am currently making sage cutscenes with as inspiration ALTTP, but, after a while, the crystal around the sage needs to be removed

The sprite creation is a bit different because the cutscene starts immediately after the boss died, a surface fades to accomplish the black background, a menu handles the whole cutscene (mostly to overwrite and avoid pausing / moving, doing actions during cutscene)

Sprites are created in this order

black surface
Link sprite
Sage sprite
Crystal sprite

All created by sol.surface / sprite.create

But, calling

Code: [Select]
this happen

Code: [Select]
Error: In timer callback: [string "maps/cutscene_data/SageScene_0.lua"]:95: attempt to call method 'remove' (a nil value)
I can't use map entities because the menu is started above everything on the map, entities are not visible during the cutscene because of the background surface
Which confuse me a bit, we can't remove a sprite ?

Bugs & Feature requests / Re: Hero scaling
« on: September 24, 2017, 11:39:43 pm »
The thing is scale2x or hq2x actually does what you want, 2x bigger sprites.

The interesting thing would be manually configure the hero's hitbox width and height, I think the hitbox is a 16x16 and non-customizable at the moment

Your scripts / Re: Fractals !
« on: September 24, 2017, 11:36:16 pm »
Interesting concept, I've always been amazed by fractals

Your scripts / Re: Turtle Rock (Alttp) Pipe system
« on: September 07, 2017, 10:01:33 am »
Code: [Select]
Wait such thing is possible ?

Development / Re: Multiple ground sprites?
« on: September 01, 2017, 12:13:42 am »
Should be fairly possible with greyscaled sprite

This is the cheapest solution I have in mind

Development / Re: How to use: chest:on_opened() ?
« on: July 11, 2017, 06:40:12 pm »
Thank for the answere
With this code
Code: [Select]
function sword_chest:on_opened(sword, 1, "sword_chest_save")
  chest_open = chest_open + 1

I have another error
Error: Failed to load script 'maps/dungeons/tuto/place_holder': [string "maps/dungeons/tuto/place_holder.lua"]:5: <name> or '...' expected near '1'

I don't understand why...

Do like this
Don't know if this will work because I never use chest:on_opened() but that's the way to go

Code: Lua
  1. function sword_chest:on_opened(item, variant, savegame)
  3.   if item:get_name() == "sword" then
  5.   end
  6. end

Development / Re: How to use: chest:on_opened() ?
« on: July 11, 2017, 02:23:55 pm »

The first argument need to be an item, what you've done is that the first argument is a string

General discussion / Re: Le défi de Zeldo : La vengeance du bingo
« on: July 03, 2017, 01:51:22 am »
From what I've seen this is a big Zelda-1 like labyrinth
Looks like it has been made by ZeldoRetro

Reminds me of Darunia's Cavern from Parallel Worlds as well

Your scripts / Re: fog: Add fog to your map !
« on: July 02, 2017, 05:11:21 pm »
I created a much simpler way to add fog to your maps, using a singular overlay that is built right into my tileset, that uses parallax scrolling.  Simply take it, and (if you like, any one of the semi-transparent tiles located at the top of the tileset, fit it over the entire map, making sure it is on the highest layer, separate from all other tile patterns.  You may choose to make it dynamic (in case you want to have a script attached to it, for instance, creating a fog overlay for before the hero obtains the master swordd, and then having it destroyed or not created when he has it).

That's another way to use it, this script is for permanent overlays from map creation to map destruction (I might update it one day)
This is also for minish cap styled fog, like sunrays or fire haze (ie. with opacity variation)
But I think both of our methods can be replaced by shaders when this will be possible  :P

Development / Re: Trouble porting a script
« on: July 02, 2017, 03:47:13 pm »
Somehow I got the thing to work properly, I don't even know how

Code: Lua
  1. function submenu:set_cursor_position(command)
  2.   -- Initialize variables for the weightings on the vertical and horizontal
  3.   -- directions
  4.   local wv, wh = 0, 0
  5.   -- The weightings for the secondary and primary axis relative to input
  6.   local w1, w2 = 1, 2
  8.   local input = -1
  9.   if command == "right" then
  10.     input = 0
  11.   elseif command == "up" then
  12.     input = 1
  13.   elseif command == "left" then
  14.     input = 2
  15.   elseif command == "down" then
  16.     input = 3
  17.   end
  19.   if input == -1 then return end
  21.   -- Setup the weightings for each direction
  22.   if  (input == 1 or input == 3) then
  23.         wv, wh = w1, w2
  24.   elseif (input == 0 or input == 2) then
  25.         wv, wh = w2, w1
  26.   end
  28.   local width =
  29.   width = width / 2 - 160
  31.   local current_x = self.cursor_position.x
  32.   local current_y = self.cursor_position.y
  34.   -- Create default value for the closest item's distance
  35.   local closest_index = -1
  36.   local closest_distance = 9999999
  37.   local index = self:find_item(self:find_item_axis(current_x, current_y))
  39.   for i, item in ipairs(self.items) do
  40.     local item_x = item.x
  41.     local item_y = item.y
  43.     --  Skip if it is the old item or is in the opposite direction
  44.     if index ~= i and (input ~= 3 or item_y >= current_y) and (input ~= 2 or item_x <= current_x) and (input ~= 0 or item_x >= current_x) and (input ~= 1 or item_y <= current_y) then
  45.       -- Get the distance of the current item and the new one
  46.       local dist_h = math.abs(item_x - current_x)
  47.       local dist_v = math.abs(item_y - current_y)
  49.       if (wh ~= w1 or w2 * dist_h >= dist_v) and (wv ~= w1 or w2 * dist_v >= dist_h) then
  50.         -- # Get the distance multiplied with their weightings
  51.         local dist = (dist_h * wh + dist_v * wv)
  53.         -- # Set at closest item if appropriate
  54.         if (dist < closest_distance) then
  55.           closest_distance = dist
  56.           closest_index = i
  57.         end
  58.       end
  59.     end
  60.   end
  62.   if closest_index == -1 then return end
  64.   local item = self.items[closest_index]
  65.   local x = item.x
  66.   local y = item.y - 5 
  68.   self.cursor_position = {x = x, y = y + 5}
  69.   self.cursor_sprite_x = x + width
  70.   self.cursor_sprite_y = y
  71."action", item.effect)
  73.   self:set_caption(self.caption_text_keys[caption_item])  
  74. .. "_last_index", closest_index)
  75. end

There is still some problem regarding some items but that's because I use some wizzard stuffs, for example, you need a separate item for each tunic variant, else it will be stuck on the tunic.

What makes this useful is, the simpliciity of menu customisation, you just have to put a x and y value for your item, the script determine the input pressed and stuffs, instead of using cursor position stuffs

This was my Quest status menu before the change

Notice how it is done ... Manually by stuffs

Now, it just looks like this

All of my menues now run this code

The pro is that it is easier to make and place objects in the menues, the cons is that every objects need to be an item

Development / Re: Trouble porting a script
« on: June 29, 2017, 05:54:36 pm »
Do  you have a sample project available? It's a bit hard to troubleshoot from the forum.

Also double-check that I negated those if statements correctly.

I will upload a sample demo tomorrow, i'm currently very busy

Pages: [1] 2 3 ... 34