SLAM Hook
Moderator: JeremyaFr
SLAM Hook
-
- Posts: 218
- Joined: Mon Dec 08, 2014 10:59 pm
EDIT: Jeremy has created a SLAM hook, see below.
Appears to be in XWA after all, just dormant.
Addresses of where its accessed:
0042C6F9
00473F6E
004908B7
00490941
SLAM input is in field F6 (2 bytes) in the Craft Instance pointer
I will eventually either implement this in the multiplayer hook or a separate hook with using some key to access the SLAMS. But if Jeremy or someone else wants to give it go for it, then this should help.
Appears to be in XWA after all, just dormant.
Addresses of where its accessed:
0042C6F9
00473F6E
004908B7
00490941
SLAM input is in field F6 (2 bytes) in the Craft Instance pointer
I will eventually either implement this in the multiplayer hook or a separate hook with using some key to access the SLAMS. But if Jeremy or someone else wants to give it go for it, then this should help.
Last edited by Justagai on Sat Jan 19, 2019 12:34 am, edited 3 times in total.
- Phoenix Leader
- Posts: 437
- Joined: Wed Aug 08, 2018 2:20 pm
Missile Boats reaching 426 MGLT?
That would be awesome!
N to target the next buoy.
I'm afraid the only free letter is K.
That would be awesome!
N to target the next buoy.
I'm afraid the only free letter is K.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Hmm.... Nice find, I hope it works, and it's not just a remanent from the older Tie Fighter engine
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death
Current Holder of the Frying Pan of Death
- Phoenix Leader
- Posts: 437
- Joined: Wed Aug 08, 2018 2:20 pm
SLAM=SubLight Acceleration Motor (https://starwars.wikia.com/wiki/SubLigh ... tion_Motor )
It was a system available for the Missile Boat in TIE Fighter.
It was a system available for the Missile Boat in TIE Fighter.
- JeremyaFr
- Posts: 4002
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
Here is a hook that enables the SLAM system. Thanks Justagai for the idea.
I've mapped the SLAM command to the K key.
In the current version, all crafts have SLAM. I will add a section in the ini file to define which ships have SLAM.
Done
Here is a hook that enables the SLAM system. Thanks Justagai for the idea.
I've mapped the SLAM command to the K key.
In the current version, all crafts have SLAM. I will add a section in the ini file to define which ships have SLAM.
Done
Last edited by JeremyaFr on Sat Jan 19, 2019 4:53 pm, edited 2 times in total.
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- Phoenix Leader
- Posts: 437
- Joined: Wed Aug 08, 2018 2:20 pm
All fighters SLAM capable would be awesome!
- Jaeven
- Posts: 578
- Joined: Mon Mar 30, 2015 3:18 am
Great work. Makes you wonder what other features are hidden in the game.
Not sure that would fit lore wise.
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
No, it definitely would not work lore wise. Missileboat and k-wing as far as I know are the only ships canonically equipped with it. One possible exception is the assault gunboat since FFGs has the slam action, and disney considers that canon. However the ffg gunboat pretty much retains the missileboat out of existence at this point and fills both rolls depending on the hardpoint modules installed.
If there were variable speed "slams" you could interpret them as booster equipped ships ala SWG, or a modification to the T70 ala TLJ.
I'm glad we finally have this function though since it was one of the only things missing relative to TIE fighter.
As an aside I still wonder what the cluster mine function is supposed to do.
If there were variable speed "slams" you could interpret them as booster equipped ships ala SWG, or a modification to the T70 ala TLJ.
I'm glad we finally have this function though since it was one of the only things missing relative to TIE fighter.
As an aside I still wonder what the cluster mine function is supposed to do.
-
- Posts: 218
- Joined: Mon Dec 08, 2014 10:59 pm
Awesome!
It may be possible that the variable that controls what craft have SLAMS is still in the game (although I think I would have seen something like that if that was the case in the code). But it can be controlled by an ini file as well (probably would be better that way as its easier to modify).
- JeremyaFr
- Posts: 4002
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
I've updated the hook.
I've added a section named "[Slam] in the per craft ini file with a value named "HasSlam".
Set HasSlam = 1 to enable the SLAM on a ship.
The hook will also display a message when the player craft has no SLAM system ("Your craft does not have a [SLAM] system") and when the SLAM is activated ("Engine overdrive boosters [engaged]"). The messages come from the "strings.txt" file and are translated is a "XWA.TAB" file exists.
Please redownload xwa_hook_slam.zip
I've updated the hook.
I've added a section named "[Slam] in the per craft ini file with a value named "HasSlam".
Set HasSlam = 1 to enable the SLAM on a ship.
The hook will also display a message when the player craft has no SLAM system ("Your craft does not have a [SLAM] system") and when the SLAM is activated ("Engine overdrive boosters [engaged]"). The messages come from the "strings.txt" file and are translated is a "XWA.TAB" file exists.
Please redownload xwa_hook_slam.zip
Nowhere in the exe the SLAM is activated. There is no variable that controls which craft have SLAMS.
-
- Posts: 243
- Joined: Mon Mar 03, 2008 12:01 am
First of all, congratulations to both of you for finding and reactivating the code for the SLAM system.
Before the hooks came about 4 years ago, I had never thought it was possible to reintroducde the SLAM system in XWA.
Excellent work.
I guess you're probably aware of this already, but I'd like to report these minor issues anyways.
The first one is that you currently can't deactivate the SLAM system manually, so you have to wait until the laser capacitor has drained out.
The second one is a missing power up sound effect when activating the SLAM system. The shut down one works properly though.
Again, well done. I can't tell you how excited I am to see that feature finally returning to XWA.
Before the hooks came about 4 years ago, I had never thought it was possible to reintroducde the SLAM system in XWA.
Excellent work.
I guess you're probably aware of this already, but I'd like to report these minor issues anyways.
The first one is that you currently can't deactivate the SLAM system manually, so you have to wait until the laser capacitor has drained out.
The second one is a missing power up sound effect when activating the SLAM system. The shut down one works properly though.
Again, well done. I can't tell you how excited I am to see that feature finally returning to XWA.
Last edited by Fek'LeyrTarg on Sat Jan 19, 2019 9:23 pm, edited 1 time in total.
- JeremyaFr
- Posts: 4002
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
I've updated the hook.
Now, a second press on K will disengage the SLAM system.
Now, a second press on K will disengage the SLAM system.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Thanks Jeremy works really great
Just looking through in the readme, at the bottom in the Credits, I just see your name shouldn't Justagai's name be on there too, for finding the offsets and the idea?
Sorry if I'm stepping on toes here
Just looking through in the readme, at the bottom in the Credits, I just see your name shouldn't Justagai's name be on there too, for finding the offsets and the idea?
Sorry if I'm stepping on toes here
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 4002
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
You're right.
I've added Justagai to the readme's credits section.
I've added Justagai to the readme's credits section.
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- ual002
- Posts: 983
- Joined: Wed Sep 24, 2008 2:23 am
I would imagine one of those TIE Booster/ TIE Experimental M5 would probably have the SLAM too. Just a guess, I have no evidence to back that up.
-
- Posts: 218
- Joined: Mon Dec 08, 2014 10:59 pm
If you want to add sound to the SLAM activation/deactivation:
In slam.cpp:
In hooks.h:
This will allow sounds to be played from both activation and deactivation of SLAMS, as well as the deactivation sound when cannons are empty.
EDIT: I choose sounds 0x92 and 0x95 for the activation and deactivation as I feel it sounds the best for SLAMS but if you feel there are better sounds for it then feel free to change them.
EDIT 2: Ah the sounds have changed with the darksaber upgrade pack. I'll gather another set.
EDIT 3: I recommend using sounds 0x23 for activation and 0x21 for deactivation for SLAMS in the DSUCP, but up to you folks.
In slam.cpp:
Code: Select all
int SlamHook(int* params)
{
params[-1] = 0x004FDBFF;
const int playerIndex = params[76];
const int objectIndex = params[69];
XwaObject* XwaObjects = *(XwaObject**)0x007B33C4;
const auto ShowMessage = (void(*)(int, int))0x00497D40;
const auto PlaySoundFromObject = (void(*)(int, int, int))0x0043BF90; //added
const unsigned short modelIndex = XwaObjects[objectIndex].ModelIndex;
int hasSlam = modelIndex == 0 ? 0 : g_modelIndexSlam.HasSlam(modelIndex);
if (hasSlam == 0)
{
XwaObjects[objectIndex].pMobileObject->pCraft->IsSlamEnabled = 0;
// MSG_NOT_EQUIPPED_SLAM
ShowMessage(294, playerIndex);
}
else
{
if (XwaObjects[objectIndex].pMobileObject->pCraft->IsSlamEnabled)
{
XwaObjects[objectIndex].pMobileObject->pCraft->IsSlamEnabled = 0;
// MSG_OVERDRIVE_OFF
ShowMessage(372, playerIndex);
PlaySoundFromObject(0x95, 0xFFFF, playerIndex); //added, play sound 0x95 in player cockpit
}
else
{
XwaObjects[objectIndex].pMobileObject->pCraft->IsSlamEnabled = 1;
// MSG_OVERDRIVE_ON
ShowMessage(371, playerIndex);
PlaySoundFromObject(0x92, 0xFFFF, playerIndex); //added, play sound 0x92 in player cockpit
}
}
return 0;
}
Code: Select all
static const HookPatchItem g_slamPatch[] =
{
{ 0x100DB3, "19", "00" },
{ 0x100D5E, "26", "19" },
{ 0x100CF8, "AEC14F00", "74185000" },
{ 0x100C72, "5F5E5B8BE55DC3", "EB10E8A7720A00" },
{ 0x8FDA1, "82", "95" }, //added, plays sound 0x95 when cannons are empty from SLAMS
};
EDIT: I choose sounds 0x92 and 0x95 for the activation and deactivation as I feel it sounds the best for SLAMS but if you feel there are better sounds for it then feel free to change them.
EDIT 2: Ah the sounds have changed with the darksaber upgrade pack. I'll gather another set.
EDIT 3: I recommend using sounds 0x23 for activation and 0x21 for deactivation for SLAMS in the DSUCP, but up to you folks.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
I can change them back to the default sounds if that helps, just let me know what the actual names of the sounds are, it doesn't bother me that the sounds will be the default sounds
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
-
- Posts: 218
- Joined: Mon Dec 08, 2014 10:59 pm
To be honest, I'm not sure of what the exact names are...but here are some videos that can help identify them:
Vanilla SLAM Sounds: https://1drv.ms/v/s!AoEpIrw6LOkUjcdARFgJ8Q_oVRwJAA
DSUCP SLAM Sounds: https://1drv.ms/v/s!AoEpIrw6LOkUjcdBeBSMgw_cH3YjNQ
EDIT: I think I like the DSUCP sounds way more, too bad they aren't in the original
EDIT 2: I believe the vanilla sounds are one of the hangar entry in and out, the DSUCP sounds are explosions I think
Vanilla SLAM Sounds: https://1drv.ms/v/s!AoEpIrw6LOkUjcdARFgJ8Q_oVRwJAA
DSUCP SLAM Sounds: https://1drv.ms/v/s!AoEpIrw6LOkUjcdBeBSMgw_cH3YjNQ
EDIT: I think I like the DSUCP sounds way more, too bad they aren't in the original
EDIT 2: I believe the vanilla sounds are one of the hangar entry in and out, the DSUCP sounds are explosions I think