Shield Recharge Hook

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderators: Darksaber, General_Trageton, Forceflow, JeremyaFr, DTM

Post Reply

Shield Recharge Hook

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Mar 30, 2019 7:55 pm

Hello,
Here is a new hook.

xwa_hook_shield.zip

This hook permits to define shield recharge rates for any craft.

Suppose that the mission is "[MissionDir]\[Mission].tie".
Suppose that the craft is "FlightModels\[Model].opt".

The possible involved files are:
- "[MissionDir]\[Mission]_Shield.txt"
- "[MissionDir]\[Mission].ini", section "Shield"
- "FlightModels\[Model]Shield.txt"
- "FlightModels\[Model].ini", section "Shield"

To define the recharge rate, create a file named "FlightModels\[Model]Shield.txt" or create a section named "[Shield]" in "FlightModels\[Model].ini".
The format is:
UseGenerator = 0 to use RechargeRate or 1 to use PerGeneratorRechargeRate
PerGeneratorRechargeRate = per generator recharge value
RechargeRate = recharge value

If the file does not exist, default values are used.

By default, the recharge rate is controlled as this:
For starfighters the recharge rate is 20.
For Interdictor, Victory Star Destroyer, Imperial Star Destroyer, and Super Star Destroyer, the recharge rate is 5 multiplied by the number of shield generators still alive.
For other starships, the recharge rate is 5.
For other crafts, the recharge rate is 0.

For player craft, if the rate is 0 then it is set to 20.

To define the recharge rate for a craft for a given mission, create a file named "[MissionDir]\[Mission]_Shield.txt" or create a section named "[Shield]" in "[MissionDir]\[Mission].ini".
The format is a line per craft:
ModelIndex, UseGenerator, PerGeneratorRechargeRate, RechargeRate

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1531
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Sat Mar 30, 2019 10:44 pm

So, wait. Does this override the MXvTED stats? So say you have a "generic" baseline slot install for say "generic fighter", you call the ship in a mission that is overriding the default opt in that "generic" spot, the game then calls the shield stats from the .ini file rather than the "hard" stats in the .exe assigned to the slot itself?

Bman
Lieutenant JG
Posts: 628
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Mar 31, 2019 5:41 am

Awesome Jeremy thank you. Driftwood, I think so, otherwise default values are used as he wrote above. Very flexible if it works temporarily on a per mission file basis too. :2thumbs:
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Mar 31, 2019 8:35 am

What MXvTED calls Shield Recharge and Shield Decharge, I call them Score and Promo Points. These fields have nothing to do with shield.

User avatar
Mark_Farlander
Ensign
Rebel Alliance
Posts: 315
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Sun Mar 31, 2019 12:54 pm

Wonderful! That's why it never worked when I tried to edit those values.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Mar 31, 2019 1:31 pm

Hello,
I've updated the hook.
You can now define the shield recharge rate on a per mission basis.

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1531
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Sun Mar 31, 2019 3:36 pm

JeremyaFr wrote:
Sun Mar 31, 2019 8:35 am
What MXvTED calls Shield Recharge and Shield Decharge, I call them Score and Promo Points. These fields have nothing to do with shield.
So do they just affect the ship point value ingame?

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9970
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sun Mar 31, 2019 6:07 pm

JeremyaFr wrote:
Sun Mar 31, 2019 8:35 am
What MXvTED calls Shield Recharge and Shield Decharge, I call them Score and Promo Points. These fields have nothing to do with shield.
So your saying
Shield Rechange = Score
Shield Decharge = Promo Points

If so I could change these in MXvTED and BHE Modules
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Mar 31, 2019 6:47 pm

Driftwood wrote:
Sun Mar 31, 2019 3:36 pm
So do they just affect the ship point value ingame?
Yes
Darksaber wrote:
Sun Mar 31, 2019 6:07 pm
So your saying
Shield Rechange = Score
Shield Decharge = Promo Points

If so I could change these in MXvTED and BHE Modules
Yes

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9970
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sun Mar 31, 2019 6:57 pm

Cheers something to do on a rainy day :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
keiranhalcyon7
Cadet 1st Class
Posts: 196
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Mar 31, 2019 10:02 pm

Darksaber wrote:
Sun Mar 31, 2019 6:07 pm
If so I could change these in MXvTED
Now I'm curious. How?

Bman
Lieutenant JG
Posts: 628
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Mon Apr 01, 2019 1:59 am

Hi Jeremy, when we utilize UseGenerator = 1, PerGeneratorRechargeRate = 5, RechargeRate = 0, I'm assuming that means that a given .opt model must have at least one ShieldGenerator type Mesh present, otherwise UseGenerator = 0 .... statement is used. Is that fair statement? Thanks.
Last edited by Bman on Mon Apr 01, 2019 2:39 am, edited 1 time in total.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9970
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Apr 01, 2019 2:37 am

Bman wrote:
Mon Apr 01, 2019 1:59 am
In the data.txt file of MXvTED, at the bottom section rename like this . . .
Actually NO, wrong! That doesn't work, If changed using the data.txt file you'll only disable them

I'll actually change it from within, using Resource Hacker
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Bman
Lieutenant JG
Posts: 628
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Mon Apr 01, 2019 2:38 am

Ah, interesting. Thanks mate. I removed that part from my above post so not to confuse everyone.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Apr 05, 2019 6:17 pm

UPDATE

I've uploaded the hook to GitHub and OneDrive. It can be downloaded via XwaHooksSetup.

Post Reply