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

#451
Development / Re: [solved]Npc custom size
January 04, 2016, 11:15:44 PM
You can custom entity the NPC, it would be the same thing, but you would be allowed to change various parameters suh as his size, bounding box, origin, etc. The best thing about it is that you don't have to find through your game database about the map where the NPC is to change a variant, everything can be done in a single file in /entities. And it doesn't impact any performance.

Code (lua) Select

local entity = ...
local game = entity:get_game()

--Shared NPC. The dialog pointer = the name of the entity in the map (in the editor).
--If you want all NPC to have a movement then create the movement in on_created()

function entity:on_created()
-- here, self is the entity
self:set_size(24,24) -- only multiple of 8 are allowed
self:set_traversable_by("hero", false)
end

local  hero_facing_npc = false
local action_command_speak = false

-- Hud notification
entity:add_collision_test("facing", function(entity, other)
if other:get_type() == "hero" then
   hero_facing_npc = true
  if hero_facing_npc then
    game:set_custom_command_effect("action", "open")
action_command_npc = true
   else
    game:set_custom_command_effect("action", nil)
   end
end
end)

function entity:on_interaction()
self:set_direction(game:get_hero():get_direction() / 2)
game:start_dialog(self:get_name())
end

function entity:on_update()
  if action_command_speak and not hero_facing_npc then
    game:set_custom_command_effect("action", nil)
    action_command_speak = false
  end
   hero_facing_npc= false
end


Not tested, but it act like the build in NPC class. The only thing is that you need to code it's behaviour if you wanna make your NPC more smart.
Remember that size of objects need to be a multiple of 8.
#452
Development / Re: Different crystals for every dungeon
January 03, 2016, 02:09:54 PM
The other way is to use tileset.entities.png and then make every crystals sprite in these files, it should work (since he wants to use a different sprite for each dungeon, so I'm considering that each dungeon have a different tileset).
Change image source to "tileset"
#453
Development / Re: Bomb Soldiers?
January 02, 2016, 06:03:48 PM
You can do like the greenknightsoldier.lua script.
But instead of going through the hero, you can make a movement that goes backward, and then at the end of the movement, make the ennemy arrow.
For the bomb, there is a map:create_bomb() (http://www.solarus-games.org/doc/latest/lua_api_map.html#lua_api_map_create_bomb), you can do this and make the ennemy to "throw" the bomb, with a movement.
#454
Your projects / Re: The Legend of Zelda
January 02, 2016, 03:25:26 PM
I need to do a huge ton of work before updating the GIT. I'm currently ( and mostly ) working on metatables
#455
Your projects / Re: The Legend of Zelda
December 26, 2015, 04:10:27 PM
A little update before 2015 ends.

The pause menu is 100% completed, from items to the Quest status subscreen with the Equipment subscreen
(shame that there's no "spoil" button tbh)

This is the new Quest Status subscreen, which I added various things such as Sword Skills display and Ocarina songs, the cursor is dynamically resized depending on the position, player have the ability to have a preview of the song like OOT and M'sM does (but you can't reproduce the song, it's too much work, you can just look at the partition and play it by pressing "action", the script does the rest)

You can also have some informations like the Item descriptions


The second (and new) screen is the Equipment subscreen, which does act a bit like OOT, you can choose what tunic you can wear and the sprite of Link in the middle display it's current arsenal, the tunics in the game act differently (fire resistance, longer diving) as opposed to ALTTP.

#456
Oh, I didn't know that bring_to_front() existed until now. That solved the thing.
#457
The thing is, is it possible to draw something above the hero without (x, y layer + 1) ?
#458
Hi.

I see in the video tutorial that Christopho always use tiled wall to cover under-layers, so I am asking if wall entity does have any impact on the game performance in comparaison to tiled wall ?

The only thing that I see about entitified wall :
- can be created, enabled or disabled dynamically
#459
Development / Re: I want change the font size
December 17, 2015, 12:01:44 PM
You can take dialog_box.lua from Mystery of Solarus or the video tutorial and modify it for your own use. If you wanna make a open source game with free ressources, then you just have to change the sound and the font from the script.
#460
Your projects / Re: The Legend of Zelda
December 12, 2015, 05:25:07 PM
You can disable the spin attack by passing through quest_manager

This is how it's done:

first, you need to declare the map metatable so it's global to all map of the game.
second, add a function map_metatable:on_update()
and then add in this

Code (lua) Select
  if self:get_hero():get_state() == "sword loading" then
   if not self:get_game():get_value("skill_spin_attack") then
   self:get_game():simulate_command_released("attack")
   end
end


It's as simple as that, if you want to do a skill thing then you have to program an item where on_obtaining() classifie all skills variant and set the skill value to true to work.
You can replace get_value to whatever you want (an item is the best example if you want to show this in the inventory, the get_value() is an example).

Then for the trainer, you'll need to custom entity him. Making him a default map entity (coded through x.lua aka the script of a map) would enable the spin attack by default which is not the desired effect.
#461
Your projects / Re: The Legend of Zelda
December 11, 2015, 11:32:35 PM
Update : Finally managed to disable the spin attack and make it a sword skill.

You can see the result here :
https://www.youtube.com/watch?v=452UyOZhxAU
#462
Zelda Mystery of Solarus DX / Re: Android problems?
December 10, 2015, 01:02:59 PM
It is still a beta so errors and incompatibilities might still be present on certain smartphones.
Plus, Android port of Solarus only can run quest that was made with Solarus 1.3 so it is a bit outdated.
#463
Quote from: Christopho on December 09, 2015, 02:08:57 PM
Code (lua) Select
enemy_meta.ice_reaction = "immobilize"
Don't you mean
Code (lua) Select
enemy_meta.ice_reaction = "immobilized"
?

It should be possible to make a custom "freezed" state of enemies, by making a function enemy_meta:freeze() that stops their movement, animation and timers. Maybe it can be useful if the built-in "immobilized" state in not exactly what you want.

For the first thing it works, thanks.
For the second, the "freeze" state would be mostly the same as immobilize, the only thing that iterate is the animation depending on the item and collision, I'm gonna try your work-around.
Tkanks
#464
Hi.

So I was working on some items today (ice rod, deku nuts) and I was wondering how can I make the custom item to immobilize enemies, I tried "set_attack_reaction = "immobilize" but it seems that it doesn't do anything. "set_attack_reaction = "immobilized" hurt the enemies even if the desired reaction is "immobilize". Enemies sprite does have "immobilized" animation.

Code (lua) Select
-- Initialize the metatable of appropriate entities to work with the ice.
local function initialize_meta()

  -- Add Lua ice beam properties to enemies.
  local enemy_meta = sol.main.get_metatable("enemy")
  if enemy_meta.get_ice_reaction ~= nil then
    -- Already done.
    return
  end

  enemy_meta.ice_reaction = "immobilize"
  enemy_meta.ice_reaction_sprite = {}
  function enemy_meta:get_ice_reaction(sprite)

    if sprite ~= nil and self.ice_reaction_sprite[sprite] ~= nil then
      return self.ice_reaction_sprite[sprite]
    end
    return self.ice_reaction
  end

  function enemy_meta:set_ice_reaction(reaction, sprite)

    self.ice_reaction = reaction
  end

  function enemy_meta:set_ice_reaction_sprite(sprite, reaction)

    self.ice_reaction_sprite[sprite] = reaction
  end

  -- Change the default enemy:set_invincible() to also
  -- take into account the ice.
  local previous_set_invincible = enemy_meta.set_invincible
  function enemy_meta:set_invincible()
    previous_set_invincible(self)
    self:set_ice_reaction("ignored")
  end
  local previous_set_invincible_sprite = enemy_meta.set_invincible_sprite
  function enemy_meta:set_invincible_sprite(sprite)
    previous_set_invincible_sprite(self, sprite)
    self:set_ice_reaction_sprite(sprite, "ignored")
  end

end
initialize_meta()


Also question : Does it need extensive code to allow enemies to have a "freeze" attack reaction ?

Any help would be great
Thanks
#465
Development / [Test]Reworked items
December 04, 2015, 04:27:01 PM
These items scripts are still Work in Progress and thus still need more and more improvement (direction fix mostly, but that's gonna be possible on Solarus 1.5).
You probably have played Four Swords Adventure ? The items behavious is now the same.

But, as I am mostly alone to remake these I can't debug the whole thing, I know that there should be some other glitches wandering around but I can't find these, so I'm going around the players itself to test them and post feedbacks.

Explanations :
-When you use an item, the pause menu is disabled and the opposite item slot is too.
-You can't interract with NPC or such, you need to quit the item. (Similar to Wind Waker)
-Action input is disabled
- To quit the item, there are a lot of method
    - Falling
    - Sword button
    - be hurt by an ennemy (use an alternate function)
    - jumping
    - Going in water.
- Speed is slowed while using item, slower when you're arming the item
- You can rapid-fire (and I believe that bugs are here)
- Hookshot : If you are tracted, the item stop itself, else you can re-fire
- set_finished (containing saved input values) is called in on_map_changed, which is called in game start

The obtainable items are Fire Rod, Hookshot and the Bow, I did already have show the Fire Rod but it's way to function was way too hard and too complex, now, the whole item is scripted and working within it's item file, and allowed to implement joypad controls.

You can take these as you wish, I did not check the whole folder so there might be some files of my project wandering around, some files are from Book of Mudora (text, sprites), it's a really old backup of the project with these new files. But keep in mind that these need more and more improvement, essencially if you might use sensors to trigger cutscenes which will require a game function to halt all items.

The only language available is French but that's only testing things so)

Any feedbacks and bug reports would be nice (Except the dialogs, I already know these).
You can open with with Solarus 1.4.5

They only work for tunic1 (Green tunic)

Authors to credit :
Christopho (Hookshot script (ROTH SE), basic functions)
Wrightmat(some of his ressources are still used in the demo)

Download :
http://www.filedropper.com/test_51

Edit : I didn't included treasure pose management, because items are supposed to be obtainable on chests. But this is gonna be fixed.