Escort Shuttle Turret

Any issues with the XWAU or X-Wing Alliance? Please let us know here!

Escort Shuttle Turret

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Sun Feb 02, 2020 1:16 am

In version 2.6 of DSUCP, it looks like the Escort Shuttle's turret is not working. I searched for topics in relation to this but I couldn't find any so I'm assuming this is a new bug.

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

Post by Darksaber » Sun Feb 02, 2020 9:49 am

It's not a bug it's never been enabled.
“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 » Sun Feb 02, 2020 1:17 pm

I've added hardpoints to the turret, see if it works ok, if it fires through the hull of the craft, then that's the reason they where removed
EscortShuttle_2020_02_02.rar
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
Rookie_One1
Rebel Alliance
Posts: 1657
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Sun Feb 02, 2020 2:29 pm

Do we know what caused this issue that caused you to remove it ?
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

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

Post by JeremyaFr » Sun Feb 02, 2020 2:50 pm

I tested the craft.

When the turret is set to autofire, it works fine.
When the laser turret fire is linked to forward position, the turret fires through the craft.

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

Post by Darksaber » Sun Feb 02, 2020 3:07 pm

Yep that was the reason I removed the hardpoints

Though when XWA was first released, it was not a flyable craft, it's only us that has made it flyable

Quick Question, as it is supposed to be non flyable, how do the AI craft handle the turret, do they fire through there hull?

since I'm not setup to test, can someone confirm that AI craft do or do not fire through the hull, I have a feeling they won't fire through the hull

Like I said these craft where never meant to be flyable, therefore if we want the turret to be enabled again like the original, we will just have to put up with the lasers firing through the hull if we want the craft flyable.
“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: 3987
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Feb 02, 2020 3:24 pm

It seems fine when used by AI.
AI craft do not fire through the hull.

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

Post by Darksaber » Sun Feb 02, 2020 3:45 pm

Thanks for testing Jeremy, plus Thanks for the updated Hooks :)
“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 » Sun Feb 02, 2020 5:53 pm

Jeremy, I don't suppose there would be a way to resolve this issue with a hook? The simplest solution probably being to just disable turrets whose arcs don't include "straight forward" during fixed-forward mode?

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

Post by JeremyaFr » Sun Feb 02, 2020 8:47 pm

Hello,
Here is an updated WIP of the turrets hook.

EDIT: link removed

To disable the turret forward fire, set "TurretForwardFire = 0" in the [Turrets] section of the craft ini file.
The default value is "1".

Code: Select all

;EscortShuttleTurrets.txt
TurretForwardFire = 0
Last edited by JeremyaFr on Thu Feb 06, 2020 4:45 pm, edited 1 time in total.

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

Post by Driftwood » Sun Feb 02, 2020 8:49 pm

Neat. I was also going to suggest this since it's an exploitable "feature" of the game I don't care for but don't agree with removal of turret hardpoints to "fix it".

Everybody wins. :D

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

Post by keiranhalcyon7 » Sun Feb 02, 2020 9:38 pm

Ah. That's even simpler than what I had in mind. No math needed.

Theoretically there could be some dissonance with a hypothetical craft that has some turrets that can fire in the forward arc, and others that can't. That could be resolved by having a separate setting for each turret.

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

Post by Rookie_One1 » Sun Feb 02, 2020 10:10 pm

Nice
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 » Sun Feb 02, 2020 11:43 pm

Hmm, yeah. Skirmish has always been set to use Team one, IFF green, red laser, and Team two IFF red, green laser for ships w/ turrets specifically. AI or otherwise. If you set an AI ISD to be part of team one it fires red lasers, if you put a Calamari crusier on team two it fires Green lasers. I think they just "hardcoded" team IFFs to do so to represent "Rebel" and "Imperial" teams in skirmish, that said I have no idea how this would apply if using more than two teams.

It's kinda funny how we find the small non-game (though immersion) breaking bugs, and Jeremya finds a fix usually before we ask for one.

Bman
Lieutenant Commander
Posts: 1170
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Mon Feb 03, 2020 12:36 am

I won't have internet access until next weekend (been 3 weeks since I've moved) just my phone. But I wanted to say I already solved this issue if anyone goes back and reads the lambda shuttle thread. It should work for Escort shuttle and other Craft too. I'll repost solution here, hang tight. Thanks for hook Jeremy. Looking forward to testing it.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

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

Post by keiranhalcyon7 » Mon Feb 03, 2020 1:05 am

Clearly, the turret is being operated by a traitor!

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

Post by Darksaber » Mon Feb 03, 2020 1:08 pm

Here's a copy of my EscortShuttle.ini

Code: Select all

;EscortShuttle.ini

[Camera]
;Camera X,Y,Z
X = -300
Y = 1000
Z = 150

FamX = -200
FamY = 850
FamZ = 50

[SFoils]
;mesh index, angle, closing speed, opening speed
3, 90, 2, 2
4, 90, 2, 2
6, 90, 2, 2
7, 90, 2, 2

CloseSFoilsInHyperspace = 0
SFoilsAnimationSpeed = 1

[SFoilsLandingGears]
;mesh index, angle, closing speed, opening speed
10, 96, 2, 2
11, 96, 2, 2

[Size]
ClosedSFoilsElevation = 140

[Sound]
EngineSoundInterior = 0
EngineSoundFlyBy = 5

WeaponSoundBehavior = Empire

[Turrets]
TurretForwardFire = 0

[WeaponColor]
WeaponColor = 0
WeaponColor282 = 0
WeaponColor283 = 0

WeaponImpactColor_3100 = BF5FD6FF
WeaponImpactColor_3200 = 80FF0000
WeaponImpactColor_3300 = BF55FF00
WeaponImpactColor_3400 = 804A0080
WeaponImpactColor_3500 = BFFFE700

WeaponImpactColor282 = BF55FF00
WeaponImpactColor283 = BF55FF00

WeaponLightColor282 = 0
WeaponLightColor283 = 0

Code: Select all

Laser Color Legend

Green/Red = 0 Depending on Imp or Reb
Red/Green = 1 Depending on Imp or Reb
Purple = 2
Yellow = 3
LightBlue = 4
Blue = 5
RedPurple = 6
BluePurple = 7
Black = 8
I found in skirmish that the turret lasers are Red, but the the other three lasers are Green, even though the 3 forward laser hardpoints are set to 282 Empire, and the two Rear Turret lasers are set as 283 TurboEmpire, both should fire green lasers, I know in skirmish that if your on one team the lasers are usually red while the other teams lasers are green or visa versa.

in the ini file I have the weapons set as such

Code: Select all

[WeaponColor]
WeaponColor = 0
WeaponColor282 = 0
WeaponColor283 = 0


So be default they use they should use green lasers

So I had a thought just to test I set the weapons colour

So set it like so

Code: Select all

[WeaponColor]
WeaponColor = 3
WeaponColor282 = 3
WeaponColor283 = 3

Let me clarify 3 = Yellow Lasers

Anyhow all lasers fired Yellow

Another test I set the color to 1 (Red)

Code: Select all

[WeaponColor]
WeaponColor = 1
WeaponColor282 = 1
WeaponColor283 = 1
In Skirmish now, my forward lasers fire Red and the rear turret lasers fire Green

My Question is:- How come I can force the laser color to any of the colors from 2 to 8 but I can't force 0 or 1 (Red or Green)

If you set WeaponColor = 0 or 1 the game will either use Green or Red depending which team your

Have I stumbled upon on a bug, because if I set 282 (EmpireLaser HP) to 0 then the lasers should be Green, if I set 283 (TurboEmpireLaser HP) to 0 again it should be Green but in skirmish they are Red.

It's not just the Escort Shuttle, I just test the Lambda Shuttle, same thing happens

AI I don't think this applies, it's just the flyable craft, could the 0 (Green) and 1 (Red) be switched for TurboEmpireLasers HP's in the Hook_Weapon_Color.dll??????

DUN DUN DUUUUN!!! TUNE IN NEXT WEEK, SAME TIME, SAME CHANNEL FOR THE NEXT THRILLING EPISODE OF "HOOK_WEAPON_COLOR.DLL"!!!!
“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: 3987
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Feb 03, 2020 5:59 pm

Hello,

In the exe, there is this code:

Code: Select all

        si = s_pXwaCurrentCraft->WeaponRacks[A8].ModelIndex;

        if( s_ExeWeaponSide[si - ModelIndex_280_1_17_LaserRebel] != 0xFF )
        {
            if( s_V0x05FE758[s_XwaObjects[A4].pMobileObject->Iff] != s_ExeWeaponSide[si - ModelIndex_280_1_17_LaserRebel] )
            {
                si = s_ExeWeaponSideModel[si - ModelIndex_280_1_17_LaserRebel];
            }
        }
When the side of the weapon is different from a hardcoded value for the IFF, the game engine switchs the model index of the weapon.

To disable it, you can apply this patch:

Code: Select all

At offset 0E169B, replace 741B with EB1B.

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

Post by Rookie_One1 » Mon Feb 03, 2020 6:50 pm

Yet again : JEREMY STRIKES AGAIN!

Will be added to the weapon color DLL or to the XWA patcher ?
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

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

Post by Darksaber » Mon Feb 03, 2020 7:25 pm

I thought there may have been a bug in the Hook_Weapon_Color.dll, apparently not I just disabled the Hook_Weapon_Color.dll and tested again, both AI craft and the craft the craft your flying, fire green forward lasers but the turret fires Red Lasers, it's strange.

This offset put things right in my mind, why on team one and team two do all craft have to fire Green or Red Lasers, if I had an ISD on my team I would still expect it to fire Green lasers, it would be the same if the ISD was on the other team I'd expect it to fire Green Lasers.

So now with this Offset the craft your flying or the craft you flying against, fires lasers it has programmed into the opt.

Thanks Jeremy
“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
Rookie_One1
Rebel Alliance
Posts: 1657
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Mon Feb 03, 2020 7:42 pm

Anyway, added the offset manually to the patcher on my side, i'm gonna test the hell out of it tonight
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

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

Post by JeremyaFr » Mon Feb 03, 2020 8:45 pm

Hello,

Here is a WIP version of the weapon color hook.

EDIT: link removed

I've include the above patch.
I've also include a config setting to enable or disable the laser switch based on the IFF. This should work for any craft, player crafts, AI crafts, turrets, starships...

To enable weapon switch based on IFF, set "WeaponSwitchBasedOnIff = 1" in "hook_weapon_color.cfg".
To disable it, set "WeaponSwitchBasedOnIff = 0".
The default value is "0".
You can override this value with a setting named "WeaponSwitchBasedOnIff" in the file named "FlightModels\[Model]WeaponColor.txt" or the section named "[WeaponColor]" in "FlightModels\[Model].ini".
Set "0" to disable or "1" to enable the feature or "-1" to use the global setting.
The default value is "-1".
Last edited by JeremyaFr on Thu Feb 06, 2020 4:46 pm, edited 4 times in total.

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

Post by keiranhalcyon7 » Mon Feb 03, 2020 8:50 pm

Darksaber wrote:
Mon Feb 03, 2020 7:25 pm
why on team one and team two do all craft have to fire Green or Red Lasers, if I had an ISD on my team I would still expect it to fire Green lasers, it would be the same if the ISD was on the other team I'd expect it to fire Green Lasers.
This is in fact a very ingrained behavior of the game. There is a mission in X-Wing where you capture a corvette, which goes from firing green lasers to red lasers mid-mission.

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

Post by Rookie_One1 » Mon Feb 03, 2020 9:37 pm

Nice Jeremy!

Wonder if it would be possible to switch it to the ships config files instead or even customize a bit (by that, I mean force yellow IFF to use rebels iff lasers instead of imperials, etc...)
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

Bman
Lieutenant Commander
Posts: 1170
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Mon Feb 03, 2020 11:30 pm

Excellent Jeremy. I don't know about skirmish side but for regular missions the other IFF FG teams like yellow and blue, red, and Azzameen etc. Can be allied teams associated with Rebel or Imperial side. This is done in the AlliED editor on one of the tabs. Good example from TF missions is the Nhwaarak is alliied with empire and Dimoks are allied with Rebellion. I got it work. Also in the model .ini files if we mark the opposite IFF weaponcolorslotXXX mapped to a specific FG color index texture it should display as is. I.e. for weaponcolor288 = 0 and weaponcolor289 = 3. Should show first texture map of RebelSuperLaser.opt and the fourth texture map in Empire SuperLaser.opt file.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

Post Reply