Sign in to follow this  
joedobo

[ABANDONED] Rock Surface Terraforming Mod

Recommended Posts

This mod provides options to change how a player can terraform rock. You can change max slopes for mining and raising with concrete. You can change max depths for mining and raising with concrete. It is set up so that you should always be able to reverse things. In other words; you can't mine deep then you can raise or raise higher then you can mine it back down.

 

Configure options:

Spoiler

# true: Change max water depth which can be mined or raised. Mine depth is slightly less then raise depth to assure reversibility.
# false: WO default, which is 25 units below water.
# The multiplier is used with mining skills and it only applies if useCustomDepth is true.
useCustomDepth=true
pveDepthMultiplier=5
pvpDepthMultiplier=1

# true: Change max slope which can be mined or raised. There are no restriction on raising at the bottom of a slope.
#       Raising at the top of a slope is slightly less the max mine slope. These are to assure reversibility.
# false: WU default, which is 25 and 40 slope for pve and pvp, when doing raise. For mining slope it is 1 and 3,
#       for pvp and pve.
# The multiplier is used with mining skills and it only applies if useCustomMaxSlope is true.
useCustomMaxSlope=true
pveSlopeMultiplier=10
pvpSlopeMultiplier=1

# true: clay elevation won't go down from digging
# false: WU default, every 50 to 100 digs clay will go down.
useFixedClayElevation=true

 

:Required:

For WU 1.3.1.3  Note, I only update every other WU official release. This may mean you need to use the previous version, I do :).
Ago's WurmServerModLauncher. https://github.com/ago1024/WurmServerModLauncher/releases. I tested with v0.24

:Install:
*Get one of the archive releases and unpack it into the mods folder. The folder path should look something like this: ~Steam\SteamApps\common\Wurm Unlimited Dedicated Server\mods
* Releases are at github: https://github.com/Joedobo27/RockSurfaceTerraformingMod/releases

* Open the properties file and choose what options you want.

 

Make concrete from clay + rockshards. Here is script-runner code to do this, and it goes in this folder: ~\mods\scriptrunner\scripts\onServerStarted

https://gist.github.com/Joedobo27/08fcfccbebf612e560bbecb9ffa30f1f

 

 

This mod use to be about concrete creation and use. I decided to make it into a rock terraforming general purpose mod.

I may add a new actions to level and flatten surface rock to this mod.

 

Edited by joedobo
  • Like 1

Share this post


Link to post
Share on other sites

Thank you for this!  I hate uneven mine floors, but I hated making concrete more.  This will also take a lot of the pain out of slab creation.

 

- Artheos

Share this post


Link to post
Share on other sites

I"ll fix it before my other mods, probably tomorrow. I feel bad I didn't fix this while 1.0.0.5 was in beta. I've been distracted, sorry. 

 

I also need to find a way lessen the negative impact of turning this mod off. As I pointed out in the OP this mod makes concrete be the same size as a rock shard. In plain Wurm a concrete is much smaller. When a server disables or enables this mod the changes to a concrete's default size can mess with things. 

 

Making something bigger causes existent items to lessen in count inside bsb. Once upon a time Wurm increase the size a onion and players all across the lands suddenly lost thousands of onions in FSB. The opposite is true with making it smaller.

 

I guess the simplest solution is to just make concrete be the same size as basic Wurm. I originally made concrete equal to one shard because one shard takes rock down one unit so a concrete should be the same size as a shard if its going to take a rock up that same one unit.

Share this post


Link to post
Share on other sites

Sorry, I missed my estimated fix date. I'm having troubles with the logging utilities and I need them to debug code. No ETA on when I can make this work again at this moment.

Share this post


Link to post
Share on other sites

updated for WU 1.0.0.5

 

Going forward this mod (along with my other mods) will require using my common mod.

Share this post


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

updated for WU 1.0.0.5

 

Going forward this mod (along with my other mods) will require using my common mod.

 

 

common mod?

 

Share this post


Link to post
Share on other sites

a common mod because:

1. multiple mods changing the same methods. It;s difficult to coordinate what has or hasn't been changed. checkSaneAmounts in CreationEntry is one example. I only have one mod at the moment that changes forage and herb classes (forage and botanize). I'll have others in the future and when that happens i'll again need a tool to coordinate common alteration.

2. I use a bytecode altering class. It's a tool I use in all my mods and it's a hassle to make sure I'm using the same class in every mod. It's much easier to have all my mods fetch the tool from a single common mod.

 

The common mod doesn't do anything on its own. My other mods use methods in it.

Share this post


Link to post
Share on other sites

was thinking of adding this today but theres an update tmrw. think it will be ok? :P

Share this post


Link to post
Share on other sites

I don't know if it will break, it might. But, I plan on updating this first amongst my mods after patches.

 

Also, if it doesn't work for you for some reason you can just disable it. If you leave the details for Concrete as default there won't be any lingering negative effects after disabling it.

Share this post


Link to post
Share on other sites

Got an error since the update for this mod

 

[02:57:22 AM] INFO com.wurmonline.server.Server: Shutting down the server - cause:
org.gotti.wurmunlimited.modloader.classhooks.HookException: java.lang.NoSuchMethodError: com.wurmonline.server.items.ItemTemplateFactory.createItemTemplate(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[SSSIJIIII[BLjava/lang/String;FIBIZI)Lcom/wurmonline/server/items/ItemTemplate;
    at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:312)
    at com.wurmonline.server.items.ItemTemplateCreator.initialiseItemTemplates(ItemTemplateCreator.java)
    at com.wurmonline.server.Server.startRunning(Server.java:775)
    at com.wurmonline.server.ServerLauncher.runServer$1(ServerLauncher.java:119)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gotti.wurmunlimited.modloader.server.ProxyServerHook$1$1.invoke(ProxyServerHook.java:55)
    at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:302)
    at com.wurmonline.server.ServerLauncher.runServer(ServerLauncher.java)
    at com.wurmonline.server.gui.WurmServerGuiController.startDB(WurmServerGuiController.java:1319)
    at com.wurmonline.server.gui.WurmServerGuiMain.main(WurmServerGuiMain.java:101)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javassist.Loader.run(Loader.java:288)
    at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javassist.Loader.run(Loader.java:288)
    at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at PatchedLauncher.main(PatchedLauncher.java:20)
Caused by: java.lang.NoSuchMethodError: com.wurmonline.server.items.ItemTemplateFactory.createItemTemplate(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[SSSIJIIII[BLjava/lang/String;FIBIZI)Lcom/wurmonline/server/items/ItemTemplate;
    at com.Joedobo27.clayshards4concrete.ClayNShards4ConcreteMod.shardNClayToConcreteTemplate(ClayNShards4ConcreteMod.java:363)
    at com.Joedobo27.clayshards4concrete.ClayNShards4ConcreteMod.onItemTemplatesCreated(ClayNShards4ConcreteMod.java:68)
    at org.gotti.wurmunlimited.modloader.server.ServerHook.lambda$fireOnItemTemplatesCreated$3(ServerHook.java:49)
    at org.gotti.wurmunlimited.modloader.server.Listeners.lambda$fire$0(Listeners.java:35)
    at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:890)
    at org.gotti.wurmunlimited.modloader.server.Listeners.fire(Listeners.java:33)
    at org.gotti.wurmunlimited.modloader.server.ServerHook.fireOnItemTemplatesCreated(ServerHook.java:49)
    at org.gotti.wurmunlimited.modloader.server.ProxyServerHook$2$1.invoke(ProxyServerHook.java:78)
    at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:302)
    ... 29 more

[02:57:22 AM] INFO com.wurmonline.server.Server: Shutting down at:
java.lang.Exception
    at com.wurmonline.server.Server.shutDown(Server.java:3548)
    at com.wurmonline.server.Server.shutDown(Server.java:3540)
    at com.wurmonline.server.ServerLauncher.runServer$1(ServerLauncher.java:126)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gotti.wurmunlimited.modloader.server.ProxyServerHook$1$1.invoke(ProxyServerHook.java:55)
    at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:302)
    at com.wurmonline.server.ServerLauncher.runServer(ServerLauncher.java)
    at com.wurmonline.server.gui.WurmServerGuiController.startDB(WurmServerGuiController.java:1319)
    at com.wurmonline.server.gui.WurmServerGuiMain.main(WurmServerGuiMain.java:101)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javassist.Loader.run(Loader.java:288)
    at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javassist.Loader.run(Loader.java:288)
    at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at PatchedLauncher.main(PatchedLauncher.java:20)

Share this post


Link to post
Share on other sites

that error is because the new WU added an additional argument to the ItemTemplateFactory.createItemTemplate(). I think bdew and maybe ago by now, updated mod launcher so it can find the create method.

 

I'm not sure what to do with this mod anymore. It is much better to just add a concrete = rockshards + clay creation option using the script runner. The other two option still need a mod as they are bytecode changes. I'm not sure it's all that useful to be able to apply concrete deeper then the 24 dirts depth, I've actually never done this. For the other option I have applied concrete on slopes in excess of the 40 slope or whatever the max is. It may be worth while to clean this up just for that. Although, it would be an update for 1.3.1.3 and not 1.3.4.4.

Share this post


Link to post
Share on other sites

I used the concrete at depth part, But its kind of rare case. Still makes for a good option to have though for those times

Share this post


Link to post
Share on other sites

seems claynshards for concrete mod has been broken by update. you still workin on this?

Share this post


Link to post
Share on other sites
On 5/10/2017 at 10:26 PM, Aum said:

seems claynshards for concrete mod has been broken by update. you still workin on this?

It works for 1.3.1.3. and that is on the WU previous version brach right now. I'm only doing updates every other WU version so I can reduce the effort needed to keep things updated. I did put the concrete making part in a script runner. I'd guess that should work with the new version. The instruction are in the OP. 

 

Sorry for the delayed response. I'm not sure how I missed your message.

Share this post


Link to post
Share on other sites

I'm making good progress on a leveling action for surface rock. It's like leveling dirt but you can do it to rock tiles. I updated the github with code progress and I don't have a release yet but it's not terribly hard to compile it to a jar.

 

Two parts of this that I'm kinda stuck on are

1) Concerning skill gain and surface mining, it looks like there is a skill check for every action but the rock only goes down every so often (I'll just use the 1/5 example). Is there a difference in just extending the action timer by *5, increasing the counter arg appropriately for skillcheck() and reducing the rock elevation every action? I'd simulation this but I haven't had luck running simulations through WU's skill gain system.

Currently I have a trigger system that does skill checks on par with what it would be for normal surface mining and another trigger to lower/raise rock elevation. For changing the rock I just used averages. So if you have a 1/5 chance to mine down rock I just extended the timer by * 5 because that is what it should be on average overall.

 

2) I'd like to have available stamina act as a cap for the level time. Currently this uses an action time needed to completely level the tile (which is also how defualt WU does it). The stamina code is confusing. I guess it isn't absolutely needed.

 

 

Now that I've done some work with leveling the whole tile I can see some other related actions that would benefit from the same code and those are

1. leveling tile borders.

2. maybe targeting tile corners for mining. Here you could target corners at the top of a slope while standing at the bottom instead of having to climb up to the top.

 

Finally, the orginal part of this mod was to change concrete use and I recently extended that to mining both slopes and water depth. The code I did with level showed me how much better working with the action performers is compared to bytecode. I kinda want to overwrite WU default action performers for surface mining and concrete use. I'm not sure what to do with this final point as it would completely overwrite WU default code and likely any alteration other mods might be making of the replaced code.

 

 

Here is a screen cast of leveling up some rock tiles below water. It basically work the same for mining down. For a non-gm too stamina goes down considerably more and actions are considerably longer.

http://screencast-o-matic.com/watch/cbh2oeXwDI

 

Edited by joedobo
added screencast

Share this post


Link to post
Share on other sites

im using the concrete recipe in morecraftables for the moment but i think what i liked on this was the added ability to change max sloped for using concrete in caves and underwater depth, as well i hope you get the flattening and leveling of stone and borders working.

please keep in mine surfaceminingfix mod which i use on my server it changes the chance so rock always lowers on hit. will there be any conflicts?

 

if you wanna learn good code study walkerinthevoids mods, his mods have never needed updating since released and they dont get broken by updates

Share this post


Link to post
Share on other sites

@Aum Thanks    A complete overwrite of surface-mining/raise-rock actions would likely disable what surfaceminingfix does. I can get rid of the bytecode code and make this mod more stable but the cost is breaking other mods.   Maybe I can make new supplementary surface-mining and rock-raising actions. They would exist in addition to WU default ones.

 

It appears walkerinthevoids is just avoiding coding practices that are fragile (low level bytecode find-replace, inserting using line numbers, when using expression editor using line numbers to isolate multiple method occurrences). Bdew does the same thing. But I have run into a situation where these methods seems to be the only solution second only to a complete WU method/class replacement which tends to break other mods.

Edited by joedobo

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