/random command

Looking at the code that runs existing warp mods (like this for example), it doesn't look so hard. A naive implementation could just take a list of existing warps that the target player has access to and picks a random element, printing the name of the warp it chose as you arrived so you could find it again.

A slightly nicer version could make a better experience with things like only considering main builds, but that would be a big administrative effort to decide which warps are "main" and a nice way to store the metadata of what is/isn't alongside the warp list.

But I don't actually know which warp mod WC uses, so the mods/coders would know better.
 

SerLoras

Playwright
Looking at the code that runs existing warp mods (like this for example), it doesn't look so hard. A naive implementation could just take a list of existing warps that the target player has access to and picks a random element, printing the name of the warp it chose as you arrived so you could find it again.

A slightly nicer version could make a better experience with things like only considering main builds, but that would be a big administrative effort to decide which warps are "main" and a nice way to store the metadata of what is/isn't alongside the warp list.

But I don't actually know which warp mod WC uses, so the mods/coders would know better.

It was suggested on my application for Greywater Watch that it might be interesting to have the Greywater Watch "castle" itself be a mysterious location that doesn't actually exist on the server. That would make it impossible to find Greywater Watch on the server much as it is supposedly impossible for outsiders to find it in the story.

I think it would be really cool if /warp greywaterwatch could randomly place you at one of several different unremarkable locations throughout the Neck as a nod to that mystery. That way each time you warp you wind up in a different place and you never actually find Greywater.

Is that something that is also conceivably possible given the code for the warp mod?
 
Had a go at forking a library I could find on GitHub so I have kind of an implementation proposal (linky link), but I am still unaware of which specific plugin the server uses. AFAIK that is also something that can't be queried for from the client side so you'd have to ask Dubz/maybe one of the coders?

Edit: on the GWW side, you could possibly use something like the warp castles at spawn? So you could have random points within the Neck that if you stepped on the right pokey little corner could teleport you to a kind of in-limbo separated-from-the-map space where the castle actually existed. It would mean you couldn't really "find it" so much as occasionally you might chance on it. Like the (badly) illustrated below.

1707
 
Last edited:

Emoticone11

The Dark Lord Sauron
Staff member
A slightly nicer version could make a better experience with things like only considering main builds, but that would be a big administrative effort to decide which warps are "main" and a nice way to store the metadata of what is/isn't alongside the warp list.

I don’t think it just needs to be main locations (since the fun of a /random command, to me, is the possibility of getting teleported to some random hamlet that I’ve never seen before), but rather just warps that lie on the production world (as opposed to the test world). It should be pretty easy to automatically tag warps based on what world they go to, right?

Of course, there’s also the issue of warps in unfinished locations. We *might* be able to exploit that spreadsheet of unfinished/completed projects and do some sort of prefix matching as a first go, but it’s bound to be unreliable.
 
I'd imagine Random Teleport might be cool, but it's a bad user experience to never be able to return. So part of my test implementation was it just picks from the warp list but also prints which one it picked so if you like what you find you can find it again.

Also, RT can be set to only pick a location on the surface, but this is naively computed as anything below the sky. This is clearly designed with the majority-wilderness MC standard content in mind. And we have wilderness, and turning up on the top of a random tree in the middle of nowhere is kind of fun. But given our settlement density, you'd get a lot of "popped into existence on top of a roof". Again, not a technical issue but IMO it's nicer for you to arrive into the purposely chosen warp locations and headings the project leads have selected with a good first impression in mind.
 

Emoticone11

The Dark Lord Sauron
Staff member
Previously we disabled random teleport because it would teleport people to vanilla terrain wildly outside the bounds of the production map (as we had generation on). I’m not sure if that’s still an issue or if it can be constrained somehow.
 

Iwan

Boldtown
Staff member
Wasn't making a case for the Random Teleport Module, merely pointing out it existed as part of our core plugin. I'm aware of its shortcomings.
 

Iwan

Boldtown
Staff member
I wrote a little macro that lets you define an array of warps and it teleports you to any of them. The macro mod is - as pointed out earlier - shipped by the launcher by default, but the macro file itself would require being copied into the respective folder.

Certainly not as good a solution as a server side plugin that defines a /random command, but hey.

Code:
$${
&echo_cmd = "/warp"

#warps_num
#array_size
#random_index

&warps = "Winterfell,WFBattlementsGate,WFHuntersGate,WFCrypts,Kingslanding,Eyrie,Oldtown,Riverrun,Dreadfort"
&warps_arr[] = SPLIT(",",%&warps%);

#array_size = ARRAYSIZE(&warps_arr)
#warps_num = ((%#array_size%) - (1))

RANDOM(#random_index, 0, %#warps_num%)
&warp = %&warps_arr[%#random_index%]%

LOG("Welcome to ",%&warp%)
ECHO(%&echo_cmd% %&warp%)
}$$
 
Last edited:
  • Like
Reactions: Luk and hoosfoos

Lord_Stark_05

Storyteller
Guest
I just thought you could take the database of warps on the server, and teleport you there. If you want to make it even more random, you could have the server randomly teleport you a certain amount of blocks from the warp. That eliminates the whole Vanilla teleportation problem.