Spidertron Weapon Switcher


Allows the Spidertron to fire any type of weapon by cycling through different loadouts with Control + Tab.

Content
1 year, 6 months ago
1.0 - 1.1
5.60K
Combat

g [Completed] 4 gun slots?

4 years ago

I've looked through the source code, wondering how you have 4 gun slots appearing in the bottom-right corner of the screen. Could you shed some light on how this is accomplished in the code?

4 years ago
(updated 4 years ago)

Sure, it is very simple: each of the weapon options is its own prototype, and any prototype can be given a list of guns. If you give the same gun more than once, then you get multiple of the same gun. I do this in prototypes/spidertron.lua: https://github.com/tburrows13/SpidertronWeaponSwitcher/blob/master/prototypes/spidertron.lua#L8. The guns have to be either part of the base game or created by you. I create 3 custom guns in prototypes/gun.lua.

Let me know if you have more questions :)

4 years ago

Thank you for the quick response!

New response