Sign in to follow this  
Mthec

[FINAL] Upkeep Costs

Recommended Posts

@MthecMod has been working great the exploit is fixed! I still have one small problem with the guards, I would like players making a new deed to get 2 free guards, but pay for more guards. Also they cant add guards using "manage guards" when making a deed with upkeep off because we get message "There was not enough upkeep to increase the number of guards. Please make sure that there is at least one month of upkeep left after you hire the guards." only way to buy new guards is to use resize deed because it takes the money from the bank instead of upkeep but with new players they can't buy any guards during the making of a new deed because they have no money in the bank..

 

basically: I just want players to get 2 free guards during creation of new deed and to "buy" new guards with managed guards while upkeep is turned off.

Edited by Darkness1990

Share this post


Link to post
Share on other sites

Update and fix

Download

 

Fix for "Manage guards" when not using upkeep.  Select the new checkbox at the bottom to take money from your bank instead (if there is enough money).
Added free_guards option (default 0), deeds will be able to hire the specified number of guards without initial cost or added upkeep. Any further guards will cost as normal.
Updated some mechanics I missed from the last WU update.
Added epic_upkeep_scaling option (default true), epic guards now hire on a scaling upkeep system (initial hiring costs are unaffected) which I missed before. Now you can choose between the scaling option or "standard" on epic servers.

 

Don't forget to check your settings on the per server .properties file.

On 6/25/2019 at 5:46 PM, Darkness1990 said:

@MthecMod has been working great the exploit is fixed! I still have one small problem with the guards, I would like players making a new deed to get 2 free guards, but pay for more guards. Also they cant add guards using "manage guards" when making a deed with upkeep off because we get message "There was not enough upkeep to increase the number of guards. Please make sure that there is at least one month of upkeep left after you hire the guards." only way to buy new guards is to use resize deed because it takes the money from the bank instead of upkeep but with new players they can't buy any guards during the making of a new deed because they have no money in the bank..

 

basically: I just want players to get 2 free guards during creation of new deed and to "buy" new guards with managed guards while upkeep is turned off.

Hopefully this will sort things out for you.

Share this post


Link to post
Share on other sites

@MthecI just noticed that since the new version, the irons per tile upkeep portion is not working. I have it set to 10 iron per tile, but we're still being charged 20 iron.  All the other settings we have seem to be working fine, so the mod is definitely active.  We also have deedmod (by@Keenan), which controls max deed size and number of deeds per Steam ID, as well as GM deedmaker (by@Cuddles) that allows GMs to create multiple deeds, but I'm not aware of any conflicts with either of these.

 

In the server log, it shows settings that look incorrect to me, and don't match what we configured in the properties file.  

Here are our configs:

Spoiler

classname=mod.wurmonline.mods.upkeepcosts.UpkeepCosts
classpath=upkeepcosts.jar

# Upkeep costs - in irons
# Costs per deeded tile
tile_cost=0
tile_upkeep=10
# Costs per perimeter tile
perimeter_cost=5000
perimeter_upkeep=5000
# Minimum value for upkeep
minimum_upkeep=1000
# Extra money added to the founding charge that goes into upkeep
into_upkeep=0
# Cost for changing deed name during Resize
name_change=50000

# Values vary depending on server type:
# Normal
# Epic/Challenge
normal_guard_cost=10000
normal_guard_upkeep=10000
epic_guard_cost=30000
epic_guard_upkeep=10000
epic_guard_upkeep_scaling=true

# Number of free tiles
free_tiles=0
# Number of free perimeter tiles
# The 5 minimum "layers" are always free
free_perimeter=0
# Number of free guards
free_guards=0

# Minimum amount drained
min_drain=7500
# When draining a deed the amount drained increases with every drain.  This sets the maximum this increase can reach. (decimal)
max_drain_modifier=5.0
#The amount the drain modifier increases with every successful drain. (decimal)
drain_modifier_increment=0.5

 

And here's what shows up in the server log:

Spoiler

[02:52:58 PM] INFO mod.wurmonline.mods.upkeepcosts.UpkeepCosts: Upkeep costs are as follows: Tile 10 iron, 20 iron, 0 free tiles - Perimeter 50 copper, 50 copper, 0 free tiles - Guards 0 irons, 1 silver, use Epic guard upkeep scaling false, 0 free guards - Minimum 1 silver - Into Upkeep 3 silver - Name change 5 silver

 

I should clarify that even though the serverlog seems to be saying it is charging 10 iron per tile to deed, we're actually not getting charged.  And I just noticed "Guards 0 irons, 1 silver" but it's costing us 1 silver to hire, 1 silver upkeep in reality, which is what we wanted.

 

Edited by Batta

Share this post


Link to post
Share on other sites

Hmm, that doesn't look right at all @Batta.  Some of the other values are off according to the message.  That looks like the main .properties, does the per server file have the same values (WurmServerLauncher/<server-name>/mods/upkeepcosts/upkeepcosts.properties)?

 

Also, to help narrow it down, at what stage does this happen, founding, resizing/expanding, just hiring extra guards or all of the above?

Share this post


Link to post
Share on other sites
On 9/13/2019 at 3:41 PM, Mthec said:

Hmm, that doesn't look right at all @Batta.  Some of the other values are off according to the message.  That looks like the main .properties, does the per server file have the same values (WurmServerLauncher/<server-name>/mods/upkeepcosts/upkeepcosts.properties)?

 

Also, to help narrow it down, at what stage does this happen, founding, resizing/expanding, just hiring extra guards or all of the above?

We're on a server host and have just one server.  The mod is in the mods folder in the root directory.

So it's <numerical name of root directory>/mods/upkeepcosts  with no mods folder within the server file.  Is it supposed to go in there?  I've never put any mods into the actual server folder.  Maybe that's the problem?

 

Nothing really is happening, exactly.  Just when players try to deed it's telling them the vanilla price and charging it.  But it is getting some of it right -- 1s to hire a templar, 1s per month.   50c per upkeep tile. 

 

EDIT:  OH.  I didn't realize there is an auto-generated folder inside the server mods folder!  And yes, the figures there were off in exactly the ways that were causing me problems.  Are they supposed to automatically follow what we put in the other properties file (in the main mods folder)?  Or are we meant to manually do it.  Anyway, this fixes the issue for me.  🙂

Edited by Batta
  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, Batta said:

*snip*

 

EDIT:  OH.  I didn't realize there is an auto-generated folder inside the server mods folder!  And yes, the figures there were off in exactly the ways that were causing me problems.  Are they supposed to automatically follow what we put in the other properties file (in the main mods folder)?  Or are we meant to manually do it.  Anyway, this fixes the issue for me.  🙂

Yeah, the original intention behind it was if people wanted different prices per server.  I also did it back when mods were still somewhat new and didn't know if server specific options would be a thing.  They do need copying manually, although I will probably add an option to the main .properties file that will allow automatic overriding for single server setups, as it's not typical behaviour and can be easily forgotten when changing values at a later date.

 

Anyway, glad it's resolved for you.

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, Mthec said:

Yeah, the original intention behind it was if people wanted different prices per server.  I also did it back when mods were still somewhat new and didn't know if server specific options would be a thing.  They do need copying manually, although I will probably add an option to the main .properties file that will allow automatic overriding for single server setups, as it's not typical behaviour and can be easily forgotten when changing values at a later date.

 

Anyway, glad it's resolved for you.

I notice that the format of the in-server version is quite different than the main version.  It might help with copying if they could be the same format, so we could just copy and paste.  Is that doable?

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, Batta said:

I notice that the format of the in-server version is quite different than the main version.  It might help with copying if they could be the same format, so we could just copy and paste.  Is that doable?

The reason the order is all jumbled is because the file was generated by the mod, and the only way I found to make it preserve order seemed a bit involved at the time.  But it doesn't actually matter which order the entries are in, so you can copy and paste as you like.

 

The only important bit is the "classname" and "classpath", they must be in the main .properties file for ago's modlauncher to find the mod.  It wouldn't matter if they were copied into the per server file though, they would be ignored.

  • Like 1

Share this post


Link to post
Share on other sites

Update

Download

 

Added use_per_server_settings to the .properties file.  If true it will use a .properties file in the individual server folders, if false it will only use the main mod file.  Default is true, to keep it in-line with previous behaviour.  Changing the value will not delete the old per server files, so you can switch back and forth at will.

 

Also took the time to refresh the mod a little.  It was one of my first and I've learnt a lot since then.  May have found (and fixed) a bug with disband warnings along the way.

Share this post


Link to post
Share on other sites
1 hour ago, Mthec said:

Added use_per_server_settings to the .properties file.  If true it will use a .properties file in the individual server folders, if false it will only use the main mod file.  Default is true, to keep it in-line with previous behaviour.  Changing the value will not delete the old per server files, so you can switch back and forth at will.

 

Also took the time to refresh the mod a little.  It was one of my first and I've learnt a lot since then.  May have found (and fixed) a bug with disband warnings along the way.

Great!  Thank you very much.  🙂

Share this post


Link to post
Share on other sites
4 hours ago, Mthec said:

Added use_per_server_settings to the .properties file.  If true it will use a .properties file in the individual server folders, if false it will only use the main mod file. 

@Mthec There appears to be a problem.  I had to delete the upkeepcosts folder from the server folder, or else setting "use_per_server_settings=false" didn't work, and it still used the settings from the server mods folder.  As soon as I started the server it created a new upkeepcosts folder in the server mods folder, with the same settings as I have in the main mods folder.

 

I then tested by changing the settings in the server mods folder only, still keeping "use_per_server_settings=false" in the main mods folder, but it used the server mod instead of the main mod.

Share this post


Link to post
Share on other sites

Fix

Download

 

Fixed use_per_server_settings option.

15 hours ago, Batta said:

@Mthec There appears to be a problem.  I had to delete the upkeepcosts folder from the server folder, or else setting "use_per_server_settings=false" didn't work, and it still used the settings from the server mods folder.  As soon as I started the server it created a new upkeepcosts folder in the server mods folder, with the same settings as I have in the main mods folder.

 

I then tested by changing the settings in the server mods folder only, still keeping "use_per_server_settings=false" in the main mods folder, but it used the server mod instead of the main mod.

So sorry@Batta, I must have broke it when I was cleaning things up.

 

Thank you for your continued feedback.

  • Like 1

Share this post


Link to post
Share on other sites
Quote

# Minimum value for upkeep
minimum_upkeep=10000

@Mthec I seem to have found another little glitch, with this setting.  Is it supposed to mean that if players found a tiny deed, they will still be charged at least 1 silver upkeep?  That was my intention, but we're getting players being charged just a few coppers per month.

Edited by Batta

Share this post


Link to post
Share on other sites
2 hours ago, Batta said:

@Mthec I seem to have found another little glitch, with this setting.  Is it supposed to mean that if players found a tiny deed, they will still be charged at least 1 silver upkeep?  That was my intention, but we're getting players being charged just a few coppers per month.

That's what it is supposed to do.  It seems to be working fine on my end so I am not sure what the problem is.

 

When the deed owners check their upkeep does it show the correct cost per month, or is that wrong too?

Share this post


Link to post
Share on other sites
7 hours ago, Mthec said:

When the deed owners check their upkeep does it show the correct cost per month, or is that wrong too?

Oh good, you are right.  Thanks again!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this