aliens

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - KingMob4313

Pages: [1] 2 3 ... 36
1
OpenXcom Extended / Re: More ModScript examples
« on: July 17, 2020, 12:35:36 am »
`battle_action` is value you seek for point 1)
Second point is on TODO list. Probably in this month I will have some things finished.

Thank you, Yankes, but no need to hurry.

The scripting is pretty intuitive as long as the scope is limited.  Still figuring out how to go from mode to mode, but the examples provided help.

I've just been playing with different things.  Got it to stop happening for smoke pretty easily and have it re-rolling damage rolls if the damage is under orig_power so that it will give base damage to 150% on a crit.

2
OpenXcom Extended / Re: More ModScript examples
« on: July 14, 2020, 12:56:52 am »
Here I will post some scripts I use to fine-tune the game experience to my liking

4. Critical hits. Code for simple critical hits. Might still be a bit finicky. I use this because I play with with a very low damageRange.

I've been playing around with the critical hit code, combining it to the "turn red for one frame" code and a message to show critical hits.
Code: [Select]
extraStrings:
  - type: en-US
    strings:
      STR_CRITICAL_HIT_MESSAGE: "Critical hit!"
extended:
  tags:
    BattleUnit:
      CRITICAL_STATE: int
      LAST_HIT_FRAME: int
    RuleItem:
      CRIT_CHANCE: int
      CRIT_DAMAGE: int
  scripts:
    # Future Script for luck
    #
    # Script for Criticals
    damageUnit:
      - offset: -1 # critical hits (balancing for lower damageRange)
        code: |
          var ptr RuleItem item_rule;
          var int weapon_chance;
          var int unit_chance;
          var int chance;
          var int crit_factor;  # 100 = 100% additional damage of original power
          var int crit_damage;
          var int temp;

          weapon_item.getRuleItem item_rule;

          unit.getTag unit_chance Tag.CRITICAL_STATE;
          item_rule.getTag weapon_chance Tag.CRIT_CHANCE;
          item_rule.getTag crit_factor Tag.CRIT_DAMAGE;

          add unit_chance weapon_chance;

          if eq unit_chance 0;
            set unit_chance 5;  # base chance of 5% for everybody
          end;

          if eq crit_factor 0;
            set crit_factor 100; # 100% additional damage as baseline for everybody on crit
          end;

          battle_game.randomChance unit_chance; # will set unit_chance to 1 on success
          if gt unit_chance 0;
            set crit_damage orig_power;
            muldiv crit_damage crit_factor 100;
            add to_health crit_damage;
            # Flash RED when crit hit
            # NEED TO BUILD IN A CHECK TO SEE IF ITS WEAPON DAMAGE FFS
            battle_game.flashMessage "STR_CRITICAL_HIT_MESSAGE";
            battle_game.getAnimFrame temp;
            unit.setTag Tag.LAST_HIT_FRAME temp;
            debug_log "CRITICAL HIT:" crit_damage;
          end;
          return;

    recolorUnitSprite:
      - offset: 10
        code: |
          var int temp;
         
          unit.getTag temp Tag.LAST_HIT_FRAME;
          if neq temp 0;
            sub temp anim_frame;
            if gt temp -3; #only 3 frames after hit have changed color
              set_color new_pixel 2; #red color
            end;
          end;
         
          return new_pixel;

I need to figure out
1) How to connect it to shoot script, since I'd love to have it as 5% for snap shots, 1% for auto shots and 10% for aimed shots.
   a) Also I need it to stop declaring critical hits for smoke
2) How to change the code so that it leaves off a damage roll and just gives the base damage number (100%) and then reduces armor effectiveness to 0.25

But I haven't been playing with it all that much yet. Too busy streaming.

Thanks for posting this up.

3
OpenXcom Extended / Re: [Documentation] OXCE Script examples
« on: July 10, 2020, 07:33:16 am »
My first script

A script I am using for my stream to keep soldiers from being wounded more than 13 days.

Code: [Select]
    returnFromMissionUnit:
      - offset: -2 # Changing injured time to less than 13
        code: |
          var int currentRecoveryDays 0;
          var int maxRecoveryDays 13;
          var int newRecoveryDays 0;
          debug_log "Original Recovery Time:" recovery_time;
          set currentRecoveryDays recovery_time;
          div currentRecoveryDays 5;
          debug_log "Changed Recovery Time:" currentRecoveryDays;
          if gt currentRecoveryDays 13;
            debug_log "Changed MAX Days Recovery from" currentRecoveryDays;
            set currentRecoveryDays 13;
          end;
          set recovery_time currentRecoveryDays;
          return;

4
OpenXcom Extended / Re: More ModScript examples
« on: July 07, 2020, 09:33:12 pm »

Yes, this is one option, and then in script (`hitUnit`) manually subtract armor value using your own logic. Probaby better is alter effectiveness  as is not avaiable to scripts right now (unit armor is).

Loops are on my TODO, this is bit tricky because I need made some refactors to make them easy to use and safe (I would prefer that scripts can't hang whole game).

Set Armor effectiveness to 0 or .25 or whatever fits. Got ya.

5
OpenXcom Extended / Re: More ModScript examples
« on: June 24, 2020, 05:30:25 am »
It should be possible, it would need some code to "revert" part done in engine, but most needed variables are avaialbe in scripts.

[ps]
One big drawback I find, `ArmorEffectiveness` is not exposed to scripts, this mean you need guess what values was.
Probably easiest way would be ignore complete current behavior of engine and write your own damage mechanism :D
I will look in this week if I can add details of damage type to scripts.

While it's not exposed, can you still set the armor or armor effectiveness to 0?

Thanks for peeking into it. I really need to look into the code deeper and see about if I can create more hooks. An inventory iterator would be nice like getInventoryArray()

6
OpenXcom Extended / Re: More ModScript examples
« on: June 23, 2020, 11:19:54 pm »
Here I will post some scripts I use to fine-tune the game experience to my liking
1. Alien Exposer
This one negates the vision advantage of the aliens and makes XCOM units see as good as them.
2. Accuracy Nerfer (Adjuster ;)
Allows global changes to the accuracy of all alien units. I use this if I think the aliens are aiming a bit too good  ;D Of course it can be used to make the Game even harder by just globally increasing the accuracy of your foes.
3. Power Nerfer
Same as the above. Allows global attack power adjustment of the enemies. Could also be used to make them hit harder..
4. Critical hits. Code for simple critical hits. Might still be a bit finicky. I use this because I play with with a very low damageRange.

Code: [Select]
extended:
  tags:
    BattleUnit:
      CRITICAL_STATE: int
    RuleItem:
      CRIT_CHANCE: int
      CRIT_DAMAGE: int
  scripts:
    visibilityUnit:
      - offset: -1 # alien exposer
        code: |
          var ptr RuleArmor armor_rule;
          var ptr RuleSoldier soldier_rule;
         
          observer_unit.getRuleSoldier soldier_rule; 

          if neq soldier_rule null;  # we have an xcom unit as observer
            if le distance distance_max;
              set current_visibility 100; # expose enemy unit if in max viewing dist (like the aliens..)
            end;
          end;
          return current_visibility visibility_mode;
    createUnit:
      - offset: -1 # accuracy nerfer
        code: |
          var ptr RuleSoldier soldier_rule;
          var int id;
          var int firing;
          var int adjustment;
         
          set adjustment 90; # 90% accuracy

          unit.getId id;
          unit.getRuleSoldier soldier_rule; 

          if eq soldier_rule null;  # we have an alien unit
            debug_log "Adjusting accuracy of unit" id;
            unit.Stats.getFiring firing;
            debug_log " - from" firing;
            muldiv firing adjustment 100;
            unit.Stats.setFiring firing;
            debug_log " - to" firing;
          end;
          return;
    hitUnit:
      - offset: -1 # power nerfer
        code: |
          var ptr RuleSoldier soldier_rule;
          var int id;
          var int firing;
          var int adjustment;
         
          set adjustment 70; # 70% power

          unit.getId id;
          unit.getRuleSoldier soldier_rule; 

          if neq soldier_rule null;  # we have an xcom unit
            debug_log "Adjusting power of hit against xcom unit" id;
            debug_log " - from" power;
            muldiv power adjustment 100;
            debug_log " - to" power;
          end;
          return power part side;
    damageUnit:
      - offset: -1 # critical hits (balancing for lower damageRange)
        code: |
          var ptr RuleItem item_rule;
          var int weapon_chance;
          var int unit_chance;
          var int chance;
          var int crit_factor;  # 100 = 100% additional damage of original power
          var int crit_damage;

          weapon_item.getRuleItem item_rule;

          unit.getTag unit_chance Tag.CRITICAL_STATE;
          item_rule.getTag weapon_chance Tag.CRIT_CHANCE;
          item_rule.getTag crit_factor Tag.CRIT_DAMAGE;

          add unit_chance weapon_chance;

          if eq unit_chance 0;
            set unit_chance 5;  # base chance of 5% for everybody
          end;

          if eq crit_factor 0;
            set crit_factor 20; # 20% additional damage as baseline for everybody on crit
          end;

          battle_game.randomChance unit_chance; # will set unit_chance to 1 on success
          if gt unit_chance 0;
            set crit_damage orig_power;
            muldiv crit_damage crit_factor 100;
            add to_health crit_damage;
            debug_log "CRITICAL HIT:" crit_damage;
          end;
          return;

 Curiously, is there a way to make critical hits negate a portion of armor instead?

7
Work In Progress / Re: [WIP][MOD][OXCE]Equal Terms 2.5 For OXCE
« on: June 20, 2020, 06:30:26 am »
I know in a lot of ways, my mod has been superseded by the mods that use elements of this older mod like UNEXCOM or by mods with a similar theme like The X-Com Files.

But if you're interested in what's coming with 2.5, go here:

https://www.twitch.tv/kingmob4313

I'm doing a stream.

Release should be ready in August.

8
OpenXcom Extended / Re: More ModScript examples
« on: June 10, 2020, 05:54:07 am »
I will put this here, since I do not know where to put this otherwise ;)


This is blowing my mind, thanks for posting this.

9
Released Mods / Re: [FINAL][MegaMod]Equal Terms 2.0++
« on: May 14, 2020, 06:43:37 pm »
hope the latest release of 049 fixes the rest of your issues.

Thanks for the bug report!

10
Released Mods / Re: [FINAL][MegaMod]Equal Terms 2.0++
« on: May 13, 2020, 10:56:40 pm »
The image issue is from a sloppy merge - same issue that screwed up the recon aircraft.  I will see about getting that completed.

I will try to troubleshoot the incendiary grenade issue - are the incendiary rockets and 40mm working?

[EDIT] It seems to be working fine.



[EDIT II] New version up with fixed images for the saw ammo and fixed a missing ufopedia entry for the small launcher.

https://openxcom.mod.io/equal-terms-20

11
Released Mods / Re: [FINAL][MegaMod]Equal Terms 2.0++
« on: May 13, 2020, 06:27:22 am »
Just fixed it - there were updates to the base xcom 1 ubase map list.

https://openxcom.mod.io/equal-terms-20

Just download the new mod and the map will generate properly.

12
Released Mods / Re: [FINAL][MegaMod]Equal Terms 2.0++
« on: May 13, 2020, 03:31:12 am »
Hello. I am trying this mod and it is pretty fun.

But now whenever I try to enter this alien base, the game crashes to desktop.

Also weird things I noticed: SAW magazine looks like 1x2 item but behaves like 2x1 and incendiary grenades do damage but do not light things on fire.

Hello! I'll investigate these two issues tonight. Thanks for the feedback.

[Edit] looks like a map creation error.  Reproduced it, now working on fixing it.

[Edit 2] Okay,
Error gets thrown here:
   if (_blocksToDo)
   {
      throw Exception("Map failed to fully generate.");
   }
I need to figure out WTF is happening with base generation that could be causing this issue.

13
Released Mods / Re: [FINAL][MegaMod]Equal Terms 2.0++
« on: April 28, 2020, 06:55:10 am »
Recently played the latest version and there's a crash after getting research results for Plasma Magnum.

Crappy typo in the Plasma Magnum mag code.

New version up at:
https://openxcom.mod.io/equal-terms-20/

14
Released Mods / Re: [FINAL][MegaMod]Equal Terms 2.0++
« on: April 27, 2020, 03:40:44 pm »
Recently played the latest version and there's a crash after getting research results for Plasma Magnum.

I will investigate this tonight. Thank you.

15
Released Mods / Re: [FINAL][MegaMod]Equal Terms 2.0++
« on: April 22, 2020, 05:21:17 am »
Hello,

New version 2.0.046 up.

https://openxcom.mod.io/equal-terms-20


Pages: [1] 2 3 ... 36