Jump to content

Acquiring Hack chance


RivvaDead

Recommended Posts

Edit: SOLVED!

Thanks to 'hairlessorphan' suggestion here's the code:

local UIHackingScreen HackingScreen;
local float HackChance;

HackingScreen = UIHackingScreen(`SCREENSTACK.GetScreen(class'UIHackingScreen'));

HackChance = HackingScreen.GetHackChance(HackingScreen.SelectedHackRewardOption);

Hi,

 

I'm making a mod that develops soldier skills on the battlefield during combat a la Jagged Alliance style (and probably many other games like that).

I'm gonna publish the mod tommorow, however I've decided to expand its functionality.

Give a bonus for challenging feats like hiting an enemy with a small chance and so on.

 

Unfortunately for that I need to access the hack percentage chance.

I have the percentage for attacks but when I check the same variables within hacking ability i get 0 in all integers.

 

Does anyone know where is the hack chance located?

 

Any help appreciated,

Thanks!

Edited by RivvqPL
Link to comment
Share on other sites

Please... please... PLEASE! I beg you... add +5 points to the hack skill on all successful hacks performed by all soldiers, including console ones. The current state of hacking is a disaster and while it would be nice to gain a small bonus for low hit % shots but aren't there some mechanics similar to that already in place? Invisible %?

Link to comment
Share on other sites

There are two classes I can point you to.

 

The first is where the hacking roll is initiated. That's UIHackingScreen.uc.

 

There's a call stack that eventually leads to where the roll is actually made. That's X2AbilityToHitCalc_Hacking.uc. This class also has the static functions to calculate relevant bonuses.

 

Depending on how you want to implement your bonus, it'll be somewhere between these two classes.

Edited by hairlessorphan
Link to comment
Share on other sites

There are two classes I can point you to.

 

The first is where the hacking roll is initiated. That's UIHackingScreen.uc.

 

There's a call stack that eventually leads to where the roll is actually made. That's X2AbilityToHitCalc_Hacking.uc. This class also has the static functions to calculate relevant bonuses.

 

Depending on how you want to implement your bonus, it'll be somewhere between these two classes.

 

I've seen those classes previously but thought that there was a way to get hack chance more easily. Turns out it's actually very simple with UIHackingScreen.uc!

 

Thanks to your encouragement I've played around with it and got it, so THANKS :D!

I've also updated the first post with the code for anyone else.

 

Thanks again!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...