|
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
Solace
Joined: Sun Jun 10, 2007 2:05 am Posts: 426
|
Code pruning
To cut way down on clutter, can you define a variable your Lua script uses but can be set in an ini? For example, if I want a Lua function on three different guns to have three ranges without having to triplicate the code just to change the ranges.
|
Tue Aug 10, 2010 7:59 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Code pruning
No, but you could have the same script run by all three guns and have the script check the presetname of the gun.
|
Tue Aug 10, 2010 8:09 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Code pruning
Or better, have it defined as a multiple of SharpRange or something so you don't have to do a pile of ifs in an attempt to cut down on clutter.
|
Tue Aug 10, 2010 8:34 am |
|
|
Solace
Joined: Sun Jun 10, 2007 2:05 am Posts: 426
|
Re: Code pruning
Ah, so if presetname = X, then variable = y? That's only an extra line of code, cool.
|
Tue Aug 10, 2010 7:54 pm |
|
|
|
|
Page 1 of 1
|
[ 4 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
|
|