Turrets hook

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

Moderator: JeremyaFr

Post Reply

Turrets hook

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 25, 2020 1:44 pm

Hello,
I've updated the mission objects/turrets hook.

You can now define more than 2 turrets.
The craft turrets are no longer limited to CorellianTransport2, MilleniumFalcon2, and FamilyTransport. You can now enable turrets for any craft.

Suppose that the player craft is "FlightModels\[Player].opt".

The possible involved files are:
- "FlightModels\[Player]Turrets.txt"
- "FlightModels\[Player].ini", section "[Turrets]"
- "FlightModels\[Player]Gunner.opt"
- "FlightModels\[Player]Gunner2.opt"
- "FlightModels\CorellianTransportGunner.opt"

To define the turrets, create a file named "FlightModels\[Player]Turrets.txt" or create a section named "[Turrets]" in "FlightModels\[Player].ini".
If the file does not exist, default values are read from XWingAlliance.exe.
The format is a line per turret:
PositionX, PositionY, PositionZ, OrientationX, OrientationY, ArcX, ArcY, OptModel, IsInverted

If a turrets section is not used, there is a limit of 2 turrets per craft.
To define a custom gunner opt, create a "[Player]Gunner.opt" file.
To define a second custom gunner opt, create a "[Player]Gunner2.opt" file.

See "FamilyTransportTurrets.txt".

Code: Select all

; FamilyTransportTurrets.txt
; PositionX, PositionY, PositionZ, OrientationX, OrientationY, ArcX, ArcY, OptModel, IsInverted
0, 19, 250, 49152, 16384, 12040, 17308, CorellianTransportGunner, 0
0, 19, 250, 16384, 49152, 12040, 17308, CorellianTransportGunner, 1

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jan 25, 2020 2:52 pm

So in BHE and MXvTED OrientationX (Turret 1 or 2 Orient 1) is set to 0 on Turret 1 and 32536 on Turret 2. Why is it set to 49152 in your version in the txt file?

Is 49152 = to 0 and 32536????

Puzzled
“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
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 25, 2020 3:23 pm

Are you sure about your values?

BHE shows -16384 and 16384.

bhe_yt2000_turrets.png

-16384 (signed short) corresponds to 49152 (unsigned short).

In the turrets section, the values can be writen signed or unsigned. The two formats are supported.
You do not have the required permissions to view the files attached to this post.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jan 25, 2020 3:38 pm

Ah damn your right, I just checked a vanilla exe

I apologise for that, but thanks I may have missed that in future releases
“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
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jan 25, 2020 4:03 pm

Hold on a minute I just remembered, I have Rookie_One1's Cockpit Orientation fix in place, the reason numbers are different

This the Original Turret Settings
OriginalSettings.jpg
This is the Turrets Settings for the fixed Cockpit Orientation all files available in the link above
FixedOrientation.jpg
You do not have the required permissions to view the files attached to this post.
“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
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 25, 2020 4:30 pm

I just tested with the fix and it works.
You need to edit the txt file with the new values.

I will not modify the sample file as the fix is not part of the hook. I prefer to keep the original values as example in the hook zip.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 25, 2020 4:37 pm

Code: Select all

; FamilyTransportTurrets.txt
; PositionX, PositionY, PositionZ, OrientationX, OrientationY, ArcX, ArcY, OptModel, IsInverted
0, -19, 250, 0, 16384, 12040, 17308, FamilyTransportGunner, 0
0, 19, 250, 32536, 49152, 12040, 17308, FamilyTransportGunner2, 1

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jan 25, 2020 8:07 pm

The Position X and Y are the other way around in the txt/ini file, Why I don't know

Code: Select all

; FamilyTransportTurrets.txt
; PositionX, PositionY, PositionZ, OrientationX, OrientationY, ArcX, ArcY, OptModel, IsInverted
0, -19, 250, 0, 16384, 12040, 17308, FamilyTransportGunner, 0
0, 19, 250, 32536, 49152, 12040, 17308, FamilyTransportGunner2, 1
I don't know if it's the same for your vanilla settings, sorry I can't test that at the moment thanks for the OrientationX, OrientationY settings though, I had those mixed up at first :)

It should actually now look like this

Code: Select all

; FamilyTransportTurrets.txt
; PositionX, PositionY, PositionZ, OrientationX, OrientationY, ArcX, ArcY, OptModel, IsInverted
-19, 0, 250, 0, 16384, 12040, 17308, FamilyTransportGunner, 0
19, 0, 250, 32536, 49152, 12040, 17308, FamilyTransportGunner2, 1
“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
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 25, 2020 8:35 pm

Nice catch.
It seems that I've inverted X and Y.
I will fix that.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 25, 2020 9:01 pm

Fixed.

I inverted X and Y.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jan 25, 2020 10:41 pm

Yep you fixed that, but I've found another bug, without the Hook and on a vanilla install, while your in the turrets the lasers are always unlimited, but now with this Hook the lasers are no longer unlimited and decharge (if that's the right word??)

I dunno you might have unintentionally fixed it, but I've always known the turret lasers to be unlimited, it anyone else can test this, just to make sure I'm not going gar-gar :D
“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
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Sun Jan 26, 2020 3:23 am

Darksaber wrote:
Sat Jan 25, 2020 10:41 pm
Yep you fixed that, but I've found another bug, without the Hook and on a vanilla install, while your in the turrets the lasers are always unlimited, but now with this Hook the lasers are no longer unlimited and decharge (if that's the right word??)

I dunno you might have unintentionally fixed it, but I've always known the turret lasers to be unlimited, it anyone else can test this, just to make sure I'm not going gar-gar :D
Yeah the turrets need to be recharged now. I'm okay with this!

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jan 26, 2020 2:54 pm

Fixed.

The turret lasers are now unlimited.
Ions and missiles are not unlimited, except if unlimited warheads config is set to on.

User avatar
Rookie_One1
Rebel Alliance
Posts: 1656
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Mon Jan 27, 2020 2:49 pm

I'm guessing that this hook will finally permit turrests on craft that have them but that we did not configure them, such as the Y-wing BTL-B
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Mon Jan 27, 2020 5:43 pm

No.

You could always add up to two turrets under the old turret patch to any ship provided that you configured the appropriate hardpoints, opts and exe edits for POV and arc coordinates.

What this does is allow an opt creator to add up to 8 turrets, 2 via mxvted/bhe as normal and an additional 6 via ini file. It also allows you to define what weapons are available on the turret and relevant gunner opt by hardpoint. Thus you could have an ion turret, laser turret, missile turret, or some other combination. For instance, if one were to create a cockpit and interior for a freighter, capital ship, or transport that has more than two turrets, the player could use all of them, not just up to two by default. It also would allow less traditional turret or gunnery system designs to be created using this functionality.

I have a few project concepts I'm working on using these features for both personal and XWAU in the long run. They'll be functional but I'm not sure yet how they will work as a player controllable craft, rather than a scripted mission narrative element.
I have three that I'm currently developing, a gunship, a large capital ship, and a heavy fighter that existed in old EU canon. The first two will be exploring new concepts that may or may not turn out the way I am expecting at this time. And if they do work as I am thinking may not be every bodies cup of tea.

I do wish the lasers weren't fixed back to unlimited since it's super exploited in the campaign by the player by being able to dump lasers to engines to gain more speed and have unlimited ammunition. If that needs to stay for functional reasons I'd personally prefer that unlimited turret laser/limited laser (again ion and missiles aren't unlimited) via ini file for the relevant ship. I played with the limited laser function and it did make for some less brainless gameplay.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Jan 27, 2020 6:35 pm

Driftwood wrote:
Mon Jan 27, 2020 5:43 pm
I do wish the lasers weren't fixed back to unlimited since it's super exploited in the campaign by the player by being able to dump lasers to engines to gain more speed and have unlimited ammunition. If that needs to stay for functional reasons I'd personally prefer that unlimited turret laser/limited laser (again ion and missiles aren't unlimited) via ini file for the relevant ship. I played with the limited laser function and it did make for some less brainless gameplay.
I don't think it's realistic to ask for the unlimited turret lasers to go away en mass. Even if you, personally, can beat all the family transport missions without them, I expect that too many people are attached to them. But given the speed that Jeremy was able to correct the issue, having a craft-level .ini setting to control it sounds feasible.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Jan 27, 2020 7:03 pm

I have to agree with keiranhalcyon7, the turret lasers have always been unlimited, whether or no it was a mistake, we'll never now, Jeremy could, like I said unintentionally fixed it, but since 1999 the turret lasers have always been unlimited, changing them now could unbalance some of the missions, I dunno.

Like keiran said it could possibly be made an option in a ini/txt file, but I would think it would have to be global and not by craft, possibly add the option in an existing cfg file or it's own cfg file?
“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
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Jan 27, 2020 7:50 pm

UPDATE

I've added a config file.

By default, the turrets lasers are unlimited. They can be made limited by setting "UnlimitedTurretLaser = 0" in "hook_mission_objects.cfg".

Code: Select all

; UnlimitedTurretLaser = 0 or 1
; When set to 0, the lasers are limited
; When set to 1, the lasers are unlimited
UnlimitedTurretLaser = 1

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Jan 27, 2020 7:56 pm

Thanks Jeremy, that bypasses any argument now :)
“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
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Jan 27, 2020 7:57 pm

Question - will this setting affect both player and AI craft, or just player craft?

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Jan 27, 2020 8:00 pm

The setting affects only the player craft.

User avatar
Rookie_One1
Rebel Alliance
Posts: 1656
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Mon Jan 27, 2020 8:05 pm

Darksaber wrote:
Mon Jan 27, 2020 7:03 pm
I have to agree with keiranhalcyon7, the turret lasers have always been unlimited, whether or no it was a mistake, we'll never now, Jeremy could, like I said unintentionally fixed it, but since 1999 the turret lasers have always been unlimited, changing them now could unbalance some of the missions, I dunno.
On that, from the dummied messages in B0M2, it look like originally it was to be rechargeables laser. They probably made it unlimited because of balancing issues and explained it away by saying that turrets have their own power generators
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Jan 27, 2020 8:19 pm

Rookie_One1 wrote:
Mon Jan 27, 2020 8:05 pm
On that, from the dummied messages in B0M2, it look like originally it was to be rechargeables laser. They probably made it unlimited because of balancing issues and explained it away by saying that turrets have their own power generators
Fascinating - there's also a reference in there to rolling the ship from the turret.

User avatar
Rookie_One1
Rebel Alliance
Posts: 1656
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Tue Jan 28, 2020 12:23 am

Yep.

Look like they actually planned a bit more before removing it because of balancing issues or to keep it simple
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

Post Reply