ago

[RELEASED] Server mod loader + priest + crops + seasons + server packs + bag of holding

Recommended Posts

Buried because it's sloppy. I did that on purpose. There is a better way to do it but It takes time. It does work in the meantime I guess.


 




In what way does bag of holding spell expand a container? does it change x y z size? I have cast an 81 on a backpack but a shovel still wont fit. To be honest I don't know what volume the shovel would take up anyways but I was expecting the backpack to start accepting some of the larger tools. I will try some other stuff like a pelt. maybe a saw.




 


what fits where mechanics:


1. compare x to x and the same for y and z. Do any of the measurements for the object to be placed in container exceed the container's measurements, if so fail. Contrary to what you might think you can't rotate the part and the dimensions are strictly x to x, etc....


2. calculate volume by x * y * z and then see if there is enough free volume for the item to be placed in the container, if not enough fail.


3. if the container has more then 100 items fail.


 


backpack outside measurments: 30, 50, 50.


shovel outside measurments:2, 20, 100


Even if the volume was increase (what bag-of-holding appreanly does) the Z dimension of the shovel is too large.

Share this post


Link to post
Share on other sites

Ago,  


 


Is there anyway to make this work for SML (server Mod loader)? I downloaded the source, made a jar, and tried to use it with no success.


http://www.fuin.org/srcgen4javassist/examples.html


 


error





java.lang.NoClassDefFoundError: org/fuin/srcgen4javassist/SgClassPool
at com.jase2z.WUmod.LoadingUnchainedMod.init(LoadingUnchainedMod.java:22
)
at org.gotti.wurmunlimited.modloader.ModLoader.lambda$loadModsFromModDir
$5(ModLoader.java:61)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Sou
rce)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Sour
ce)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknow
n Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at org.gotti.wurmunlimited.modloader.ModLoader.loadModsFromModDir(ModLoa
der.java:61)
at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(Delegat
edLauncher.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javassist.Loader.run(Loader.java:288)
at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLaun
cher.java:24)
Caused by: java.lang.ClassNotFoundException: org.fuin.srcgen4javassist.SgClassPo
ol
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at javassist.Loader.delegateToParent(Loader.java:426)
at javassist.Loader.loadClass(Loader.java:312)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 19 more

C:\Program Files (x86)\Steam\SteamApps\common\Wurm Unlimited Dedicated Server> 


 


code





package com.jase2z.WUmod;

import javassist.*;
import org.fuin.srcgen4javassist.SgClass;
import org.fuin.srcgen4javassist.SgClassPool;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
import org.gotti.wurmunlimited.modloader.interfaces.Configurable;
import org.gotti.wurmunlimited.modloader.interfaces.Initable;
import org.gotti.wurmunlimited.modloader.interfaces.WurmMod;

import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Properties;

public class LoadingUnchainedMod implements WurmMod, Initable, Configurable {
public void configure(Properties properties) {}
public void init() {
try {
CtClass ctcCargoTransportationMethods = HookManager.getInstance().getClassPool().get("com.wurmonline.server.behaviours.CargoTransportationMethods");
CtClass ctcLoadingUnchainedCopy = HookManager.getInstance().getClassPool().get("com.jase2z.WUmod.LoadingUnchainedCopy");

SgClassPool pool = new SgClassPool();
SgClass SgcCargoTransportationMethods = pool.get("com.wurmonline.server.behaviours.CargoTransportationMethods");

PrintWriter out = new PrintWriter("mod string.txt");
out.println(SgcCargoTransportationMethods);
out.close();

//Removed some code that's not relevant.

} catch (NotFoundException | CannotCompileException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
 


 


 


I want to convert classes (well methods actualy) to source code as a string and then use string find-n-replace methods to make selective pinpoint changes. Then, after the changes are made, use method.setbody(" source string") to set the methods with the new code.


Share this post


Link to post
Share on other sites

The seasons command is brilliant ago. Would you be able to have the times sort in descending order so that at the bottom of the output you can see what is next? Not really a big deal if it is a problem. We can just scroll the event tab to hunt it down if need be as you have it now.


Share this post


Link to post
Share on other sites

The seasons command is brilliant ago. Would you be able to have the times sort in descending order so that at the bottom of the output you can see what is next? Not really a big deal if it is a problem. We can just scroll the event tab to hunt it down if need be as you have it now.

hm, k. I'll take a look

Share this post


Link to post
Share on other sites

No. Not directly. The class file editing does not know anything about object instances. It's pure code without any data. Object instances are data.

The invocation handler has a similar problem. The correct invocation handler for a hooked method is resolved from a static map in the hook manager. This currently only works for hooks but I'll probably extend this interface so any mod can register an invocation handler in the hook manager and provide a way to call the handler without the need to put the mod in the main classloader.

You can make checkBlacklist(int) a static method and blacklist a static field and fill it in the configure phase.

The CreatureAgeMod had the same problem: https://github.com/ago1024/WurmServerModLauncher/blob/master/src/mods/creatureagemod/org/gotti/wurmunlimited/mods/creatureagemod/CreatureAgeMod.java

 

Okay, I made blacklist a static Hashset and filled it in configure.  Then I created getAdjustedDecayTime() as a static method that checks whether an itemTemplate's templateId is contained on the blacklist and returns an adjusted decay time.  I want to call this static method.

 

How?

 

I've tried adding it in as part of setBody() but says getAdjustedDecayTime not found com.wurmonline.server.items.ItemTemplate.  How do I get it to recognize the method?  Code on pastebin

Share this post


Link to post
Share on other sites

This should work

            method.setBody("{ return com.wurmonline.cantorsdust.mods.NoDecay.getAdjustedDecayTime(this); }");
The setBody(), insertBefore() and insertAfter() method change the code of a different class in a different scope. The other class can't see your methods unless you specifiy the full qualified name.

Also it's important to set "sharedClassLoader=true" in the properties file to make sure the mod resides in the same classloader as the changed class.

Share this post


Link to post
Share on other sites

Ago.   I wanted to see a practical example of using the client / server modloader before attempting to add my own graphic assets.   Is this something you can work on as an example of how this would work with the two systems?    I like the models in this pack and it would be a huge start for me if you could use this as an example for pushing content to our players using your mod.


 


http://forum.wurmonline.com/index.php?/topic/133254-released-creatures-mod/page-13


 


Above is the thread for the creatures Mod.   I'm not sure what it needs to retro fit into your loader.   I know you've been working with the hitching post and two issues have come up.     The logging.txt (i think) and the ID's 

Share this post


Link to post
Share on other sites

I'll see if I can get a working example tomorrow. I'll probably use pack up the client files for the creature mod as I don't have any cusotm objects to test that with.

  • Like 1

Share this post


Link to post
Share on other sites

I'll see if I can get a working example tomorrow. I'll probably use pack up the client files for the creature mod as I don't have any cusotm objects to test that with.

 

 

You rock!!    Thanks ago!!  

Share this post


Link to post
Share on other sites

Spellmod - Would it be possible to add the ability to make veggies a sacable item (similar to Lib and Nahjo priests on Freedom)?


 


~Nappy


Share this post


Link to post
Share on other sites

I could give all deities the same affinities. Currently it's

* Fo: clay and pottery items, cloth items, food items (Yeah it's actually fo that gets the sac bonus from food)

* Mag: metal items (any metal items, not just the one lock)

* Vyn: wood items

* Lib: meat and various alchemy items

Share this post


Link to post
Share on other sites

I could give all deities the same affinities. Currently it's

* Fo: clay and pottery items, cloth items, food items (Yeah it's actually fo that gets the sac bonus from food)

* Mag: metal items (any metal items, not just the one lock)

* Vyn: wood items

* Lib: meat and various alchemy items

Fo has the affinity for food but this is just a 2x multiplier on the getprice, lib can sac alchemy ingredients for (10000 * itemql() / 100) * 2 and meat for half this, Getprice values for food is rather low so it doesn't help fo much

Share this post


Link to post
Share on other sites

Fo is the farmer's god so makes sense he of all the gods would appreciate produce of nature and the fields, farming+foraging,  as opposed to crafted items (Vynora), inorganic (Mag), or created by killing trees.  Or at least add pumpkins to Fo since those are so gawdawful bulky they are more likely to be used at a simple homespun humble field altar, and not purchased in mass bulk through commerce for silver.  Pottery should be Vyn and clay+tar for Mag. The fact that Fo likes shovels means they like fruits of the earth but the connection from there to pottery crafted items is not very strong. . Meat, Mushrooms, all butchering byproducts, crafted Weapons (inc arrows), tar, and lockpicks all make sense for Libila, but not mainstream farm products. Lib would I think detest "farmers" as weak pacifist carebears. Or let Lib keep garlic+onions but Fo gets grains (barley etc) and bread. 


 


Maybe there is a file we can tweak on our own end?


 


 


 


Love the new update, thank you again for this!


Edited by Brash_Endeavors

Share this post


Link to post
Share on other sites

The affinities match the priest abilities: Fo can dig -> clay, Vyn can cut trees -> wood affinity, Mag can mine -> metal affinity.

I'll add an option to give every affinity to each god.

Share this post


Link to post
Share on other sites

Hey ago,

 

I'm not certain if someone suggested it already, but linking is currently an issue.

 

It would be nice to link between all white light gods and all black light gods, based on the config

 

CreatureBehavior: 

Quote

 


boolean action(Action act, Creature performer, Item source, Creature target, short action, float counter) {

} else if(action == 399) {

    if(target.getDeity() == performer.getDeity()) {

 

 

Share this post


Link to post
Share on other sites

https://github.com/ago1024/WurmServerModLauncher/releases/tag/v0.10

 

Version 0.10

ModLoader

  • Added factory to request the next free id (tested for item templates only)
  • Added ItemTemplateCreatedListener interface
  • Added ItemTemplateBuilder
  • Added ModVehicleBehaviour
  • Added HitchingPost example for item creation and server packs

BagOfHolding

  • The spell effects the container dimensions too

HarvestHelper

  • Output seasons in starting order

 

I've converted most of Arkoinks hitching post mod into an example that loads via the mod loader. It's basicly a demo for

  • publishing graphics packs to the clients
  • creating new item templates
  • Adding new behavioural classes

I don't plan to maintain it actively.

  • Like 3

Share this post


Link to post
Share on other sites
On 18.11.2015 22:25:07, joedobo said:

 

Ok. This new forum editor sucks. I'll just keep the quote as is  and drop my comments here.

 

Adding the srcgen4javassist jar to the mods/modname directory and to the classpath entry in the properties file should probably be enough to get this going.

eg. classpath=modname.jar,srcgen4javassist.jar

 

 

 

On 18.11.2015 22:25:07, joedobo said:

Ago,  

 

 

 

 

Is there anyway to make this work for SML (server Mod loader)? I downloaded the source, made a jar, and tried to use it with no success.

 

 

http://www.fuin.org/srcgen4javassist/examples.html

 

 

 

 

 

error

 

 

 

 

 


 

 

 


java.lang.NoClassDefFoundError: org/fuin/srcgen4javassist/SgClassPool
        at com.jase2z.WUmod.LoadingUnchainedMod.init(LoadingUnchainedMod.java:22
)
        at org.gotti.wurmunlimited.modloader.ModLoader.lambda$loadModsFromModDir
$5(ModLoader.java:61)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Sou
rce)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Sour
ce)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknow
n Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.forEach(Unknown Source)
        at org.gotti.wurmunlimited.modloader.ModLoader.loadModsFromModDir(ModLoa
der.java:61)
        at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(Delegat
edLauncher.java:18)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javassist.Loader.run(Loader.java:288)
        at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLaun
cher.java:24)
Caused by: java.lang.ClassNotFoundException: org.fuin.srcgen4javassist.SgClassPo
ol
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at javassist.Loader.delegateToParent(Loader.java:426)
        at javassist.Loader.loadClass(Loader.java:312)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 19 more

C:\Program Files (x86)\Steam\SteamApps\common\Wurm Unlimited Dedicated Server> 

 

 

 

 

 

code

 

 

 

 

 


 

 

 



 

 

 

 

 

 

 

 

 

I want to convert classes (well methods actualy) to source code as a string and then use string find-n-replace methods to make selective pinpoint changes. Then, after the changes are made, use method.setbody(" source string") to set the methods with the new code.

 

 

Share this post


Link to post
Share on other sites

Fantastic update ago. Love it Love it Love it.

At the time being does the client download the packs every time it connects? Not a problem at the moment. Just wondering.

Share this post


Link to post
Share on other sites
42 minutes ago, Crustyfoot said:

Fantastic update ago. Love it Love it Love it.

At the time being does the client download the packs every time it connects? Not a problem at the moment. Just wondering.

 

No they only download once. 

Share this post


Link to post
Share on other sites
On 10/25/2015, 9:22:40, ago said:

There's the actual mod and a launcher that loads the mod and starts the server. The launcher is designed to load multiple mods without the need to recompile and replace server files. so this can either become a standard launcher for mods or the religion mod can be adapted should there ever be some mod support in the server.

 

In the end you can even take the source code and incorporate the mod into whatever mod system you like to use. Or you don't use it at all. Your choice

 

Long time Wurm player returning for WU. I want to thank you very much for this as the method of jamming things into the jars and hoping for the best is dirty at best, this simplifies things and makes borking the whole thing up that much less likely.

 

That said. I want to caution you and the community as a whole, I don't know if you've played Minecraft but this is basically the same system used there and it has become a gigantic cluster of three or four huge loaders each with mods that only work for those loaders and the loaders themselves are either straight up impossible to run together or darn near and they certainly are not for the less tech savy (minecraft modders say the same as you here, just take the source and jam the mod you want into it. It's not always that easy and it's not for the basic user). This all creates huge issues, forums flooded with "How to get this to work" "Can I run all these together somehow" people being forced to pick and choose between the biggest and honestly nearly required mods for the game and leads to a lessened experience for everyone, you don't get to play how you'd like to, you don't get to support the modders you'd like to and fosters really nasty attitudes among the modders.

 

I would like to see your loader become the default or have in game modding support, everything so new of course. I just hope that getting at least most mods to work with your loader stays feasible here.

Share this post


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

https://github.com/ago1024/WurmServerModLauncher/releases/tag/v0.10

 

Version 0.10

I've converted most of Arkoinks hitching post mod into an example that loads via the mod loader. It's basicly a demo for

  • publishing graphics packs to the clients
  • creating new item templates
  • Adding new behavioural classes

 

Gave this a try tonight and I suspect I am doing something wrong because I can't seem to get the Hitching post to create in the Crafting window.

 

1) Downloaded latest Alpha client build and ran the patcher.bat file (btw - is this something that is only needed once or do we need to redo this everytime the client is updated by CodeClub?)

2) Downloaded latest server ModLauncher files and installed them on my linux server. I did not execute patcher.bat on the server side (not thinking I needed to)?

3) Enabled all required mods including hitchingpost by changing disabled to properties

4) Restarted server

5) Logged on with two clients - one GM, other normal char - neither one has a crafting recipe for hitching post nor does placing a log and plank in the window provide me with an option to create a hitching post

 

Not sure what I can check. Didn't find any logs, not sure if there should be files in a particular directory etc.

 

What do I need to do?

 

 

Share this post


Link to post
Share on other sites

issues for me too.  had to reinstall java's  and WU,  add both java paths to computer, cross fingers and toes,  then was able to patch,  then mod loader failed.  i thought i'd test each mod i had in, and only 2 caused failure,  the newest bag of holding. I put old one in and the loader loaded,  and the other one that old and newest won't work for me is hitching post. won't load up server at all.

 

it's important to me to fallow you only now, as it's such a pain to re-edit my server,jar every WU update.  mod loading so much better.

 

I hope someone makes a mod to edit vehicles.class, so we can easily increase speed of carts and boats,. 

other request is a  mod to edit storage,  ie, fish into fsb,  and slabs and beams into bsbs,  and 100 ore into forges,although moot i guess with new thingy,  but i'd like to edit rafts into allowing 100 ore and large carts /wagons to allowing 100 rafts or 100 large crates.  I know how to edit these in server,jar.  but to keep them and make them available for others after patches from steam....

 

love the work,  I hope to keep learning java, it's kinda fun.

Share this post


Link to post
Share on other sites

The patcher on the server side is not needed if you start the server via modlauncher.sh or modlauncher.bat

 

Saving this to logging.properties in the dedicated server directory and starting modlauncher.sh or modlauncher.bat will produce modlauncher.log

handlers=java.util.logging.FileHandler,java.util.logging.ConsoleHandler
.level=INFO

java.util.logging.FileHandler.pattern = modlauncher.log
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

java.util.logging.SimpleFormatter.format=[%1$tr] %4$s %3$s: %5$s%n

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now