Author Topic: OXCE (OpenXcom Extended) main thread  (Read 82172 times)

Offline vadracas

  • Colonel
  • ****
  • Posts: 279
  • Just another player/modder combo.
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #510 on: May 13, 2020, 02:55:20 pm »
Is there any way to use a soldier transformation to remove a commendation?

Is there any way to store the lowest hp a soldier was at in battle(probably doable with scripts, will figure it out), and then use it as the criteria for a commendation?

I want to implement something like war wounds, where if the soldier gets too low on hp during a battle, they get a commendation with big stat penalties as if they received a lasting injury which then has to be removed with a soldier transformation.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6376
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #511 on: May 13, 2020, 03:33:02 pm »
Is there any way to use a soldier transformation to remove a commendation?

No.

Is there any way to store the lowest hp a soldier was at in battle(probably doable with scripts, will figure it out), and then use it as the criteria for a commendation?

No.

Offline vadracas

  • Colonel
  • ****
  • Posts: 279
  • Just another player/modder combo.
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #512 on: May 13, 2020, 03:45:51 pm »
k.

Offline Bobit

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #513 on: May 13, 2020, 06:02:12 pm »
Vadracas.

Soldier transformations remove all commendations if they have "reset = true". Or you can apply a soldier bonus to negate the commendation bonus, and forbid the transformation from happening again.

Scripts that give/remove commendations are not possible. Scripts that permanently modify stats without using commendations likely are possible, but it's an ugly hack. totalTimesWounded or totalHit5Times could substitute for your relative hp commendation.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6376
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #514 on: May 13, 2020, 06:11:20 pm »
Soldier transformations remove all commendations if they have "reset = true". Or you can apply a soldier bonus to negate the commendation bonus, and forbid the transformation from happening again.

They don't remove any commendations.

Only transformation soldier bonuses are removed.
Commendations (and commendation soldier bonuses) are NOT removed.

Offline Shiroi Bara

  • Colonel
  • ****
  • Posts: 275
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #515 on: May 13, 2020, 07:15:52 pm »
How many turns is allowed per mission until game crash? 999? More? If I stay in ship cowardly and leave it and just waiting while aliens come to me.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6376
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #516 on: May 13, 2020, 07:22:38 pm »
How many turns is allowed per mission until game crash? 999? More? If I stay in ship cowardly and leave it and just waiting while aliens come to me.

I don't know, I never tried it.
Let us know if you find out.

Online Mathel

  • Colonel
  • ****
  • Posts: 128
  • Do not mistake Muton for mutton.
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #517 on: May 13, 2020, 07:41:56 pm »
I tried looking at it. I do not know YAML, but if I understand this line from SavedBattleGame.cpp correctly,
Code: [Select]
_turn = node["turn"].as<int>(_turn);then _turn is an integer.
So presumably something strange would happen if the mission took as long, as is integer in that YAML. Which is presumably either 2 147 483 647 or 4 294 967 295, depending on whether or not the integer is signed.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 2345
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #518 on: May 13, 2020, 08:02:27 pm »
Save file is only small part possible "crash" sources, you can easy play game not saving at all.
To see if any thing crash you need track all use of this variable and see if any use handle correctly big numbers.

Theoretical example could be "Next Turn Screen" have hardcoded space for only 4 characters to display, then if you send value 10000 it could crash.
This could probably happens if we would use C but in C++ many buffers automatically grown to meet required space.

Offline Shiroi Bara

  • Colonel
  • ****
  • Posts: 275
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #519 on: May 15, 2020, 04:47:15 pm »
How experience system working when you use grenades - who get experience, aquanaut who prime it or aquanaut who pick it and threw? Instant grenades mode  is off and enemy hit by blast radius.

Offline vadracas

  • Colonel
  • ****
  • Posts: 279
  • Just another player/modder combo.
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #520 on: May 15, 2020, 04:51:42 pm »
aquanaut who threw, no skills are needed to prime in this game.

Offline Shiroi Bara

  • Colonel
  • ****
  • Posts: 275
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #521 on: May 15, 2020, 06:01:19 pm »
Ok, thank you, forget ask about disturbance grenades - same algorithm I assume? When enemy step on and it triggered experience goes to person who threw? 

Offline vadracas

  • Colonel
  • ****
  • Posts: 279
  • Just another player/modder combo.
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #522 on: May 15, 2020, 06:18:41 pm »
Pretty sure throwing exp comes from grenades in this way: In the ruleset, the grenade is tagged to give throwing Exp, then, once the grenade is primed, when you throw the grenade it will give throwing Exp.

I think-but this has been modified before and I'm not 100% sure this is how it works.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 2345
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #523 on: May 16, 2020, 08:02:23 pm »
I added new functionality to OXCE nightly:

For many list like `requires` or `requiresBuy` you can use new syntax like:

Base mod:
Code: [Select]
items:
  - type: STR_PISTOL
    requiresBuy:
      - STR_X
      - STR_Y
  - type: STR_PSI_AMP
    requires:
      - STR_X
      - STR_Y

Another mod:
Code: [Select]
items:
  - type: STR_PISTOL
    requiresBuy: !add
      - STR_Z
  - type: STR_PSI_AMP
    requires: !remove
      - STR_Y
Now `STR_PISTOL` need have additionally need `STR_Z` AND `STR_X`, `STR_Y` to buy
But `STR_PSI_AMP` need only `STR_X` from research.

With this you can easier add or remove some positions from list without know full lists.
This reduce many cases where mods extension could easy break by small change in main mod.

For now only two `!add` and `!remove`  basic operations are supported but in future it will be more complex too available (like `!replace`).

As some list have very strick order I could not add for now way to override them but in future depending on demand I could add ways to override them too.

Offline mechasdasd

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #524 on: May 17, 2020, 03:48:32 pm »
Hello, I joined because I wanted to ask something: are smoke grenades supposed to hurt units with normal and personal armor? (and some of the weaker aliens like Sectoids?) They don't in the vanilla game/OpenXcom and I haven't been able to find anything about it online. Power Suit units and Tanks don't get damaged at all, so I'm not sure if this is a bug or an intended feature of OXCE.