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 ... 35
1
Your projects / Re: Children of Solarus [official thread]
« on: January 16, 2018, 06:06:20 pm »
Ah yes, Children of Solarus, I remember this. Mercuris Chest will be released first, in 2044, right ?

Looking forward to this, so it's mostly a rework of MoS DX with new stuffs rather then a straight assets mod ?

Understood ? Solarus team are SECRETLY working on a new site, it's a secret to everybody

2
Development / Re: Receptacle
« on: January 16, 2018, 05:59:58 pm »
J'avais ce genre d'erreur mais ça remonte, surement un truc dans ton code, peux tu le montrer ?

3
Development / Re: Bouger la caméra
« on: December 31, 2017, 04:10:31 pm »
Oui, il faudrait que tu apprennes le LUA afin d'y connaitre les bases.
Tu devrais suivre les tutoriaux de Christopho, ca peut parfaitement aider a maitriser et l'éditeur, et le LUA dans une forme basique

https://www.youtube.com/watch?v=rsammSHv7xc&index=1&list=PLzJ4jb-Y0ufzB4nXkSINFhbrtLlnlI4li

4
Your projects / Re: Project Z2R
« on: December 26, 2017, 05:03:54 pm »
The full AoL map consists of 169x118 tiles (of course a lot of that is ocean). Although the map from AoL contains the full map for LoZ, so the scale is obviously much larger than LttP.

There is one missing thing in the AOL map image, the labyrinth before the last palace

For the map size you have 2 solutions

Map the whole map into 1 single huge map (You are prone to lags if you put a lot of entities, rare in Solarus but it can still happen)
"Segment" the maps by linking maps each other

Start with the basic 320x240, then resize the map to your needs, it's fairly easy on Solarus

5
Development / Re: Bouger la caméra
« on: December 23, 2017, 05:53:48 pm »
Tu as plusieurs facon de faire.

Dans solarus < 1.5, tu peux utiliser une fonction hardcodée map:move_camera
Dans les futures versions, il me semble que cette fonction n'existera plus mais tu peux cependant la coder et modifier son comportement comme bon te semble

On te conseilleras d'utiliser les metatable comme le script ci-dessous

Copies ce code, enregistre le script et dans main.lua, utilise require()

Code: Lua
  1. local map_metatable = sol.main.get_metatable("map")
  2.  
  3. -- Move the camera
  4. function map_metatable:move_camera(x, y, speed, callback, delay_before, delay_after)
  5.   local camera = self:get_camera()
  6.   local game = self:get_game()
  7.   local hero = self:get_hero()
  8.  
  9.   delay_before = delay_before or 1000
  10.   delay_after = delay_after or 1000
  11.  
  12.   local back_x, back_y = camera:get_position_to_track(hero)
  13.   game:set_suspended(true)
  14.   camera:start_manual()
  15.  
  16.   local movement = sol.movement.create("target")
  17.   movement:set_target(camera:get_position_to_track(x, y))
  18.   movement:set_ignore_obstacles(true)
  19.   movement:set_speed(speed)
  20.   movement:start(camera, function()
  21.     local timer_1 = sol.timer.start(self, delay_before, function()
  22.       callback()
  23.       local timer_2 = sol.timer.start(self, delay_after, function()
  24.         local movement = sol.movement.create("target")
  25.         movement:set_target(back_x, back_y)
  26.         movement:set_ignore_obstacles(true)
  27.         movement:set_speed(speed)
  28.         movement:start(camera, function()
  29.           game:set_suspended(false)
  30.           camera:start_tracking(hero)
  31.           if self.on_camera_back ~= nil then
  32.             self:on_camera_back()
  33.           end
  34.         end)
  35.       end)
  36.       timer_2:set_suspended_with_map(false)
  37.     end)
  38.     timer_1:set_suspended_with_map(false)
  39.   end)
  40. end

Donc, dans ton script, tu devrais utiliser

Code: Lua
  1.   function Switch_a:on_activated()
  2.     local b3_door = map:get_entity("Porte_b_3") -- ?
  3.     local x, y = map:get_entity("Porte_a"):get_position()
  4.     local speed = 90
  5.  
  6.     map:move_camera(x, y, speed, function()  
  7.       sol.audio.play_sound("door_open")
  8.       sol.audio.play_sound("secret")
  9.       map:open_doors("Porte_a")
  10.     end, 1000, 1000)
  11.   end
  12.  

6
General discussion / Re: Aide ennemie mur capteur
« on: December 23, 2017, 12:15:28 am »
Isn't this feature used in ROTH SE ? I remember that enemies reset position when separators has been activated
Else, you might have to deal with distance to trigger ennemies but i'm pretty sure that what you're searching exists in ROTH SE

check for separator_manager.lua or something like this

7
Development / Re: Lanterne qui illumine autour de links
« on: December 18, 2017, 06:27:23 pm »
My system doesn't exactly meet your criteria, but it could be a starting point that you could customize. Of note in my system, the lantern does not need to be equipped in order to offer the glow at night/dawn/dusk and the intensity does not change based on magic level.

Oddly I have to rework my lantern item completely that should meet his criteria, probably not the intensity because it can't be changed, maybe this can be done using shaders (if I take as example the video bellow), but that's an upcoming feature.

https://www.youtube.com/watch?v=1cpJ6q9ppuE

8
Your scripts / Re: [WIP] Ceiling dropping effect (ALTTP)
« on: December 17, 2017, 03:39:42 pm »
I like this script, I'm using it but it have the limitation to be only available for the hero

I am currently working on this kind of script as well, this time, all entities are able to use this ability (enemies, hero, custom entities)

This is not perfect as it might lead to problems currently but it mostly works
Entity's real position remains intact, only their sprites are being moved

Code: Lua
  1. local object = {}
  2.  
  3. -- Falling from ceiling
  4. -- Works with any type of entity
  5. -- Version 0.1 - MetalZelda
  6.  
  7. --[[
  8.   Make it work:
  9.  
  10.   - Save this script anywhere you want
  11.   - In any script (metatable script is better):
  12.  
  13.   Example: I want to make this available for the hero
  14.   local fall_manager = require("path_to_the_script")
  15.   fall_manager:create("hero")
  16.  
  17.   Recommended way to make this work:
  18.   -> in main.lua
  19.  
  20.   local fall_manager = require("path_to_the_script")
  21.   local entities_fall_compatibility = { "hero", "enemy", "npc"}
  22.   for _, entities in ipairs(entities_fall_compatibility) do
  23.     fall_manager:create(entities)
  24.   end
  25.  
  26.  
  27.   Careful, it only work with map entities
  28.  
  29.   To active it, simply call
  30.     - hero:fall_from_ceiling(height, sound, callback) where
  31.          
  32.           height = the height of the falling things (must be positive)
  33.           sound = any sound you wanna play when the falling animation starts
  34.           callback = what to do when it finished (text, cutscene, death, etc)
  35.          
  36.         - Remember that you can implement it anywhere else, the target only need to be an entity / sprite
  37. ]]
  38.  
  39. function object:create(meta)
  40.   local object_meta = sol.main.get_metatable(meta)
  41.   local currently_falling = false
  42.  
  43.   function object_meta:fall_from_ceiling(height, sound, callback)
  44.     currently_falling = true
  45.        
  46.         if meta == "hero" then
  47.           -- This means that self returns the hero entity, avoid him from moving.
  48.           self:freeze()
  49.         end
  50.        
  51.         -- Get the current object position
  52.         local cx, cy, clayer = self:get_position()
  53.         local map = self:get_map()
  54.        
  55.         -- Draw a shadow in the entity's real position
  56.         local shadow = map:create_custom_entity({
  57.           x = cx,
  58.           y = cy,
  59.           layer = clayer,
  60.           width = 16,
  61.           height = 16,
  62.           sprite = "entities/shadow",
  63.           direction = 0
  64.         })
  65.        
  66.        
  67.         local first_active_sprite = nil
  68.        
  69.     -- Depending on things, obejct might have different sprite that is synchronized to him
  70.         for sprite_name, sprite in self:get_sprites() do
  71.           sprite:set_xy(0, -height)
  72.          
  73.           if first_active_sprite ~= nil then
  74.             first_active_sprite = sprite_name
  75.           end
  76.         end
  77.        
  78.         local target_sprite = self:get_sprite(first_active_sprite)
  79.        
  80.         if sound ~= nil then
  81.           sol.audio.play_sound(sound)
  82.         end
  83.        
  84.         local movement = sol.movement.create("straight")
  85.         movement:set_max_distance(height)
  86.         movement:set_angle(3 * math.pi / 2)
  87.         movement:set_speed(300)
  88.         movement:set_ignore_obstacles(true)
  89.         movement:start(target_sprite, function()
  90.           -- Movement finished, disable the falling movement
  91.           first_active_sprite = nil
  92.           currently_falling = false
  93.  
  94.           sol.audio.play_sound("hero_lands")
  95.          
  96.           if meta == "hero" then
  97.             self:unfreeze()
  98.           end
  99.          
  100.           if callback ~= nil then
  101.             callback()
  102.           end
  103.          
  104.           shadow:remove()
  105.         end)
  106.        
  107.         local entity = self
  108.        
  109.         -- Notify the game to synchronize all sprites during the freefall movement if any
  110.         function movement:on_position_changed()
  111.           local x, y = target_sprite:get_xy()
  112.          
  113.           local animation = shadow:get_sprite():get_animation()
  114.           local current_height = -y
  115.          
  116.           -- Adding some shadow stuff here
  117.  
  118.           if current_height == height / 1.5 then
  119.             if animation ~= "demi" then
  120.                   shadow:get_sprite():set_animation("demi")
  121.                 end
  122.           elseif current_height == height / 4 then
  123.             if animation ~= "big" then
  124.                   shadow:get_sprite():set_animation("big")
  125.                 end
  126.           end
  127.          
  128.           -- Depending on things, obejct might have different sprite that is synchronized to him
  129.           for _, sprite in entity:get_sprites() do
  130.             sprite:set_xy(x, y)
  131.           end
  132.          
  133.         end    
  134.   end
  135. end
  136.  
  137.  
  138. return object

This way, you can still use the ability to start the animation on the player when falling from a hole (using map:on_started(destination)), plus you can use it to create falling enemies
Plus, sprites synchronised to an entity will follow the falling movement (hero's shield for example)
You can also make a timer to make the hero to change direction a la ALTTP, there is a local variable that return whever or not the entity is falling or not

Upcoming update will include ground detection, mostly to use a different landing sound depending on the terrain

9
Development / Re: Lanterne qui illumine autour de links
« on: December 17, 2017, 01:49:37 pm »
Yo'

Tu peux toujours regarder comment çe système fonctionne sur le jeu Book of Mudora, Wrightmat utilise ce système (basé sur un système jour - nuit)

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

Si tu cherches un système plus simple (à la ALTTP), regarde du coté de Mystery of Solarus DX

En principe, ce systeme est simple:

- Tu crées une surface avec le contour de la lanterne
- Tu dessines cette surface relative a la position (et direction) du héros

10
Development / Re: Randomnize table ?
« on: December 10, 2017, 05:33:28 pm »
That depends on what you want to do.

1) If you want to show only the treasure of the chest you opened and not the others, then you only need a random number between 1 and #minigame_prizes (remember to rename your list "minigame_prices" to "minigame_priZes", because it's not the same thing). You can use:
Code: [Select]
local index = math.random(1, #minigame_prizes)
local prize = minigame_prizes[index]

2) If you want to show where all prizes are after you open the chest, then you need to code a random permutation. I would use the "Knuth shuffles" permutation algorithm (it is very simple and the code is short); you can adapt the code from here:
https://en.wikipedia.org/wiki/Random_permutation
You can either permute the prizes list directly, or permute a list with numbers from 1 to #minigame_prizes and then use the permuted indices list to associate the prizes to the corresponding chests.

We all enjoy games with chests. Does that mean we are all perverts?  :o

Yes, that's the way I wanna go
I did found some workaround by setting a random treasure at chest opening sequence

Code: Lua
  1. -- Define what happen when the player tries to open a chest
  2. -- Since chests are empty (no treasure), that makes things easier
  3. for chests in map:get_entities_by_type("chest") do
  4.   chests.on_opened = function()
  5.     if minigame_state == "end" then
  6.       sol.audio.play_sound("error")
  7.       game:start_dialog("minigame.chest.need_pay", function()
  8.         sol.audio.play_sound("objects/minecart/landing")
  9.         chests:set_open(false)
  10.         hero:unfreeze()
  11.       end)
  12.     else
  13.       local rng = math.random(1, #minigame_prizes)
  14.       rng = minigame_prizes[rng]
  15.  
  16.       local treasure, variant, savegame = rng[1], rng[2], rng[3]
  17.       hero:start_treasure(treasure, variant + 1, savegame, function()
  18.         game:start_dialog("minigame.chest.finished")
  19.       end)
  20.       minigame_state = "end"
  21.      
  22.     end
  23.   end
  24. end

I don't know if there's a better way to do so, since rng only applies when the choosen chest has been opened
Oh well, it does what I wanted

Y'all love chests chest is love chest is life :o

11
Development / Randomnize table ?
« on: December 10, 2017, 02:31:53 pm »
Hello

Today I am mostly programming minigames, one of which is based on ALTTP.
But, I have taken another view of how the minigame would work.
Winnable items are shown before the game starts like so



Then a movement starts on winnable item's entity and the minigame starts.

This leads me to this question to make the minigame more dependant of an RNG (Random Number Generator) to make the minigame a bit more difficult
Winnable items are stored in a table

Code: Lua
  1. local minigame_prices = {
  2.   {"rupee", 0},
  3.   {"amber_counter", 0},
  4.   {"green_chuchu_counter", 0},
  5.   {"heart_piece", 0},
  6.   {"arrow", 0},
  7.   {"rupee", 3},
  8.   {"heart", 0},
  9.   {"rupee", 5},
  10.   {"rupee", 2},
  11. }

Basically, it is

[chest 1] treasure = rupee, variant = 0

All I want is

[chest (random 1 - 9)] treasure = rupee, variant = 0

Any idea of how to make it happen ?

12
Your scripts / Re: Archery Minigame / Mini-jeu de tir à l'arc
« on: December 10, 2017, 12:55:59 pm »
I like how it's done, it reminds me of a shooting game in Anciant Stone Tablets

13
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 !

14
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



15
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

Pages: [1] 2 3 ... 35