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

Offline Ethereal

  • Commander
  • *****
  • Posts: 610
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1155 on: July 19, 2022, 07:03:07 am »
Is there a way to disable the vanilla psionics calculation formula? Just turn it off so that the probability of a successful psi attack is 100% and is reduced only by the "psiDefence" parameter in armor, and increased only by the "accuracyXXX..." parameter in items.

Online Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3158
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1156 on: July 19, 2022, 10:05:05 am »
Yes, y-script hook `tryPsiAttackItem`, it is responsible for default algorithm, override `psi_attack_success` to any value you want (value `100` is 100%).

Offline Ethereal

  • Commander
  • *****
  • Posts: 610
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1157 on: July 19, 2022, 10:37:50 am »
Yes, y-script hook `tryPsiAttackItem`, it is responsible for default algorithm, override `psi_attack_success` to any value you want (value `100` is 100%).

I am very weak in scripting, but I found this -

Code: [Select]
    tryPsiAttackUnit:
      - offset: 23   # for Scripted Items - Automatic Success
        code: |
          var int battle_type;
          var ptr RuleItem item_rule;
          var int energy_max;
         
          item.getRuleItem item_rule;

          item_rule.getBattleType battle_type;
         
          if eq battle_type 9; # scripted psi amp
            if or eq battle_action 13 eq battle_action 14;
              debug_log "PsiAttack with scripted item. Automatic success!";
              set psi_attack_success 1;
            end;
          end;
          return psi_attack_success;

Can this be used as a template for "tryPsiAttackItem"?

In addition, it is necessary that the psi-defense also depends solely on the "psiDefence" indicator in the armor.
« Last Edit: July 19, 2022, 10:40:13 am by Ethereal »

Online Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3158
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1158 on: July 20, 2022, 12:14:27 pm »
It could be, there are some differences between this too hooks, but basic scripts should be compatible between them, best is look in "verbose logging" to see what parameters are available in both cases, btw it should show too default script for `tryPsiAttackItem` that is responsible for attack algorithm.

Use this as template:
Code: [Select]
var int r;
set psi_attack_success 0; #override original value!!
random.randomRange r 0 55;
add psi_attack_success attack_strength;
add psi_attack_success r;
sub psi_attack_success defense_strength;
sub psi_attack_success distance_strength_reduction;
return psi_attack_success;

Offline Ethereal

  • Commander
  • *****
  • Posts: 610
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1159 on: July 20, 2022, 06:17:28 pm »
You know better. My knowledge of scripts is barely enough to edit them (and not only here, but also in Follaut, and in HMM-3 WoG and so on), but nothing more. Apparently, a special mindset is needed for this, but I, like Geppetto, can only master the serial production of wooden robots of the "Pinocchio" class.

Offline Delian

  • Colonel
  • ****
  • Posts: 240
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1160 on: July 28, 2022, 02:01:51 pm »
A fatal error has occurred: Interface articleTextImage not found
« Last Edit: July 28, 2022, 02:31:49 pm by Delian »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8563
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1161 on: July 28, 2022, 02:19:10 pm »
Update the whole OXCE, not just the EXE.

Offline Delian

  • Colonel
  • ****
  • Posts: 240
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1162 on: July 28, 2022, 02:30:22 pm »
Works now ::)

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1163 on: July 30, 2022, 02:25:51 pm »
Quote
aliens are now capable of running during escape battle action
@Meridian: what is that?


I don't get the object title when I use rect_text with type_id: 7 (AKA text image), see attachment.
Ruleset reference says the following about rect_text: In OXCE, it is also applicable to TextImage articles.
Code: [Select]
  - id: STR_DIMPROBE
    type_id: 7
    section: STR_XCOM_CRAFT_ARMAMENT
    image_id: UFOPAEDIA_IMG_DIMPROBE
    rect_text:
      x: 5
      y: 40
      width: 140
      height: 100
    #text_width: 140  # this works correctly
    text: STR_DIMPROBE_UFOPAEDIA

This is not a problem since I'm just going use text_width, but I still wanted to report this.
« Last Edit: July 30, 2022, 02:28:24 pm by robin »

Online Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3158
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1164 on: July 30, 2022, 02:47:25 pm »
@Meridian: what is that?
When alien decide to run away, and can run, it will run instead of walking.

Offline Rangerh

  • Colonel
  • ****
  • Posts: 114
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1165 on: August 01, 2022, 05:09:06 pm »
Never had the situation before so i never thought about it.

But after looking in all the menus i can't find anything about it, so is it possible in your base to assign an equipment to your soldier without using the Equip Craft -> Select a Ship -> Equipment -> Inventory ?

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8563
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1166 on: August 02, 2022, 09:09:28 am »
Never had the situation before so i never thought about it.

But after looking in all the menus i can't find anything about it, so is it possible in your base to assign an equipment to your soldier without using the Equip Craft -> Select a Ship -> Equipment -> Inventory ?

base > Soldiers > press I

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8563
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1167 on: August 02, 2022, 10:08:14 am »
I don't get the object title when I use rect_text with type_id: 7 (AKA text image), see attachment.
Ruleset reference says the following about rect_text: In OXCE, it is also applicable to TextImage articles.
Code: [Select]
  - id: STR_DIMPROBE
    type_id: 7
    section: STR_XCOM_CRAFT_ARMAMENT
    image_id: UFOPAEDIA_IMG_DIMPROBE
    rect_text:
      x: 5
      y: 40
      width: 140
      height: 100
    #text_width: 140  # this works correctly
    text: STR_DIMPROBE_UFOPAEDIA

This is not a problem since I'm just going use text_width, but I still wanted to report this.

`rect_text` only applies to the description text

for the title text, you still need `text_width`

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8563
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1168 on: August 04, 2022, 03:18:12 pm »
Suggestion
Quick change of vehicle equipment on keys 1-9 by analogy with the equipment of a soldier

is there a problem with that?

for me it works fine... video attached:
1. given a pistol to the first vehicle
2. pressed ctrl+1 to save equipment
3. selected second vehicle
4. pressed 1 to load the equipment from template

Offline Rangerh

  • Colonel
  • ****
  • Posts: 114
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #1169 on: August 06, 2022, 12:34:11 am »
base > Soldiers > press I
Thank you, that works nicely.