Sign in to follow this  
Pheonixluvsfire

Wagons\Large Carts are Boats?

Recommended Posts

On examine you get the following message on wagons and large carts:

 

[16:36:04] The "Mystery Machine" does not have a course plotted.

 

At first I thought maybe this was linked to finding a route, but I checked and it is not related nor does it update. Of course upon right click I find I can not plot a course to Cadence and sail away on my large cart as such a message would imply.

 

Certainly this doesn't seem to have any effect other than cosmetics, but such messages could be confusing to new players or those lacking experience with the game. I never noticed them before so maybe something was recently changed to cause this?

 

This message appears on all large carts and wagons and to everyone I asked to check.

Share this post


Link to post
Share on other sites

From examining my event log, this did not occur until 2023-01-06. So this may have happened during the patch on 2023-01-04 as I have another examine previous to that point which does not have this message.

Share this post


Link to post
Share on other sites

Both wagons and boats inherit functions etc. from the same parent class, which is a vehicle class. Boats were the first vehicle in Wurm, so a lot of the code was written with no regard for future vehicles.

Share this post


Link to post
Share on other sites
On 1/22/2023 at 8:22 PM, Aeris said:

Both wagons and boats inherit functions etc. from the same parent class, which is a vehicle class. Boats were the first vehicle in Wurm, so a lot of the code was written with no regard for future vehicles.

 

I don't believe this for a second, it implies that the developers are incompetent and I don't believe that at all. This is a pretty complex game, and besides that isn't how java inheritance works.

 

The base class is an Item class which all items inherit from, the Vehicle class inherits from Item class. They are constructed as you might imagine and contain information describing a java object. The behaviors are in separate classes, this one in particular is in ItemBehavior.

 

Edit: The vehicle class does not inherit from Item, it is a separate class that just holds data specific to vehicles but uses a corresponding Item object by WurmId.

 

Quote

 

assert vehic != null;

if (performer.getVehicle() == vehic.getWurmid()) {

    String whereTo = "The " + vehic.getName();

    boolean isPvP = false;

if (vehic.hasDestinationSet()) {

    whereTo = whereTo + " has a course plotted to " + vehic.getDestinationServer().getName();

if (vehic.getDestinationServer().PVPSERVER) {

    whereTo += ", which will take you in to hostile territory";

    isPvP = true;

}

}

else {

    whereTo += " does not have a course plotted";

}

 

 

This could be fixed by just adding an if statement that verifies the type of vehicle before deciding to print a statement about course plotting. Each of the vehicles have different identifiers (if they didn't, how would the game know which model to load?) so I don't see an issue with this. I understand if the development team is focused on other more important projects because sticking to development timelines is a pain in the butt.

 

I just resent the thought that this should be waved away by a general statement that somehow because of class inheritance this can't be corrected or that the developers didn't follow standard practices when writing java code.

Edited by Pheonixluvsfire
Fixed for accuracy

Share this post


Link to post
Share on other sites

I can tell you that when large carts was added which was not long after boats it was common knowledge they did use the same code as they said so. How they used said code in the hierarchy i cannot say. We also had to use boat locks on them until they eventually changed it. This was end of 2008 or early 2009 if I remember correctly.

Edited by Evilvision

Share this post


Link to post
Share on other sites

Reusing code is pretty common actually, and the mechanics for all vehicles is pretty much the same. This code snippet is from WU since I obviously don't have access to WO code base. I sincerely doubt the actual code looks much if any different though at least for this since there haven't been any major changes here since WU was last updated. Just because a vehicle might use the same code for functionality doesn't mean that the displayed information is any different. There is a field in the vehicle class that holds the destination of the vehicle and this is the only thing used in this particular piece of code. Since you can't plot course in a cart or wagon this value is always null and so will always say has no destination set.

 

Wurm uses templates for different items and all items have a fixed specific id that identifies what type of item it is, so by using some kind of decision statement when printing that information to the event log would stop it from showing up.

 

There is one single line which sends this information to the event log:

Quote

 

else {

    comm.sendNormalServerMessage(whereTo + ".");

}

 

 

So we could change this line to read something like:

 

Quote

 

else {

    if (target.getTemplateId() != 539) {

        if (target.getTemplateId() != 850) {

            comm.sendNormalServerMessage(whereTo + ".");

         }

    }

}

 

 

 

Which would just not print the information if the vehicle was a large cart or wagon.

Edited by Pheonixluvsfire
Changed to nested if statement to prevent short-circuit
  • Like 1

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
Sign in to follow this