Phenex

Place custom pillar of light

Recommended Posts

Hello everyone,

 

I wrote a mod which places an item in the world at random coordinates. My players would need to find it, so I thought about placing a pillar of light (like the ones the two huge altars use).

I have looked through the server code, but I cannot find the place where the server places these "pillars of light" for the huge altars to see how it must be implemented.

At first I though they are simple objects (items) with a graphical effect, but that doesn't seems to be the case.

 

I hope somebody can give me a hint, how they are implemented.

 

Best regards,

Phenex

Share this post


Link to post
Share on other sites

There is probably also code for placing rift red beam pillars plus the rainbow sparkles beam at Christmas (pointing to santa) so you could also maybe check for those. Rift code might not be in the WU code though, but one of the server admins that run rifts will probably know (Hint, try PMing Henry of the Riviera server).

 

Also, see if this post has some clues (darklord's code):

 

 

I don't know coding so maybe that won't work at all. I was assuming "ItemIDList" tells the server what objects to bind a lightbeam to

ShowLight = true

.

 

Bdew also has a mod for non-combat pets which spawns easter egs, those eggs (and some treasure chests) will sometimes have a golden glow plus sparkies that make them much easier to see when you get within a certain distance, but not visible from across the server as you are attempting. Still, makes it so if anyone passes wthin a certain distance, the sparkles and glow  do catch one's attention. If it is a big server though it could still take many weeks for someone to pass by that spot and noti ce them.

 

 

 

Edited by Brash_Endeavors

Share this post


Link to post
Share on other sites

Thanks, this post helps alot. Found the right implementation.

Still tinkering with the javassist API... inserts are a pain.

Share this post


Link to post
Share on other sites

Thanks, got it. Took me hours to find the my error. Never forget

sharedClassLoader=true

in your properties file if you need to insert code into the server.

 

Share this post


Link to post
Share on other sites

It's in the class com.wurmonline.server.players.Players and the method sendAltarsToPlayer, called by com.wurmonline.server.LoginHandler when a client is logging in. All effects such as the beams are sent to clients then. Just insert some code at the start of sendAltarsToPlayer sending added beam effects., and check named method for how to send the effects. The white beam uses the type 2, the black beam is type 3, and the santa beam is 4.

Share this post


Link to post
Share on other sites
On 12/3/2019 at 8:56 PM, Governor said:

Try looking at the red beam mod to see how it is done. https://github.com/mpsmonk/wurm-mods

Do you know how to be able to have more than one cordinate active? 

I can only have one red beam at once. I'ld like to have two.. but I cant for my life get it to work with two cordinates in the RedBeam.properties.

This is how it looks now, but it only wants to spawn one red light at a time.
 

classname=mpsmonk.wurmunlimited.mods.redbeam.RedBeam
classpath=RedBeam.jar
sharedClassLoader=true

tilex = 970
tiley = 679
tilex = 3538
tiley = 3442

Share this post


Link to post
Share on other sites
15 minutes ago, PleagueX said:

Do you know how to be able to have more than one cordinate active? 

I can only have one red beam at once. I'ld like to have two.. but I cant for my life get it to work with two cordinates in the RedBeam.properties.

This is how it looks now, but it only wants to spawn one red light at a time.
 

classname=mpsmonk.wurmunlimited.mods.redbeam.RedBeam
classpath=RedBeam.jar
sharedClassLoader=true

tilex = 970
tiley = 679
tilex = 3538
tiley = 3442

 

The way the mod is written, it will only pass through one set of tilex and tiley, setting multiple in the .properties file will not create additional points of redbeam. You would need to re-write the mod. 

Share this post


Link to post
Share on other sites

You could maybe duplicate and rename it so "RedBeamTwo.properties" and "RedBeamTwo/RedBeamTwo.jar", and it might work if you set "classpath=RedBeamTwo.jar" and "sharedClassLoader=false". No promises, though @PleagueX.

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