OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Finnik on March 21, 2023, 01:04:59 pm

Title: [DONE][Suggestion] Ladders / climbing
Post by: Finnik on March 21, 2023, 01:04:59 pm
[Suggestion] Gravlift not only for floor tiles
----------------

While creating a level design for my craft, I faced with a code vs. design problem - I wanted to make a side ladder to deploy troops from the hatch of the craft, but in order to make a ladder I actually must define it not in object (ladder), but only for the floor tile type.
I know, currently modders live with that, but I don't think it is very good:
1) If the ladder tile was destroyed, but floor tile is ok - gravlift will still "magically" (for the player) works.
2) As a modder, I need to define floor image, as craft map will replace floor tile of the landing zone's floor tile, which is not very good - I want my craft ladder even don't touch the ground with keeping original landing zone tile as is.

I looked at the code, but was a bit confused - it looks like a simple check in gravlift code for working only with floors. I altered it, but it turns to be not working. Also, this tile engine part is still very scare to me to touch, and I have no idea why this restriction was originally placed.
You might want this change in OXCE, as such gravlift ladders appear in different mods, but if you don't - an advise for implementation of such a feature would be also super appreciated.
Title: Re: [Suggestion] Ladders / climbing
Post by: Solarius Scorch on March 21, 2023, 01:26:45 pm
Ah, ladders. A constant pain in the ass, as you need to make a special ground tile just for them (and often another, invisible one for a mid-point), wasting precious tile space.

I wholeheartedly support the idea of enabling the lift functionality on objects.
Title: Re: [Suggestion] Ladders / climbing
Post by: Yankes on March 21, 2023, 01:29:43 pm
This could need more work to do, as currently GravLift is interacting with two floors, one beneath you and another on top of you.
I do not remember exactly this part of code but it could need more spacial cases to work correctly.
Title: Re: [Suggestion] Ladders / climbing
Post by: Yankes on March 21, 2023, 01:43:02 pm
Ah, ladders. A constant pain in the ass, as you need to make a special ground tile just for them (and often another, invisible one for a mid-point), wasting precious tile space.

I wholeheartedly support the idea of enabling the lift functionality on objects.
Biggest question is: should engine allow you standing on top of ladder? :>
This mean:
Code: [Select]
S
L
L
L
where `L` is ladder and `S` is soldier

I consider if ladder should be on level where you want climb too. If someone would shoot part next to you, you will fall one level down.
Simply standing on top of ladder (that is on lower level) will look bit bizarre.

[ps]
I think this could be more a "Climbing wall" than "Gravity Lift", that you could move sideway if two are in row.

[ps2]
Even more fun if we combine it with custom move costs, like you can climb some walls but you need special gear to do it.
Title: Re: [Suggestion] Ladders / climbing
Post by: Solarius Scorch on March 21, 2023, 03:52:34 pm
Biggest question is: should engine allow you standing on top of ladder? :>

I don't think it's really necessary. Like you said, it would look weird.

I generally make ladders in one of 2 ways - see the attachment for the relevant one (the other one being just a floor tile with a hole).

I think this could be more a "Climbing wall" than "Gravity Lift", that you could move sideway if two are in row.

[ps2]
Even more fun if we combine it with custom move costs, like you can climb some walls but you need special gear to do it.

These are good points too. :)
Title: Re: [Suggestion] Ladders / climbing
Post by: Yankes on March 21, 2023, 05:56:28 pm
Ok, I will make ladder like on your screenshot "canonical" version.
I first try finish refactor of vapor and I could check to see if would be easy to implement some thing like this.
Title: Re: [Suggestion] Ladders / climbing
Post by: Yankes on March 25, 2023, 09:04:51 pm
First hack to make it work. It need lot more work to finish all details but basic logic is available.

WIP branch: https://github.com/Yankes/OpenXcom/tree/stash/climb
Title: Re: [Suggestion] Ladders / climbing
Post by: Solarius Scorch on March 26, 2023, 12:46:45 pm
Incredible. I'm drooling with anticipation. :)
Title: Re: [Suggestion] Ladders / climbing
Post by: Finnik on March 29, 2023, 09:24:11 am
Thank you! Looking forward to seeing it in a release version!
Title: Re: [DONE][Suggestion] Ladders / climbing
Post by: Meridian on April 29, 2023, 03:41:03 pm
Also some new attributes for changing tile move cost per armor have been added in OXCE v7.9:

Code: [Select]
armors:
  - type: STR_POWER_SUIT_UC
    moveCost:
      baseClimbPercent: [100, 100]

      climbUpPercent: [100, 50]
      climbDownPercent: [100, 50]

See also this post for the full list: https://openxcom.org/forum/index.php/topic,11239.0.html
Title: Re: [DONE][Suggestion] Ladders / climbing
Post by: robin on May 06, 2023, 09:03:49 pm
So..
If I add those attributes to the stats of an alien armor, say the Chryssalid armor, the alien will be able to climb walls?
Title: Re: [DONE][Suggestion] Ladders / climbing
Post by: Meridian on May 06, 2023, 09:07:44 pm
No, those attributes are already present on all armors, they are the default values.

To climb walls, you need to mark tile parts as such (with grav lift flag I believe)... more info @Solarius and @Yankes... I didn't pay too much attention.
Title: Re: [DONE][Suggestion] Ladders / climbing
Post by: Solarius Scorch on May 06, 2023, 11:52:38 pm
Sorry, I haven't played with armours. All I've implemented is climbable walls (well, actually ladders).

Attached a screenshot showing an example with all relevant values circled.
Title: Re: [DONE][Suggestion] Ladders / climbing
Post by: Yankes on May 07, 2023, 06:07:05 pm
So..
If I add those attributes to the stats of an alien armor, say the Chryssalid armor, the alien will be able to climb walls?

Video show was more a hack where I put flag `GravLift` on every tile to test this logic.
In theory we could add option for climbing any wall but this require refractor as it now would conflict with other move options.
Currently you can disable armor that will not climb on any ladder, or when setting `TU_Slide` or `TU_Walk` to 255 you can disable
climb for all armors that have specific move type.
Title: Re: [Suggestion] Ladders / climbing
Post by: howareyou32ny on June 17, 2023, 05:54:57 pm
First hack to make it work. It need lot more work to finish all details but basic logic is available.

WIP branch: https://github.com/Yankes/OpenXcom/tree/stash/climb

wow. can not wait. keep up the good work guys.
Title: Re: [DONE][Suggestion] Ladders / climbing
Post by: Yankes on June 17, 2023, 09:35:28 pm
Is already implemented and used in XFiles