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 - Nirran

Pages: 1 ... 4 5 [6] 7
76
Help / Re: Limiting Stat Gains with scripting
« on: October 29, 2023, 10:12:39 pm »
Here's a simple example to set your custom TU increase after a mission:

Code: [Select]
extended:
  scripts:
    returnFromMissionUnit:
      - offset: 10
        code: |
          var int statFromGame;
          var int statFromGameDiff;
          var int statByModder;

          soldier.Stats.getTimeUnits statFromGame;   # new soldier TU
          statChange.getTimeUnits statFromGameDiff;  # how much TU was gained this mission

          set statByModder statFromGame;             # let's take the new soldier TU
          sub statByModder statFromGameDiff;         # and remove the gain to get the old soldier TU
          add statByModder 42;                       # add whatever custom amount you want

          soldier.Stats.setTimeUnits statByModder;   # set the newly calculated amount
          return;

This is just for illustration, in a real script, you will need to consider stat caps, whether any experience was gained or not, etc.

tyvm Meridian,got it working!

77
Help / Limiting Stat Gains with scripting
« on: October 29, 2023, 10:47:58 am »
hello

       im trying to limit stam tu and hp gains,unfortunatly this script snip doesnt work,and way of doing this with scripting some other way or with a rul file?

Code: [Select]
          #limit TimeUnits
          statChange.getTimeUnits changeTimeUnits; #how much TimeUnits was incresed by exp
          soldier.Stats.getTimeUnits origTimeUnits; #current TimeUnits (alredy with bonsu value from exp)
          battle_game.randomRange value valueMin valueMax;
          add currTimeUnits value; #effective 1-2 points
          soldier.Stats.setTimeUnits currTimeUnits;  
         
          #limit Stamina
          statChange.getStamina changeStamina; #how much Stamina was incresed by exp
          soldier.Stats.getStamina origStamina; #current Stamina (alredy with bonsu value from exp)
          battle_game.randomRange value valueMin valueMax;
          add currStamina value; #effective 1-2 points
          soldier.Stats.setStamina currStamina;

          #limit Health
          statChange.getHealth changeHealth; #how much Health was incresed by exp
          soldier.Stats.getHealth origHealth; #current Health (alredy with bonsu value from exp)
          battle_game.randomRange value valueMin valueMax;
          add currHealth value; #effective 1-2 points
          soldier.Stats.setHealth currHealth;

78
Released Mods / Re: [OXCE] XCOM Multimod
« on: March 04, 2021, 02:06:48 am »
That seems to be intentional. You should be using (heavy) lasers instead. That's why I brought them together with high explosives to Cydonia.

Spoiler:
Sectpod

Armor
70 Front
60 Sides
50 Rear
50 Under

DamageModifiers
  80% Plasma
150% Laser
  60% Explosive

Weapons
Heavy Plasma 64 flat => 80% * 64 = 51
Heavy Laser 52 flat => 150% * 52 = 78
High Explosive 200 flat => 60% * 200 = 120


thnx,confirmed during play :)

79
Released Mods / Re: [OXCE] XCOM Multimod
« on: February 28, 2021, 12:38:05 am »
fraking kidding me? 50+ hits with heavy plasma didnt kill it

Code: [Select]
  - type: STR_SECTOPOD_ARMOR_UC
    spriteInv: sectopodInv
    spriteSheet: X_ROB.PCK
    allowInv: false
    corpseBattle:
      - SECTOPOD_CORPSE_1
      - SECTOPOD_CORPSE_2
      - SECTOPOD_CORPSE_3
      - SECTOPOD_CORPSE_4
    corpseGeo: STR_SECTOPOD_CORPSE
    frontArmor: 70
    sideArmor: 60
    rearArmor: 50
    underArmor: 50
    drawingRoutine: 5
    size: 2
    damageModifier:
      - 1.0
      - 1.0
      - 0.2
      - 0.6
      - 1.5
      - 0.8
      - 0.0
      - 1.0
      - 1.0
      - 0.0
    loftempsSet: [ 92, 89, 90, 91 ]
    personalLight: 0

80
Released Mods / Re: [OXCE] XCOM Multimod
« on: February 26, 2021, 03:43:09 am »
maybe,i disabled it,see if it crashes again

81
Released Mods / Re: [OXCE] XCOM Multimod
« on: February 25, 2021, 11:52:26 pm »
crash when entering large ufo map with lightning,never seen this before with skyranger,twice it happened today

Code: [Select]
[25-02-2021_13-45-35] [FATAL] FileRecord::at(TERRAIN/GMOUNT.MCD): requested file not found.
[25-02-2021_13-45-35] [FATAL] A fatal error has occurred: FileRecord::at(TERRAIN/GMOUNT.MCD): requested file not found.
[25-02-2021_13-45-35] [FATAL] 0x5b1ca0 OpenXcom::CrossPlatform::stackTrace(void*)
[25-02-2021_13-45-35] [FATAL] 0x5b2b10 OpenXcom::CrossPlatform::crashDump(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[25-02-2021_13-45-35] [FATAL] 0x41c880 exceptionLogger()
[25-02-2021_13-45-35] [FATAL] 0xb90650 MPEGaction::MPEGaction()
[25-02-2021_13-45-35] [FATAL] 0xd95a00 void std::iter_swap<__gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > >, __gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > > >(__gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > >, __gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > >)
[25-02-2021_13-45-35] [FATAL] 0xd9b6c0 std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M_expression_term<true, true>(std::pair<bool, char>&, std::__detail::_BracketMatcher<std::__cxx11::regex_traits<char>, true, true>&)::{lambda(char)#1}::operator()(char) const
[25-02-2021_13-45-35] [FATAL] 0x5bb940 OpenXcom::FileMap::at(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[25-02-2021_13-45-35] [FATAL] 0x5bbb30 OpenXcom::FileMap::getIStream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[25-02-2021_13-45-35] [FATAL] 0x788cf0 OpenXcom::MapDataSet::loadData(OpenXcom::MCDPatch*, bool)
[25-02-2021_13-45-35] [FATAL] 0x509ed0 OpenXcom::BattlescapeGenerator::generateMap(std::vector<OpenXcom::MapScript*, std::allocator<OpenXcom::MapScript*> > const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[25-02-2021_13-45-35] [FATAL] 0x50e580 OpenXcom::BattlescapeGenerator::run()
[25-02-2021_13-45-35] [FATAL] 0x6aa470 OpenXcom::ConfirmLandingState::btnYesClick(OpenXcom::Action*)
[25-02-2021_13-45-35] [FATAL] 0x5ce5b0 OpenXcom::InteractiveSurface::handle(OpenXcom::Action*, OpenXcom::State*)
[25-02-2021_13-45-35] [FATAL] 0x6856c0 OpenXcom::State::handle(OpenXcom::Action*)
[25-02-2021_13-45-35] [FATAL] 0x5c9c80 OpenXcom::Game::run()
[25-02-2021_13-45-35] [FATAL] 0x41c950 SDL_main
[25-02-2021_13-45-35] [FATAL] 0x9ab990 console_main
[25-02-2021_13-45-35] [FATAL] 0x9abab0 WinMain
[25-02-2021_13-45-35] [FATAL] ??
[25-02-2021_13-45-35] [FATAL] ??
[25-02-2021_13-45-35] [FATAL] 0x7ffc38f87c10 BaseThreadInitThunk
[25-02-2021_13-45-35] [FATAL] 0x7ffc396ed700 RtlUserThreadStart

most recent save

82
Help / Re: adding items to map blocks
« on: February 10, 2021, 11:30:49 pm »
my bad,new to forums and ocxe modding

You need to start asking questions with more context dude, we don't know what you're talking about...

For example, there is no divisor for Elerium in items.rul ...

I am running 'XCOM Multimod' and it has this in items rul with alien alloys,assumed it could be used for elerium as well

Code: [Select]
    recoveryDividers:
      STR_UFO: 10
      STR_OTHER: 150

It can be in any rul file, there are no limitations.
Again, probably incorrectly asked question.

ah thought they would be standardized naming convention,guess not,i read about this setting in ocxe thread,figured it would be in a rul file,want to utilize it

what?

looking for a script offset that fires when mission is entered

83
Help / adding items to map blocks
« on: February 10, 2021, 08:13:21 pm »
settings in items rul have elerium at 150 divisor,assuming if i lower it more elerium will be recovered?

also what rul file has the randomizedItems setting in map blocks?

and can point me to a script that fires at mission start>?

84
Help / Re: code snip help please
« on: February 09, 2021, 01:12:48 am »
any way of coding or using rule settings for all stats for override ?

i want to make each gain small while having a large stat cap,and engine increases individual gains with higher stat caps

85
Help / Re: code snip help please
« on: February 09, 2021, 12:29:05 am »
ok :( thnx

86
Help / Re: code snip help please
« on: February 08, 2021, 10:25:45 pm »
ok did some testing these throw errors :

code is
Code: [Select]
statChange.getTimeUnits incTimeUnits;error is
Code: [Select]
[ERROR] Error in parsing script 'returnFromMissionUnit' for 'Global Event Script': invalid operation name 'statChange.getTimeUnits'
code is
Code: [Select]
statPrevious.getTimeUnits origTimeUnits;error is
Code: [Select]
[ERROR] Error in parsing script 'returnFromMissionUnit' for 'Global Event Script': invalid operation name 'statPrevious.getTimeUnits'
code is
Code: [Select]
unit.Exp.getTimeUnits changeTimeUnits;error is
Code: [Select]
[ERROR] Error in parsing script 'returnFromMissionUnit' for 'Global Event Script': invalid operation name 'unit.Exp.getTimeUnits'
however this is in the 'verboseLogging' dump

Code: [Select]
Name: rules                                   ptr       RuleMod 
Name: soldier                                 ptre      GeoscapeSoldier
Name: statChange                              ptr       StatAdjustment
Name: statPrevious                            ptr       StatAdjustment
Name: unit                                    ptre      BattleUnit

87
Help / Re: code snip help please
« on: February 08, 2021, 08:22:42 pm »
thank you,i got the list of synthax,how are these declared?

Code: [Select]
#Name: soldier                                 ptre      GeoscapeSoldier
#Name: statChange                              ptr       StatAdjustment
#Name: statPrevious                            ptr       StatAdjustment
#Name: unit                                    ptre      BattleUnit

this way errors in .log
Code: [Select]
          var ptr StatAdjTime statChange;
          var ptr StatPrev statPrevious;

88
Help / Re: code snip help please
« on: February 08, 2021, 03:11:08 pm »
it seems these arent valid,got them off a forum post here,all 4 produce errors  in .log

Code: [Select]
          #statPrevious - original stats before mission (read only)
          #statChange - stats change from exp (read only)
          #soldier.Stats - current stats of geoscape soldier, if you change it it will permanently change stats of soldier
          #unit.Stats - stats of battle soldier, changed by armor. Only affect current battle.
          #unit.Exp - exp grain during battle (read only)

does a list of scripting commands exist?

89
Help / code snip help please
« on: February 08, 2021, 02:20:46 pm »
why doesnt this work?ive tried many variations,none do anything

im trying to remove the engine added stats and use my own

this is available commands i read(is this wrong?)

Code: [Select]
          #statPrevious - original stats before mission (read only)
          #statChange - stats change from exp (read only)
          #soldier.Stats - current stats of geoscape soldier, if you change it it will permanently change stats of soldier
          #unit.Stats - stats of battle soldier, changed by armor. Only affect current battle.
          #unit.Exp - exp grain during battle (read only)

and this is what i have so far

Code: [Select]
          #arbitrary value
          #unit.Exp.getTimeUnits changeTimeUnits;
          #statChange.getTimeUnits changeTimeUnits;
          statPrevious.getTimeUnits prevTimeUnits;  
          soldier.Stats.getTimeUnits origTimeUnits;
          sub origTimeUnits prevTimeUnits;
          soldier.Stats.getTimeUnits currTimeUnits;
          #battle_game.randomRange value valueMin valueMax;
          sub currTimeUnits origTimeUnits; #remove engine added  
          #add origTimeUnits value; #add 1-3 to old stat
          soldier.Stats.setTimeUnits currTimeUnits; #overwrite stat +1-3

90
Help / Re: soldier ezperience
« on: February 08, 2021, 11:21:15 am »
ok got it mostly,now need to disable engine stat gains

Pages: 1 ... 4 5 [6] 7