Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [SSGM 4.0 Plugin] Refill Costs Money
[SSGM 4.0 Plugin] Refill Costs Money [message #471418] Thu, 12 July 2012 06:53 Go to next message
iRANian is currently offline  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 #471421 is a reply to message #471418] Thu, 12 July 2012 07:11 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Excellent concept. Nice one! Thumbs Up


Especially as it seems to not be based on your ammo count, but rather your health, which makes sense to me.

The maths is making my head hurt a little though.

Quote:

((Max HP-Current HP) / Max HP)


First of all, I am going to assume Max HP and CurrentHP are calculated by including your shield, too?

Second, if I have full health, would the above not calculate as '1'? Meaning that the cost is highest for refilling when you're at full health, and lowest for refilling the close to death you are?

Shouldn't it be something like:

1.0f - ((100/MaxHealth) * CurrentHP)



Re: [SSGM 4.0 Plugin] Refill Costs Money [message #471422 is a reply to message #471418] Thu, 12 July 2012 07:25 Go to previous messageGo to next message
iRANian is currently offline  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 #471424 is a reply to message #471418] Thu, 12 July 2012 07:50 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Great Thumbs Up


Re: [SSGM 4.0 Plugin] Refill Costs Money [message #471560 is a reply to message #471418] Fri, 13 July 2012 02:22 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Is there any server running this, or planning to run it?


Re: [SSGM 4.0 Plugin] Refill Costs Money [message #471561 is a reply to message #471418] Fri, 13 July 2012 02:48 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
No idea, just made this as a joke.

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 #471563 is a reply to message #471418] Fri, 13 July 2012 04:02 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
I guess if they use it, the amount of combat refillers will drop.
Either because it now costs money, or because they run out of money Razz


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: [SSGM 4.0 Plugin] Refill Costs Money [message #471636 is a reply to message #471418] Fri, 13 July 2012 16:08 Go to previous messageGo to next message
Generalcamo is currently offline  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 #485842 is a reply to message #471418] Sat, 08 February 2014 23:43 Go to previous messageGo to next message
Stallion is currently offline  Stallion
Messages: 222
Registered: April 2006
Karma: 0
Recruit
Could you make an "instant building repair on cost per %health" plugin?

(sounds very similar in script)




I like the refill cost if under time limit one Razz


Level edit is my play ground

[Updated on: Sat, 08 February 2014 23:45]

Report message to a moderator

Re: [SSGM 4.0 Plugin] Refill Costs Money [message #485921 is a reply to message #471418] Mon, 10 February 2014 07:04 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
I might have a use for this... how does it deal with the free infantry? Since there is no cost, are refills always free?

http://steamsignature.com/card/1/76561197975867233.png
Re: [SSGM 4.0 Plugin] Refill Costs Money [message #485923 is a reply to message #471418] Mon, 10 February 2014 09:34 Go to previous messageGo to next message
BillieJoe67 is currently offline  BillieJoe67
Messages: 35
Registered: March 2012
Karma: 0
Recruit
Preset cost would be zero, so the refill cost would be zero (multiplying by zero in the formula)
Re: [SSGM 4.0 Plugin] Refill Costs Money [message #485929 is a reply to message #471418] Mon, 10 February 2014 10:33 Go to previous message
danpaul88 is currently offline  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)

http://steamsignature.com/card/1/76561197975867233.png
Previous Topic: [4.1 Sidebar] Mauler's Renegade Sidebar
Next Topic: [SSGM 4.0 Plugin] GameSpy Support
Goto Forum:
  


Current Time: Mon Dec 02 08:54:09 MST 2024

Total time taken to generate the page: 0.00829 seconds