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

Pages: 1 ... 63 64 [65] 66 67 ... 69
961
Development / Re: Creating a custom jump
« on: August 04, 2015, 04:25:48 pm »
@Zeror, I think that you are right, probably, that the movement during the jump in Link's awakening has some restrictions (I have tested it now with the gb emulator, although I am not completely sure of these restrictions). The only way to impose these restrictions would probably be using Christopho's solution and programming all the behaviour, which could be hard. I think I will keep my solution anyway, at least for some time.

962
Development / Re: Creating a custom jump
« on: August 04, 2015, 04:05:29 pm »
I assume that for your solution I need to modify the event on_command_pressed() to create movements that control the hero? Because I think that is only way to control the hero in that freezing state.

963
Development / Re: Creating a custom jump
« on: August 04, 2015, 04:01:19 pm »
Just in case someone is interested, my trick (already tested and works fine) is:
Code: [Select]
function item:on_using()
  local hero = self:get_map():get_entity("hero")
  local jump_duration = 500 -- Change this for duration of the jump.
  sol.audio.play_sound("jump")
  hero:set_animation("black")
  hero:unfreeze()
  local x,y,layer = hero:get_position()
  local tile = self:get_map():create_custom_entity({x=x,y=y,layer=layer,direction=0,width=8,height=8})
  tile:set_origin(4, 4)
  tile:set_modified_ground("traversable")
  function tile:on_update()
    -- Follow the hero.
    tile:set_position(hero:get_position())
  end
  sol.timer.start(self, jump_duration, function()
    hero:set_animation("stopped")
    tile:remove()
    item:set_finished() 
  end)
end

EDIT: I forgot to add the methods, hero:get_solid_ground_position() and hero:reset_solid_ground().

964
Development / Re: Creating a custom jump
« on: August 04, 2015, 03:53:17 pm »
How do you stop the movement while keeping the jumping state?

I have tried with hero:stop_movement(), but the hero stays frozen. If I add hero:unfreeze(), I recover the control of the hero, but this also seems to stop the jumping state... :o Am I doing something wrong? The code I am using is:
Code: [Select]
function item:on_using()
  local hero = self:get_map():get_entity("hero")
  local direction4 = hero:get_direction()
  hero:start_jumping(direction4 * 2, 32, false)
  hero:stop_movement()
  --hero:unfreeze()
  hero:set_animation("black")
  --self:set_finished()
end

EDIT: I forgot to add the methods, hero:get_solid_ground_position() and hero:reset_solid_ground().

965
Development / Re: Creating a custom jump
« on: August 04, 2015, 03:34:23 pm »
I have tested my solution and works fine (the only problem is to choose the duration of the jump).

Anyway, your solution seems better, so I will change my script again. Thanks!

966
Development / Creating a custom jump
« on: August 04, 2015, 02:22:07 pm »
Greetings! I always wanted to script a jump like in Zelda games (the one given by the engine is too limited), where you can control the hero during the jump. I had an idea of how we could program this (although there may be other better ways).

The idea is, when using the item to jump, we first create a custom entity with transparent sprite and solid ground that follows the hero under him, and we start the jumping animation on the hero. (The custom entity would allow to move over holes, water and lava while we are jumping, because it has solid ground. It should have smaller size than the hero to avoid traversing walls.) When the jump animation finishes, we destroy the custom entity. It would be necessary to use the save solid ground function before the jump, just in case the hero ends in bad ground, and reset the solid ground function when the jump ends.

One of the advantages (or disadvantages) of doing it this way is that it allows the hero to jump over lower layers (in case that the current layer ends) without falling to the lower ones until the end of the jump. In other words, this would allow to jump between solid grounds on the same layer that have "empty" grounds (not holes!) between them without falling to lower layers. (I was planning to use this to make puzzles where you move boxes of the low layer to make a way on the middle layer where you can jump over the boxes without falling to the lower layer.)

I have not programmed this yet (someday I wil try it) so I am not sure if this will work as I expect. Anyway, I have hope in this trick to program the jump, so I wanted to share the idea.

967
Bugs & Feature requests / Re: Tiles incorrectly sized when played?
« on: August 03, 2015, 04:26:55 am »
Are you using your own sprites for the hero? If that's the case, changing the origin of the sprite animations of the hero may solve this.

968
Your projects / Re: Hybrid game (Link's Awakening + Lost Vikings 2)
« on: August 01, 2015, 10:07:03 am »
I made a very silly video to show the carrying system of custom entities that I have scripted and show a bit of what will be the game. (It's just a bunch of test maps, with no dungeon or puzzle.) I think this game will take me at least 5 years of work (I am replacing all the ALTTP resources by others made by me, and that is too much work for one person), so be patient.

You can watch it here:
https://www.youtube.com/watch?v=iY-yckilRrg

PS: sorry for my English if it is terrible and if the quality of the video is not too high.

969
Your projects / Re: Hybrid game (Link's Awakening + Lost Vikings 2)
« on: August 01, 2015, 09:14:24 am »
If you mean that changing the hero should cost something that can run out, that would be a pain, and probably unnecesary...

Anyway, you have given me an idea about changing, not exactly the hero, but in chains of changing (trading) objects in the game (which is typical from Zelda games). I could make some areas accessible for some heroes so that it will make necessary to interchange objects from one hero to another (this will be done using the menu), since the hero that obtains the item in the trade cannot access the area for the new trade.

EDIT: I think I understand now what you meant. (Something like in Zelda Navis Quest with the tradings, I suppose.) But that is more an annoyance than a puzzle...

970
Your projects / Hybrid game (Link's Awakening + Lost Vikings 2)
« on: August 01, 2015, 07:29:56 am »
Greetings! I'm working on a solarus game where you can control 3 heroes that have different abilities and weapons, and switch between them using the menu (or pressing space bar if they are in the same map). I have not worked much on the plot, but I will explain now a bit about the gameplay.

The main heroes will be:

-An archer, the only one who can jump over holes (and water and lava), and has a bow with wooden arrows, a crossbow with metal quarrels, a shovel (that can be used to obtain metal quarrels from the ground and the usual uses), a sickle that can be used to obtain wooden arrows from certain plants (which unlike the sword, cannot cut solid plants), running boots (that can be used with the ability of jumping), etc.
-A swordsman, the only one who can swim on water, and uses short range weapons like a sword, spear, shield, a magneto (that can be used to deflect the metal quarrels a certain angle, and other uses), etc.
-A mysterious wizard (with short range spells) who has lost his memory, that can throw fire (to burn plants, or to combine it with the arrows of the archer to produce fire arrows), throw electricity (which paralizes enemies, turns on machines, hurts water-type enemies, and also can be combined with metal quarrels to electrify them), swimming in lava, mind reading of npcs (and even the other heroes), teleporting all heroes to the entrance of the dungeon or certain place of the map, etc.

I have also finished the scripts to change control between heroes, but it remains to make the menu to change between them from different maps. In maps where one of the main heroes is left, the position and state of everything must be saved to avoid solid entities to reappear overlapping some hero (this is necessary, but easier than it seems).

Also, I made a script to carry custom entities (although I still have to solve some problems and improve it). These portable entities can be thrown from one hero to another (useful if there is a hole or thin wall between heroes, or if they are moving in platforms, etc). Keys will be custom entities that will be carried, which is something unusual, and will allow to make enemies that steal the key, or annoy in other different ways (like changing the color of the key, but I don't want to give more spoilers). A key will open only a door of its color. There could also be magnetic keys (to use the magneto with them), and other types. Some portable items can be used to push buttons, and they are always moved by platforms.

The symbol of the game will be a clover (instead of the triforce), there will be secret clovers in the island that can be collected for something good to happen (like the secret seashells in Link's awakening), and a dark/light magic clovers which will be part of the main plot.

There are huge possibilities for the puzzles in a game like this. But the hardest part will be to design the island (not the dungeons), since sometimes the heroes will need to take different paths to arrive to the same place, and other times you can cross some road if you take two or all the heroes at the same time in that way (cooperation between them is needed). There will be parts of the game when you don't have the three heroes (at the begining you only have one of them). Etc.

This are the main ideas for my game. This is maybe too ambitious, but it is possible, and the hardest part of the scripting is almost done, although it still remains to make most of the graphics and start making all the maps and dungeons. I would be grateful if someone wants to cooperate with this project or contribute with some more ideas.

971
Development / Re: Trouble making a bridge.
« on: July 30, 2015, 09:40:32 pm »
There is something you must know (but I don't know if you know it, since it has not been explained here with all details yet). If the hero walks over an intermediate layer (or high) and the tile ends, he "falls" to the low layer immediately. (Maybe you already knew it.) I suppose that the purpose of the transparent tile is to keep the hero on the intermediate layer after his position is changed by the sensor on low (so the transparent layer starts above the sensor on low, covering it, and connects with the other intermediate layer tiles).

(I was thinking that the sensor above, which changes hero's position to the lower one, is not necessary at all, since the hero "falls" automatically in the border of the transparent tile.)

972
Development / Re: Trouble making a bridge.
« on: July 30, 2015, 11:17:20 am »
Hi! I was thinking that the bridge would not work correctly with enemies and thrown entities (like arrows). But if we use a custom entity with a collision test instead of the sensor, that could be done. (Anyway, this matter is not really important, since most of the players would not realize of the problem.)

EDIT: if the hero has a companion that follows him, it could be necessary to use the custom entity collision and not the sensor.

973
Development / Re: Assigning Hotkeys to Items
« on: July 30, 2015, 05:41:26 am »
Yes, the script is loaded and executed. But as far as I know, you are not getting a solarus item entity that the engine can handle. That is why the function item:get_game() is not defined for your item variable (which is actually nil), and that produces the error in line 2.

974
Development / Re: Assigning Hotkeys to Items
« on: July 30, 2015, 04:28:59 am »
I think you cannot get an item directly from its script, only the engine can do that, so probably this has no sense. Maybe, try using game:get_item(item_name).

975
Development / Re: Any way to use an item during swimming?
« on: July 29, 2015, 08:48:33 pm »
If I am not wrong, it should be possible and not too hard (although I haven't tried that yet). I would use the event game:on_command_pressed (or game:on_key_pressed) to activate the item. You need to check that the item is assigned to the command (or key) you have pressed, and also if the hero is swimming (use something like "if hero:get_state() == "swimming" then ..."). Maybe you need to do something more, but you should be able to handle this (with a lot of work).

You should start by studying the scripts related to the hud (of Solarus dx for instance), which is used to display the selected items. Also, you will find functions for custom states or commands of the hero (which are independent of the engine) defined there that you may need to use. (It took me a lot of time to understand all of that, but it's really important.)

Pages: 1 ... 63 64 [65] 66 67 ... 69