Jump to content

Leaving the weapon empty


Duion

Recommended Posts

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/blob/development/Templates/Full/game/art/datablocks/weapons/Lurker.cs#L477

to

https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/scripts/server/weapon.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.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...