MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.69k stars 1.34k forks source link

Feature request: rope ladders #2553

Closed Cervator closed 6 years ago

Cervator commented 8 years ago

Another fairly easy one here inspired by Hacktoberfest and a recent IRC mention - could go in a module but since ladders are in Core I think we should add this there as well, until a later full piecing out of Core.

The difference between a regular ladder and a rope ladder should be the ability to place a ladder segment below the actively targeted existing rope ladder block, if the spot below is open. Then the player should be able to climb down and continue the ladder, while being able to edge out to either side enough to place additional solid blocks adjacent to the supporting column the ladder is placed against.

This should help the player travel downwards in cases like floating islands, deep vertical caves, and similar situations.

I don't think rope ladders should be able to go up, unsupported, that's what building a column of solid blocks with regular ladder blocks up against should be for.

Probably it should be very limited what can be attached to rope ladders - they should really only be for traveling downward to be able to then start a more proper support platform via other means.

It may be that the logic needs to be in a special ladder system that either catches block placement attempts of the specific block then redirects the placement target to spot below or make the rope ladder block itself special to where e clicking one attempts to fetch another rope ladder from the player's inventory and placing it below the target block.

Current ladders have no special placement logic and just movement against them is handled in KinematicCharacterMover (probably should remain unchanged and just also count for rope ladders)

marti1125 commented 7 years ago

Hi @Cervator I would like to work on this. could you give some instructions? please

oniatus commented 7 years ago

Hi @marti1125 . Climbing is handled in the KinematicCharacterMover.findClimbable. Likely, that a block with the climable property (see Core/assets/blocks/Ladder.block for an example) would work. BlockItemSystem handles the placement of blocks and notifies the inventory item if the event is not consumed (OnBlockItemPlaced-event and BlockInventorySystem). BlockPlacingSystem does the actual placement, but I guess you want to build around this system and do a custom placing based on the blocks in the world (instead of attaching a ladder on a ladder, the ladder should be placed below the ladder). This could work with a higher event priority and consume the event for ladders (this also needs a check for the consumed event in BlockPlacingSystem). Later on, we could improve this custom ladder placing system and forbid any other blocks that are about to be attached on a ladder. Consuming the event while placing a block would break the OnBlockItemPlaced-sending in the BlockItemSystem. One way this could be handled is a separate boolean/int/whatever in the event, to indicate that/how many blocks have been placed and check for this flag instad. You can finde more info about adding blocks in the TutorialAssetSystem.

Cervator commented 7 years ago

For reference this is effectively complete with the https://github.com/Terasology/Climbables module - we just need to add it to the lineup if @portokaliu believes it is ready to go.

marti1125 commented 7 years ago

Hi @oniatus I am working on this issue πŸ‘

Cervator commented 7 years ago

Hi @marti1125 cool to see that you're still around :-)

The base implementation is complete in the Climbables module. Maybe you'd want to check that out, see if it works, and work on any remaining bugs or other improvements?

marti1125 commented 7 years ago

@Cervator sure!! can you guide me please πŸ‘

marti1125 commented 7 years ago

I do not how to get start?

captura de pantalla 2017-01-02 a las 23 37 23
Cervator commented 7 years ago

You need to add the Climbables module :-)

Be sure you've made yourself familiar with the basics: in the engine wiki, like https://github.com/MovingBlocks/Terasology/wiki/Developing-Modules

In this case you would:

After a moment IntelliJ should prompt you for a restart, or you can just restart it yourself.

Afterward you should have "Climbables" in your module list, in bold. Run the game and create a world with the module activated and get one or both the same blocks from the in-game console

You should now have those as blocks - place the support block first, then while holding the other block of the type you can right click the support block to auto-extend it.

marti1125 commented 7 years ago

@Cervator Done!! πŸ‘ @oniatus Done!! πŸ‘ https://github.com/MovingBlocks/Terasology/wiki/Developing-Modules

captura de pantalla 2017-01-04 a las 22 37 50
marti1125 commented 7 years ago

Which part of the project I have to modify? :grin:

marti1125 commented 7 years ago

@Cervator @oniatus hello =(

Cervator commented 7 years ago

Hey there! Sorry about the delay. We're buried by notifications these days (I'm up to some 3,000ish unread GitHub emails...) so it is really easy to miss comments anywhere. Saw this in my stream by chance :-)

If you were able to get it to work fine, what did you modify or what would you like to modify? Since the two base objects seemingly work already.

Feel free to join us on IRC, that's a waaaay easier way to find somebody to talk to as there are usually people around. Even if they aren't the right people they might still help or have ideas :-)

Cervator commented 6 years ago

I just dusted off the Climbables module and made some minor updates to make it compile with the latest engine. Works fine after that so I'm going to add it to the lineup and consider this complete, although I'm sure it can still be enhanced. Work can continue within its own repo https://github.com/Terasology/Climbables