SLAM Hook

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

Moderator: JeremyaFr

Re: SLAM Hook

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

Post by Rookie_One1 » Wed Feb 13, 2019 7:18 pm

Would that even be possible ?
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 » Wed Feb 13, 2019 8:41 pm

Probably. The better question is, is it worth the effort? Remember, the system was only designed for & tested with one craft. There are probably all sorts of abusable corner cases when it's enabled it for others.
Last edited by keiranhalcyon7 on Wed Feb 13, 2019 9:37 pm, edited 1 time in total.

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

Post by Rookie_One1 » Wed Feb 13, 2019 8:44 pm

abusable corners ? what a weird image

*abuse corner*
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

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

Post by Justagai » Sun Feb 24, 2019 6:34 am

There seems to be an issue with the hook. If one uses SLAMS during a mission, then quits and refiles, the sound won't play anymore.

In slam.cpp:

Code: Select all

if (hasSlam && !soundsLoaded)
	{
		soundsLoaded = true;
...
		}
The issue here I believe is that the sound isn't checked if it's loaded or not. Removing "!soundsLoaded" fixes the issue, but I'm sure there are better solutions.

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

Post by JeremyaFr » Sun Feb 24, 2019 11:30 am

Thanks for the bug report.

I've fixed it.

Please redownload xwa_hook_slam.zip

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

Post by JeremyaFr » Tue Apr 27, 2021 3:30 pm

UPDATE

Hello,
I've updated the SLAM hook.

I've added support for an upcoming sounds hook.

User avatar
AngeI
Lieutenant JG
Posts: 522
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Mon Jan 24, 2022 8:59 pm

Hi @JeremyaFr, we've noticed a bug or at least an unintentional feature of SLAM. Basically if you press the key, even with zero energy available, the SLAM will still briefly activate and cause a speed boost. You can basically abuse this system by rapidly tapping the K key to activate SLAM and with persistence achieve the maximum speed boost even without laser energy. I don't know if some sort of brief cooldown can be enabled or a way for it to check for sure there is energy available before activating, but hopefully something that can be fixed.

User avatar
capitanguinea
Galactic Empire
Posts: 226
Joined: Sun Aug 30, 2015 3:59 pm

Post by capitanguinea » Fri Feb 11, 2022 10:24 am

It is due to the fact that the value of laser capacitor is shown discretized in game in number of shots ready to be fired but the value itself is continuos. So even when you have not enough to burn a laser shot aimed to target the system has energy allocated to his capacitors and Slam can use it for a quick boost.

User avatar
AngeI
Lieutenant JG
Posts: 522
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Fri Feb 11, 2022 5:06 pm

capitanguinea wrote:
Fri Feb 11, 2022 10:24 am
It is due to the fact that the value of laser capacitor is shown discretized in game in number of shots ready to be fired but the value itself is continuos. So even when you have not enough to burn a laser shot aimed to target the system has energy allocated to his capacitors and Slam can use it for a quick boost.
Makes sense. The question is can we make it so it doesn't do this for SLAM :D

User avatar
capitanguinea
Galactic Empire
Posts: 226
Joined: Sun Aug 30, 2015 3:59 pm

Post by capitanguinea » Fri Feb 11, 2022 6:43 pm

AngeI wrote:
Fri Feb 11, 2022 5:06 pm
capitanguinea wrote:
Fri Feb 11, 2022 10:24 am
It is due to the fact that the value of laser capacitor is shown discretized in game in number of shots ready to be fired but the value itself is continuos. So even when you have not enough to burn a laser shot aimed to target the system has energy allocated to his capacitors and Slam can use it for a quick boost.
Makes sense. The question is can we make it so it doesn't do this for SLAM :D
Strictly speaking unless there is a laser charge level trigger inside the hook I believe it is not possible. One trick would be enable a count down to give a minimum lapse from deactivation to activation of the slam. Another would be change the curve of acceleration making slam work as a turbo punching at high rates of engines rpms minimizing his effects in the first few tenths of second (giving a hiccup jump to high speed)

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

Post by keiranhalcyon7 » Fri Feb 11, 2022 10:47 pm

AngeI, question - does the SLAM system exhibit this behavior even when the cannon capacitors are completely drained, e.g. when you've been redirecting the power to engines, and the capacitors have been sitting at 0 for a few seconds already?

User avatar
AngeI
Lieutenant JG
Posts: 522
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Sat Feb 12, 2022 11:35 am

keiranhalcyon7 wrote:
Fri Feb 11, 2022 10:47 pm
AngeI, question - does the SLAM system exhibit this behavior even when the cannon capacitors are completely drained, e.g. when you've been redirecting the power to engines, and the capacitors have been sitting at 0 for a few seconds already?
Yes, so I'm not sure how it can be that this energy reserve is still present with all power redirected to engines and nothing left in the reserves. Adding a cooldown timer between activations seems the best way to handle this imo, even if its just a second or two. You have to spam the button rapidly to keep maintaining the high speed.

User avatar
JaggedFel
Galactic Empire
Posts: 432
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Sat Feb 12, 2022 3:15 pm

If the value of the capacitors can be read directly, can a threshold be set instead, so you can't activate SLAM before a certain charge builds up?
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

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

Post by JeremyaFr » Sat Feb 26, 2022 9:55 am

UPDATE

Hello,
I've updated the slam hook.

There was a bug where the SLAM system could be activated by repeatly pressing the K key, even if there is no energy.
Now, when there is no energy, the SLAM system will not be activated and the MSG_OVERDRIVE_UNABLE message (Engine overdrive boosters cannot be engaged) will be displayed.

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

Post by JeremyaFr » Mon Apr 04, 2022 8:34 pm

UPDATE

Hello,
I've updated the slam hook.

I've added a "SlamEnablePenalty" setting.
To define the SLAM enable penalty, set the "SlamEnablePenalty" setting in "hook_slam.cfg". It is an integer value. The default value is 4.

Post Reply