Hack: Decreasing Dark Event frequency

Post Reply
Antifringe
Posts: 226
Joined: Tue Jan 24, 2017 9:52 pm

Hack: Decreasing Dark Event frequency

Post by Antifringe »

Dark Events have a cooldown period of 4-6 days. There can be 2 Tactical and 1 temporary DEs pending at a time, and the two types use separate cooldown timers, which results in a lot of DEs per month.

This isn't a discussion about whether the default frequency is too high or not. The game has been playtested a lot, and I tend to agree that the current numbers work. This is for people (like myself) who want to change those numbers anyway, as a matter of personal taste.

I don't really grok the SDK, but I can do dirty hacks just fine. Using UEX and a hex editor, I figured out how to hack the compiled scripts to change the cooldown timers. This post is for people like me that understand hex editting, but not actual coding, and would like to make the same kinds of changes that I did.

The file that you want to edit is called LW_Overhaul.uc It will be in the Script folder of your longwar mod directory (Steam/steamapps/workshop/268500/844674609/Script if you are using the steam version of the mod). BACK IT UP!

No really, back up your file before doing anything.

Here are the strings you want to change. I'm including the token data as a convenience, but it's really only the hex strings that you need:

COINRESEARCH

(3C6/26A) [0F 19 00 3C 22 00 00 09 00 26 1D 00 00 00 01 26 1D 00 00 1E 00 00 C0 42]
L(36/24) -> C(30/18) -> LV(9/5) -> IV(9/5) -> FC(5/5)
Cooldown.Cooldown_Hours = 96.0

(3EA/282) [0F 19 00 3C 22 00 00 09 00 25 1D 00 00 00 01 25 1D 00 00 1E 00 00 40 42]
L(36/24) -> C(30/18) -> LV(9/5) -> IV(9/5) -> FC(5/5)
Cooldown.RandCooldown_Hours = 48.0


COINOPS
(342/216) [0F 19 00 6F 22 00 00 09 00 26 1D 00 00 00 01 26 1D 00 00 1E 00 00 C0 42]
L(36/24) -> C(30/18) -> LV(9/5) -> IV(9/5) -> FC(5/5)
Cooldown.Cooldown_Hours = 96.0

(366/22E) [0F 19 00 6F 22 00 00 09 00 25 1D 00 00 00 01 25 1D 00 00 1E 00 00 40 42]
L(36/24) -> C(30/18) -> LV(9/5) -> IV(9/5) -> FC(5/5)
Cooldown.RandCooldown_Hours = 48.0

It's the last two bytes that contain the actual timer information. The numbers are floats, so you have to understand how to write a float number in hex. Here's a quick table of numbers for the lazy

48 = 40 42 (default min)
72 = 90 42 (50% increase to min)
96 = C0 42 (100% increase to min)
144 = 10 43 (200% increase to min)


96 = C0 42 (default max)
144 = 10 43 (50% increase to max)
192 = 40 43 (100% increase to max)
288 = 90 43 (200% increase to max)

Just find the string using the hex editor of your choice and swap in the numbers that you want. You will have to edit four strings to get them all.

For example, to change the cooldown maximum on tactical dark events (COINResearch) from 96 hours to 192 hours, you would search for

0F 19 00 3C 22 00 00 09 00 26 1D 00 00 00 01 26 1D 00 00 1E 00 00 C0 42

and change it to

0F 19 00 3C 22 00 00 09 00 26 1D 00 00 00 01 26 1D 00 00 1E 00 00 40 43

I've checked and all four of these strings are unique, so you don't have to worry about accidentally changing something else.

Anyways, I hope this helps people, since DEs are a thing lots of people want more control over. Maybe a future patch will expose these numbers to the ini. Maybe not! Until, we can just hack.
Post Reply