[SSGM 4.0 Plugin] Refill Costs Money [message #471418] |
Thu, 12 July 2012 06:53 |
iRANian
Messages: 4308 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
This plugin will make purchasing a refill cost money. The cost is calculated based on the following formula:
((Max HP-Current HP) / Max HP) * Preset Cost * Fraction Of Total Cost * Base Power Multiplier
Preset Cost = the cost of the object, e.g. 1000 credits for a Havoc
Fraction Of Total Cost = a configurable multiplier you can set, e.g. if you want to have a refill cost 30% of the culculated cost set this to 0.3
Base Power Multiplier = if doubling cost when base power is down is configured this will be set to 2.0 when base power is down otherwise it's always 1.0
You can contact me on renegadeforums.com under the nick 'iRANian'.
To install place RefillCostsMoney.dll in the root fds folder and add an entry for it under [Plugins] in ssgm.ini, then add the following to ssgm.ini and configure it:
[RefillCostsMoney]
FractionOfTotalCost = 0.3 ; this number is multiplied with the calculated cost of a refill
NoBasePowerDoubleCost = true ; double the cost of a refill when base power is down
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
|
|
|
|
Re: [SSGM 4.0 Plugin] Refill Costs Money [message #471422 is a reply to message #471418] |
Thu, 12 July 2012 07:25 |
iRANian
Messages: 4308 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
It calculates the percentage of the HP you lost as fraction of your max HP, where HP is health + shield strength. Which is then multiplied with the preset cost and the base power multiplier. Then it's multiplied with the fraction of that cost you want to make the refill cost.
Your right, it would, but internally that part of the calculation gets converted to integer (so everything below 1 is rounded to 0) before I use it as floating point, so the issue doesn't occur (otherwise I can test for MaxHP == CurrentHP).
Your formula does the same thing as mine but accounts for that.
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
[Updated on: Thu, 12 July 2012 07:35] Report message to a moderator
|
|
|
|
|
|
|
Re: [SSGM 4.0 Plugin] Refill Costs Money [message #471636 is a reply to message #471418] |
Fri, 13 July 2012 16:08 |
Generalcamo
Messages: 522 Registered: October 2010
Karma: 0
|
Colonel |
|
|
I could see this being used. What if there was a time limit for refills, similar to what is seen in the standalone mods, and if you refill when the timer is not done, it costs some money? That would decrease the amount of combat refillers, and prevent aggravation.
|
|
|
|
|
|
Re: [SSGM 4.0 Plugin] Refill Costs Money [message #485929 is a reply to message #471418] |
Mon, 10 February 2014 10:33 |
|
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma: 0
|
General (5 Stars) |
|
|
Yeah, that unfortunately doesn't do anything prevent combat refilling for free classes, which are often the ones that are most problematic in my experience. Would be nice to add an artificial "nominal price" for the free infantry to be used in this plugins calculation of refill cost (and also apply the refill cost when buying free infantry during combat to prevent people using that as a way to avoid the price)
|
|
|