Author Topic: [DONE] Ability to change tile move cost (per armor)  (Read 1107 times)

Offline Yankes

  • Commander
  • *****
  • Posts: 3210
    • View Profile
[DONE] Ability to change tile move cost (per armor)
« on: March 07, 2022, 08:36:41 pm »
In recent nightly I added option to control cost of armor moving, now is possible to implement "glue" gun that prevent unit form moving from given spot.
By default each unit use value from:
Code: [Select]
armors:
  - type: STR_NONE_UC
    moveCost:
      basePercent: [100, 100] #TU%, ENERGY%
Then in y-script you can alter it per unit:

Code: [Select]
begin;
  var int temp;
  unit.MoveCost.getBaseTimePercent temp;
  add temp 100;
  unit.MoveCost.setBaseTimePercent temp;
end;
This properties can have any value but game enforce that result TU cost is in range [1, 254] and Energy in [0, 255].


As side notes, now save files should be smaller by up to 40% because game stop print some whitespaces that take took lot wasted of space in file.
« Last Edit: April 29, 2023, 03:23:13 pm by Meridian »

Offline Ethereal

  • Commander
  • *****
  • Posts: 630
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #1 on: March 26, 2022, 10:26:39 pm »
You need to be running OXCE 7.5.7 (Preview Build) or later to use this new version.

Do you want to tell us anything interesting?

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #2 on: March 28, 2022, 01:08:17 pm »
You need to be running OXCE 7.5.7 (Preview Build) or later to use this new version.
Do you want to tell us anything interesting?

Version 7.5.7 has an interesting new feature that allows for better control of movement costs:

In recent nightly I added option to control cost of armor moving, now is possible to implement "glue" gun that prevent unit form moving from given spot.
By default each unit use value from:
Code: [Select]
armors:
  - type: STR_NONE_UC
    moveCost:
      basePercent: [100, 100] #TU%, ENERGY%
Then in y-script you can alter it per unit:

Code: [Select]
begin;
  var int temp;
  unit.MoveCost.getBaseTimePercent temp;
  add temp 100;
  unit.MoveCost.setBaseTimePercent temp;
end;
This properties can have any value but game enforce that result TU cost is in range [1, 254] and Energy in [0, 255].


As side notes, now save files should be smaller by up to 40% because game stop print some whitespaces that take took lot wasted of space in file.


It is a pretty fun addition.
« Last Edit: March 28, 2022, 01:10:01 pm by The Martian »

Offline Ethereal

  • Commander
  • *****
  • Posts: 630
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #3 on: March 28, 2022, 06:24:56 pm »
Thanks for the information. I just would like to understand why there was no announcement with a description of the changes? Or is there a big 7.6.0 release planned with a lot of changes? And when is it planned?

Offline Yankes

  • Commander
  • *****
  • Posts: 3210
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #4 on: March 28, 2022, 06:43:43 pm »
Thanks for the information. I just would like to understand why there was no announcement with a description of the changes? Or is there a big 7.6.0 release planned with a lot of changes? And when is it planned?
When will be new version released is up to Meridian. And every thing that is working at this point from nightly it will be included. This mean it could be lot of changes or only few.

And for announcement, post that The Martian link is from this thread, more official could be only change log in new release :>

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #5 on: March 28, 2022, 06:56:55 pm »
Thanks for the information. I just would like to understand why there was no announcement with a description of the changes? Or is there a big 7.6.0 release planned with a lot of changes? And when is it planned?

The official update is not planned at the moment.

The next official version number will be 7.6, earliest possible date for it is May 2022 (or later).

Offline Ethereal

  • Commander
  • *****
  • Posts: 630
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #6 on: March 28, 2022, 07:21:00 pm »
The next official version number will be 7.6, earliest possible date for it is May 2022 (or later).

I understand. Thanks. Will wait. Armageddon is canceled, so there's time.

Offline Yankes

  • Commander
  • *****
  • Posts: 3210
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #7 on: April 04, 2022, 09:46:53 pm »
And Lord said:
Quote
upon thy breast shalt thou go, and earth shalt thou eat all the days of thy life.
If God want to humans to fly he would give them wings.
Now OXCE support this God command and allow punish puny humans that try to fly using alien tech.

You can make now that any human that try fly up will pay heavy energy penalty for doing so,
flaying down as is more in line of God plan could be even cost less than previously.

Code: [Select]
armors:
  - type: STR_FLYING_SUIT_UC
    moveCost:
      #fist level of multipliers
      basePercent: [100, 100] #overall move cost

      #second level of multipliers
      baseNormalPercent: [100, 100] #move cost for ground
      baseFlyPercent: [100, 100] #move cost for flying

      #third level of multipliers
      walkPercent: [100, 50] #cost of normal move type
      runPercent: [75, 75] #cost of run aka with `ctrl`
      strafePercent: [100, 50] #cost of strafe when `ctrl` and only one tile aside
      sneakPercent: [100, 50] # !new move type with `alt`, force unit to move on ground even if is capable of flying

      flyWalkPercent: [100, 50] #cost of normal move type in air
      flyRunPercent: [75, 75] #cost of run aka with `ctrl` in air
      flyStrafePercent: [100, 50] #cost of strafe when `ctrl` and only one tile aside in air
      flyUpPercent: [100, 0] #cost of flying up
      flyDownPercent: [100, 0] #cost of flying down
      gravLiftPercent: [100, 0] #cost for using gravLift


[ps]
fixed type in example, correct version of OXCE is 7.5.10
« Last Edit: April 04, 2022, 10:22:40 pm by Yankes »

Offline Yankes

  • Commander
  • *****
  • Posts: 3210
    • View Profile
Re: Ability to change tile move cost (per armor)
« Reply #8 on: April 08, 2022, 10:19:46 pm »
Funny glitch that change tank graphic when you swap move type.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: [DONE] Ability to change tile move cost (per armor)
« Reply #9 on: April 29, 2023, 03:37:47 pm »
Together with the ladder climbing feature: https://openxcom.org/forum/index.php/topic,11186.0.html

several 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]