View unanswered posts | View active topics It is currently Wed Dec 11, 2024 8:32 am



Reply to topic  [ 7 posts ] 
 Alternate Ammo Template 
Author Message
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post 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.


Sat Aug 20, 2011 2:52 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Alternate Ammo Template
This is great thanks! :D


Tue Aug 23, 2011 5:24 am
Profile
User avatar

Joined: Mon Feb 18, 2008 12:51 am
Posts: 105
Location: A ninja never reveals their location...
Reply with quote
Post 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.


Sat Nov 05, 2011 3:39 am
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: Alternate Ammo Template
Send me your .rte and I'll debug it.


Sun Nov 06, 2011 4:09 pm
Profile
User avatar

Joined: Sat Jun 23, 2012 2:03 pm
Posts: 340
Location: At home, drinking some tears (probably mine)
Reply with quote
Post Re: Alternate Ammo Template
Is this like how the Thumper changes bounce to impact?


Tue Aug 28, 2012 11:59 pm
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post 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!


Wed Aug 29, 2012 1:47 am
Profile YIM
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Alternate Ammo Template
It's probably more sensible to do it that way as well to accommodate all control mechanisms.


Wed Aug 29, 2012 1:48 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.033s | 14 Queries | GZIP : Off ]