Author Topic: scripting annoyance  (Read 1853 times)

Offline Nirran

  • Captain
  • ***
  • Posts: 94
    • View Profile
scripting annoyance
« on: November 03, 2023, 02:02:44 am »
hello,

am i using wrong synthax for this maxstat value?cause with this the script breaks

Code: [Select]
          # Custom XP Points for Health
          soldier.Stats.getHealth statFromGame;    # this mission stat total
          statChange.getHealth statFromGameDiff;   # stat gained from engine this battle
          BattleUnit.getHealthMax soldier maxstat; # .rul max stat
          set statByModder statFromGame;             
          sub statByModder statFromGameDiff;         
          battle_game.randomRange value valueMin valueMax;
          add statByModder value;
          if neq statFromGameDiff 0;
              soldier.Stats.setHealth statByModder;  
          end;

if i coment battleunit it works

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: scripting annoyance
« Reply #1 on: November 03, 2023, 10:21:27 am »
Yes, you are using wrong syntax.

Offline Nirran

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: scripting annoyance
« Reply #2 on: November 03, 2023, 06:14:28 pm »
Alrighty Thnx

Offline Nirran

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: scripting annoyance
« Reply #3 on: November 03, 2023, 09:32:36 pm »
ok passed last hurdle,now a question

Code: [Select]
soldier.StatsMax.getStrength statmax;
returns max or cap from soldier ruleset?

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: scripting annoyance
« Reply #4 on: November 03, 2023, 09:44:18 pm »
Max, for cap there is `*.StatsCap.*`

Offline Nirran

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: scripting annoyance
« Reply #5 on: November 04, 2023, 12:57:56 am »
Max, for cap there is `*.StatsCap.*`

tyvm!

happ[en to know the synthax?it isnt same as Battleunit

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: scripting annoyance
« Reply #6 on: November 04, 2023, 02:51:41 am »
Its same as `*.StatsMax.*` had, it effective copy paste of this other group of functions.
Look in verbose logging output for all available functions.

Offline Nirran

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: scripting annoyance
« Reply #7 on: November 04, 2023, 03:29:27 am »
Its same as `*.StatsMax.*` had, it effective copy paste of this other group of functions.
Look in verbose logging output for all available functions.

yea i did try it,it breaks the script

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: scripting annoyance
« Reply #8 on: November 04, 2023, 11:01:49 am »
Code: [Select]
          var ptr RuleSoldier soldierRuleset;
          var int statCap;

          unit.getRuleSoldier soldierRuleset;
          soldierRuleset.StatsCap.getTimeUnits statCap;

Offline Nirran

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: scripting annoyance
« Reply #9 on: November 05, 2023, 03:27:30 am »
Code: [Select]
          var ptr RuleSoldier soldierRuleset;
          var int statCap;

          unit.getRuleSoldier soldierRuleset;
          soldierRuleset.StatsCap.getTimeUnits statCap;

tyvm once again =D