Leaving the weapon empty

Scripting questions, discussions, etc
2 posts Page 1 of 1
Duion
Posts: 833
Joined: Sun Feb 08, 2015 1:51 am
 
  by Duion » Sun Mar 13, 2016 3:38 am
When shooting a weapon until empty there is always automatically script called from the NoAmmo state to reload the weapon:
From here
https://github.com/GarageGames/Torque3D ... er.cs#L477
to
https://github.com/GarageGames/Torque3D ... on.cs#L381
And if this one does not execute the ammo display gets removed from the Gui.
I want to change the system that it only reloads when the reload button is pressed or maybe add a $pref variable that sets auto reload on or off and that the ammo counter stays displayed, even if it is 0 / 0.
Any ideas how that works?

This is question mainly because I use an iron sight script, that allows to aim down sights, this gets problematic in combination with the forced auto reload, since if you cancel the reload script and sequence through aiming or cancel to aim, then it leaves the weapon in limbo with an empty ammo display, but you can play the shoot animation, but without actually shooting.
So ideally I want to remove the forced reset of the ammo counter and display the ammo all the time, even if it is 0 and only to reload when reload is pressed, I hope someone understands what I want.

You can simulate the problem by commenting out "stateScript[7] = "onClipEmpty";" so it does not automatically reload on noAmmo.
Duion
Posts: 833
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Mon Mar 28, 2016 1:04 am
This issue is solved thanks to Tim-MGT and this resource http://www.garagegames.com/community/re ... /view/9141
2 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest