Author Topic: [OLD] Old OXCE+ discussion thread  (Read 720111 times)

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #840 on: September 26, 2016, 08:43:16 pm »
Never mind, I found it - the unfortunate bit is that it would either require rewriting calculateTrajectory in Projectile.cpp to accept another variable to force-fire without holding CTRL just for this condition, or making a duplicate method, either in Projectile.cpp or ProjectileFlyBState.cpp... and that feels like a very kludgy fix.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #841 on: October 01, 2016, 04:09:51 pm »
New version is up.

2016-09-30
 + Fixed medikit experience training
 + More space (modOffset) for bigger mods (by Yankes), more info: https://github.com/Yankes/OpenXcom/commit/5d62e26e1341f0f4f22969fe40f5d5312ab8150e
 + Option for auto-sell in debriefing (by Stoddard)
 + Support for custom palettes (local) in Ufopedia, more info: https://openxcom.org/forum/index.php/topic,4957.0.html
 + Fix for generating default armor out of nothing

Download: https://drive.google.com/open?id=0B8itkFQbhj-YZDdkZlJrMEphODg

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #842 on: October 06, 2016, 10:09:28 pm »
New version is up.

2016-10-06
 + Updated to OXCE 3.3

Download: https://drive.google.com/open?id=0B8itkFQbhj-YSVhuMFRNdW94dms

PS: data files are the same as for OXCE 3.2
PS2: https://github.com/MeridianOXC/OpenXcom/commits/oxce3.3-plus-proto

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Meridian's resources and mods for X-PirateZ
« Reply #843 on: October 07, 2016, 02:37:20 pm »
Is there any practical reason to upgrade to 3.3? I kinda got loss in Yankes' explanations, the only thing I've understood is performance loss.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #844 on: October 07, 2016, 02:54:47 pm »
Here's the summary from Yankes.

Small recap what is possible with new visibility scripts:
a) Some unit can be visible only to some other units, something like A can see B, C can see D but A cant see D and C cant see B.
b) Items in hands can affect visibility of units, you can add NV googles that need be held in hands to allow see in darkens or masking device that will cloaking you.
c) Effectiveness of visibility is stored as integer value. Greater than zero mean that other unit is visible. This allow gun scope that add value to that number increasing effective sight radius of unit. Alternative you can subtract to recreate some camouflage. As IR visibility should not be affected by scopes or normal camouflage, I added option for distinguish between different visibility modes. Normal visibility (in visible light lengths) is defined by empty value `null` other types can be defined by new tag in `BattleUnitVisibility`.
d) You have access to raw data of smoke and fire density, this allow you to change how smoke affect visibility or allow fire to prevent use of IR.
e) You can add penalty for NV googles if target is in bright spot, or simply add bonus/penates based on relative lighting level of tiles where units stand (current and target) to simulate that you can't see thing in shadow.
f) All units stats can contribute to visibility. You can made cloaking device that will fall or reduce it effectiveness when unit lose hp (or current TU).

What I understood is that you can now script various visibility modes, including things like the camouflage, counter-camouflage and heat vision from OXCE+... but with greater control over it (you can use more variables for calculation and even consider items in hands). You can't do psi-vision-like scripts yet. So, if you want more than what I "hardcoded" in OXCE+, this gives you the tools to do it.

Performance loss is not confirmed yet.
There is inevitably some (like with every new feature), but we don't know how big it is until we try it out.

EDIT: and there is also the "mod size" feature... which gives you possibility to use IDs bigger than 1000 without conflicts... which I strongly suggest using instead of IDs > 100000 used at the moment.

EDIT2: also I think light doesn't go through solid objects (like walls) anymore... but I haven't really played yet, so that's just what I saw in some demo video
« Last Edit: October 07, 2016, 03:02:04 pm by Meridian »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Meridian's resources and mods for X-PirateZ
« Reply #845 on: October 07, 2016, 03:10:46 pm »
OK, so mod size (useful) and realistic lighting (confirmed, looks really cool!). As for scripting, well... I have no idea what to do with it. Learning "Yankes C" is a major commitment and I won't do that unless there is some critical gain in sight.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #846 on: October 07, 2016, 03:57:50 pm »
As for scripting, well... I have no idea what to do with it. Learning "Yankes C" is a major commitment and I won't do that unless there is some critical gain in sight.

Yeah, I also have no idea how powerful it is or how to use it...
... best would be: if you have a new idea which involves visibility, first ask Yankes if it can be done by a script ... if yes, he'll help with the script itself... if not, raise a change request with me, him, or whomever is willing to listen :)

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #847 on: October 07, 2016, 07:04:09 pm »
OK, so mod size (useful) and realistic lighting (confirmed, looks really cool!). As for scripting, well... I have no idea what to do with it. Learning "Yankes C" is a major commitment and I won't do that unless there is some critical gain in sight.

Yeah, I also have no idea how powerful it is or how to use it...
... best would be: if you have a new idea which involves visibility, first ask Yankes if it can be done by a script ... if yes, he'll help with the script itself... if not, raise a change request with me, him, or whomever is willing to listen :)
This, I will eagerly help with firsts scripts. Example of usage that could affect gameplay without lot of changes is made that today invisible units could be see by units holding mindprobes.
Dioxine what behavior would you like to have in case of visibility?


Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Meridian's resources and mods for X-PirateZ
« Reply #848 on: October 07, 2016, 09:15:45 pm »
1. How to make hand-held night vision goggles?

2. How to make a silenced pistol which grants bonus to reactions when fired?

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #849 on: October 07, 2016, 10:38:21 pm »
1. How to make hand-held night vision goggles?

2. How to make a silenced pistol which grants bonus to reactions when fired?

1:
Code: [Select]
extended:
  tags:
    RuleItem:
      XPIRATEZ_NV_GOGGLES: int
   
  scripts:
    visibilityUnit:
      - offset: 3
        code: |
          var int itemA;
          var int itemB;
          var int targetShade;
          var ptr BattleItem item;
          var ptr RuleItem type;
         
          if eq visibility_mode null;
            #get info about left hand item
            observer_unit.getLeftHandWeapon item;
            item.getRuleItem type;
            type.getTag itemA Tag.XPIRATEZ_NV_GOGGLES;
           
            #get info about right hand item
            observer_unit.getRightHandWeapon item;
            item.getRuleItem type;
            type.getTag itemB Tag.XPIRATEZ_NV_GOGGLES;
           
            #if left or rigth item have NV bonus
            if or eq itemA 1 eq itemB 1;
              target_unit.getTileShade targetShade;
              if le targetShade 9;
                add current_visibility 64; #16*4 = 4 tiles better visibility in dark
              end;
            end;
          end;
         
          return current_visibility visibility_mode;

items:
  - type: STR_SOME_GOGGLES
    tags:
      XPIRATEZ_NV_GOGGLES: 1
With that item in hands unit will see 4 tiles further in dark.


2:
Code: [Select]
extended:
  tags:
    RuleItem:
      XPIRATEZ_STEALTH_GUN: int
   
  scripts:
    reactionWeaponAction:
      - offset: 1
        code: |
          var int temp;
          var int reaction_attacer;
          var int reaction_viewer;
          var ptr RuleItem gun_type;
         
          weapon.getRuleItem gun_type;
          gun_type.getTag temp Tag.XPIRATEZ_STEALTH_GUN;
          if neq temp 1;
            #not stelf weapon, we quit with defualt value
            return reaction_chance;
          end;
         
          #reaction score of unit that react to action done by `action_unit`
          reaction_unit.geReactionScore reaction_viewer;
         
          #reaction score of shooter
          action_unit.geReactionScore reaction_attacer;
         
          #we buff attacker reaction score
          mul reaction_attacer 2;
         
          if lt reaction_viewer reaction_attacer;
            set reaction_chance 0; #set 0% chance to react
          end;
          return reaction_chance;

items:
  - type: STR_SOME_WEAPON
    tags:
      XPIRATEZ_STEALTH_GUN: 1
When shooting this weapon shooter will have effective 2 time more Reaction stats in case of calculating of other unit reactions.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Meridian's resources and mods for X-PirateZ
« Reply #850 on: October 08, 2016, 02:17:21 pm »
Nice, thanks! This doesn't look too scary - as long as one has a list of possible operators...

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #851 on: October 08, 2016, 03:21:15 pm »
Nice, thanks! This doesn't look too scary - as long as one has a list of possible operators...
This is all dumped in log if you run exe with verbose log. I did that to not bother with updating documentation each time I add something.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Meridian's resources and mods for X-PirateZ
« Reply #852 on: October 08, 2016, 03:23:57 pm »
Yankes, can you use this script to make a gun with night vision? I'm thinking a hi-tech rifle with NV sights. (Redundant if you have NV armour, but otherwise could help.)

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: Meridian's resources and mods for X-PirateZ
« Reply #853 on: October 08, 2016, 04:45:32 pm »
Yankes, can you use this script to make a gun with night vision? I'm thinking a hi-tech rifle with NV sights. (Redundant if you have NV armour, but otherwise could help.)
NV will work with any item that have "XPIRATEZ_NV_GOGGLES" (you can rename it to something else :)), weapons too. Right now only part about "Redundant" will be hard because Maridain mod pars are not jet exposed to script and you can't know easy if armor have NV (but you can add redundant information that script can read).

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Meridian's resources and mods for X-PirateZ
« Reply #854 on: October 09, 2016, 08:15:19 pm »
I've tried adding that script for NV item, but it doesn't seem to work...