Data Realms Fan Forums
http://45.55.195.193/

Alternate Ammo Template
http://45.55.195.193/viewtopic.php?f=73&t=25248
Page 1 of 1

Author:  Mehman [ Sat Aug 20, 2011 2:52 pm ]
Post subject:  Alternate Ammo Template

Hi,

Now that we have lua on attachables multiple ammos for the same gun is quite easy to do, so I want to make that available to each and every one of you by sharing this:



Save this as a .lua file.

This script should be attached to the weapon (ScriptPath = NameOfTheRTE.rte/pathtothescript/script.lua). Define your ammo like you would normally do in the ini files, same thing for the different mags, then modify lines 3 to 5 of this script by replacing
nameofmag0 and nameofmag1 by the name of your mags.
If you want your gun to have more than two ammo you should add lines in the following way:
self.Mags[2] = "nameofmag2";
self.Mags[3] = "nameofmag3";
...etc and change the value of self.TotalMags to the total number of mags.

The player will then be able to change ammunition by pressing a key and reloading. The key is defined line 7 (self.AmmoKey). Key number 37 is num0, if you want another key then pick one in this list:



and change the value of self.AmmoKey accordingly.

Author:  Pantera1993 [ Tue Aug 23, 2011 5:24 am ]
Post subject:  Re: Alternate Ammo Template

This is great thanks! :D

Author:  Kigali [ Sat Nov 05, 2011 3:39 am ]
Post subject:  Re: Alternate Ammo Template

I tried your code, but it didn't seem to work with my weapon. No idea what I did wrong since I just copypasta'd it and followed your directions.

Author:  Mehman [ Sun Nov 06, 2011 4:09 pm ]
Post subject:  Re: Alternate Ammo Template

Send me your .rte and I'll debug it.

Author:  AndyChanglee [ Tue Aug 28, 2012 11:59 pm ]
Post subject:  Re: Alternate Ammo Template

Is this like how the Thumper changes bounce to impact?

Author:  Arcalane [ Wed Aug 29, 2012 1:47 am ]
Post subject:  Re: Alternate Ammo Template

This is keypress-based rather than pie-menu based, but it could be used to do the same thing if you wanted!

Author:  Roast Veg [ Wed Aug 29, 2012 1:48 am ]
Post subject:  Re: Alternate Ammo Template

It's probably more sensible to do it that way as well to accommodate all control mechanisms.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/