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 ... 32
1
Bugs & Feature requests / Re: Universal Windows App
« on: May 22, 2017, 11:59:52 am »
Don't know how UWA works but yeah could be interesting

2
Development / Re: Assign argument variables in function parameter?
« on: May 16, 2017, 11:30:28 am »
How would I do something like this?

Code: Lua
  1. function test(a = 5, b = "hey", c = true)
  2.   if a == 5 then
  3.     print("Letter A is",a)
  4.   end
  5. end
  6.  
  7. test()

I know it can be done like this:

Code: Lua
  1. function test(a, b, c)
  2. a = 5
  3. b = "hey"
  4. c = true
  5.   if a == 5 then
  6.     print("Letter A is",a)
  7.   end
  8. end
  9.  
  10. test()

Code: Lua
  1. function test(a, b, c)
  2.   if a == 5 then
  3.     print("letter A is " .. a)
  4.     -- You can even modify your variables from there
  5.   end
  6.   return a, b, c
  7. end
  8.  
  9. test(5, "hey", true)
  10.  

The arguments should be when you call that function, not when you define it.
Of course, "return a, b, c" is optionnal, it's only when you want to store a, b or / and c in a variable, but since the function is called "test", you might wanna return some result somewhere else

3
General discussion / Re: Tunics id that impact the player stats ?
« on: May 15, 2017, 05:10:02 pm »
I can make all of Eldran's custom animations, I just need a higher resolution of it for both male and female version, for the menu paperdoll, like this



for the tunic colors, just let me know which one you want for Eldran, I have a color palette swapping tool.
Anyway, thank you for letting Eldran be a skin for Link in my project, I highly appreciate it  :)

these are all characters skin planned as for now.
https://github.com/TeamLJS/Zelda-ES-Solarus/issues/1

(Yes, i was forced to change my Github account, I changed my phone number and the account was protected by a 2 way authentification, I forgot to download recovery code as well)

4
General discussion / Tunics id that impact the player stats ?
« on: May 15, 2017, 12:09:02 pm »
Hey

I've planned some things with my project which include Link skins.
By skins, i already planned

- Regular Link (Parallel Worlds skin)
- ALTTP Link
- AST Female Link
- AST Male Link
- Eldran (Male / female)

https://cloud.githubusercontent.com/assets/28355478/26052240/1c231a6a-3965-11e7-8723-116a956cda03.png

With this idea come the thing of giving stats to the player, such as

- Normal for regular Link (1 attack, 1 defence)
- Defensive for Female Link (0.5 attack, 2 defence)
- Attacks for Male Link (2 attack, 0.5 defence)
- Damage and Defence for ALTTP Link (2 attack, 2 defence)
- Still not decided for Eldran (maybe attack, defence, speed and swim ability)

Starting stats are 1 attack / 1 defence, of course, abilities (sword / shield) will modify these values

What do you all think of this ? Do you think that this could be something useful ?
Of course, the skins will need to be unlocked by doing quests or depending on the progression the player made

5
Development / Re: Jump movement direction4 error?
« on: May 14, 2017, 02:36:25 am »
What I see is, you try to get the direction4, which doesn't exist in the jump movement

You can only get direction8 from a jump movement, which is understandable

http://www.solarus-games.org/doc/latest/lua_api_jump_movement.html#lua_api_jump_movement_get_direction8

So then, to get a 4 direction way, simply divide by 2

Also in on_interaction, you can save a lot of space by doing

Code: Lua
  1. self:set_direction((2 + hero:get_direction()) % 4) -- Make the entity face the hero
  2. map:get_game():start_dialog(dialog) -- dialog

And i maintain, i don't get the on_interaction issue you're facing, so it comes from your code

If this doesn't solve the issue then it have something to do with your code, i'll investigate it tomorrow.

6
Development / Re: Jump movement direction4 error?
« on: May 13, 2017, 10:28:21 pm »
Can you send your project here ? I'll investigate this, weird issues there

7
Development / Re: Stopping npcs
« on: May 13, 2017, 10:27:04 pm »
use entity:on_obstacle_reached(movement)

http://www.solarus-games.org/doc/latest/lua_api_entity.html#lua_api_entity_on_obstacle_reached

From there you have to configure the behaviour of what the entity do when it collide with something (and obviously, you can change it's movement)

Stopping an NPC ? No problem

Code: Lua
  1. function entity:on_obstacle_reached(movement)
  2.   -- Check if any movement exist
  3.   if movement ~= nil then
  4.     -- Stop the movement
  5.     movement:stop()
  6.  
  7.     -- Do whatever you want here (restart a movement or else)
  8.   end
  9. end
  10.  
  11.  

But you have to define this event for each NPC that does what you want
Careful though, this event is called each time the entity collide with something, so, if you want to make this entity to interact only with another entity, use

http://www.solarus-games.org/doc/latest/lua_api_entity.html#lua_api_entity_get_facing_entity

Code: Lua
  1. function entity:on_obstacle_reached(movement)
  2.   -- Check if any movement exist
  3.   if movement ~= nil then
  4.     -- Check the entity facing this entity
  5.     if self:get_facing_entity():get_name() == "name_of_your_npc" then
  6.       -- Stop the movement
  7.       movement:stop()
  8.  
  9.       -- Do whatever you want here (restart a movement or else)
  10.      end
  11.   end
  12. end
  13.  
  14.  

8
Development / Re: entity sounds
« on: May 13, 2017, 10:23:09 pm »
Just replace the sounds in /sounds, else if you want to have more sounds, you have to go through custom entities

9
Development / Re: Jump movement direction4 error?
« on: May 12, 2017, 05:53:55 pm »
http://www.solarus-games.org/doc/latest/lua_api_entity.html#lua_api_entity_on_movement_changed
Your approach is good but try with

Code: Lua
  1. function self:on_movement_changed(movement)
  2.   self:set_direction(movement:get_direction4())
  3. end

If it doesn't work, try
http://www.solarus-games.org/doc/latest/lua_api_movement.html#lua_api_movement_on_changed

Also, you are overwriting the on_interaction function, all custom entities with undefined on_interaction will have this "default" code. This might be related to http://forum.solarus-games.org/index.php/topic,974.0.html

10
Development / Re: How to add an "opening" animation for chests?
« on: May 12, 2017, 05:48:03 pm »
I did posted the solution on page 1, it does replace the default chest by a custom entity, you might do some tweaks to make it properly work to your needs though

11
Game art & music / Re: Mouhitotsu no Takarajima
« on: May 12, 2017, 08:45:35 am »
I see a lot of potential indeed, why not making a straight rip and a ALTTP variation of these tiles ?
I can definately see it o your "Full Hyrule Tileset" with proper colors

Also looks like it this game runs on the ALTTP engine ?

12
Development / Re: How to add an "opening" animation for chests?
« on: May 10, 2017, 10:28:50 pm »
You need 3 things.

1) the metatable modification
2) a chest entity
3) a chest on a map, where you need to define
    - it's spriteset
    - it's treasure
    - it's variant
    - the savegame variable

1) * Keep note that it is from my project so you might need to modify things to fit your needs
And, with this script you can only set a treasure that you can open if you press Action, other chest action cannot be done without more complex modifications
Also to set a direction for your chest (if needed), put the desired direction as the chest name.

Code: Lua
  1. local chest_meta = sol.main.get_metatable("chest")
  2.  
  3. function chest_meta:on_created()
  4.   local treasure, variant, savegame = self:get_treasure()
  5.   local x, y, layer = self:get_position()
  6.   local graphic = self:get_sprite():get_animation_set()
  7.  
  8.   local setup = {
  9.     x = x,
  10.         y = y,
  11.         layer = layer,
  12.         model = "chest/chest",
  13.         width = 16,
  14.         height = 16,
  15.         direction = 3,
  16.         sprite = graphic
  17.   }
  18.  
  19.   local entity = self:get_map():create_custom_entity(setup)
  20.   entity:set_treasure(treasure, variant, savegame)
  21.   entity:create()
  22.  
  23.   -- You might need to customize this chest.
  24.   function self:get_chest()
  25.     return entity
  26.   end
  27.   self:remove()
  28. end

2)

Code: Lua
  1. local entity = ...
  2. entity.data = {}
  3.  
  4. function entity:set_treasure(treasure, variant, savegame)
  5.   self.data.treasure = treasure
  6.   self.data.variant  = variant
  7.   self.data.savegame = savegame
  8. end
  9.  
  10. local game = entity:get_game()
  11. local hero = game:get_hero()
  12.  
  13. function entity:is_open()
  14.   return game:get_value(self.data.savegame)
  15. end
  16.  
  17. function entity:create()
  18.   self:set_drawn_in_y_order(true)
  19.   self:set_can_traverse("hero", false)
  20.   self:set_traversable_by("hero", false)
  21.   self:set_traversable_by("custom_entity", false)
  22.  
  23.   if self:is_open() then
  24.     self:get_sprite():set_animation("open")
  25.     return
  26.   end
  27.  
  28.   -- Hud notification
  29.   self:add_collision_test("facing", function(_, other)
  30.     if other:get_type() == "hero" then
  31.       if not self:is_open() then
  32.             self.action_effect = other:get_direction() == self:get_direction() and "open" or "look"
  33.           else
  34.             self:clear_collision_tests()
  35.           end
  36.     end
  37.   end)
  38. end
  39.  
  40. function entity:on_interaction()
  41.   -- This is where you will play your animation, set the savegame value to true and give the hero the treasure
  42.   -- savegame value is stored in entity.data.savegame
  43.  
  44.   if self:is_open() then
  45.     return
  46.   end
  47.  
  48.   hero:freeze()
  49.   game:set_pause_allowed(false)
  50.   self:get_sprite():set_animation("opening", function()
  51.     self:get_sprite():set_animation("open")
  52.     hero:start_treasure(self.data.treasure, self.data.variant, self.data.savegame, function()
  53.       -- After the treasure has been obtained
  54.       hero:unfreeze()
  55.       game:set_pause_allowed(true)
  56.     end)
  57.   end)
  58.  
  59.   self.action_effect = nil
  60. end

13
Development / Re: On_interaction error?
« on: May 10, 2017, 10:22:20 pm »
Have you tried setting a size for your entity (entity:set_size(width, height)), this issue is strange

14
Development / Re: Jump movement direction4 error?
« on: May 10, 2017, 10:19:33 pm »
This is a bit unclear to me, can you upload the whole code ?

15
Development / Re: How to add an "opening" animation for chests?
« on: May 10, 2017, 09:11:25 pm »
I like Diarandor's solution, overwriting a chest to replace it with a custom entity.

For the custom entity script, simple trick is to use add_collision_test to do HUD stuffs and simply add an animation in on_interaction. Thn call hero:start_treasure from there

Pages: [1] 2 3 ... 32