Jump to content

FOUND - Console Command to Reveal Whole Map for All Players (ANewReignBeta)


Recommended Posts

FOUND - Console Command to Reveal Whole Map for All Players (ANewReignBeta)

Following A New Reign Beta, I wanted to quickly generate a whole bunch of different caves and quickly view the map, to observe the patterns in world generation.

Even better if I could reveal the entire map not just for myself, but for other players on the server, too.

I checked a bunch of websites and mods, but couldn't find anything that worked for all players in A New Reign Beta on a Dedicated Server with Caves.

So I dug through the source code (started with Ocuvigil code, lol) and managed to hack it together myself.

Here is the command:

for k,v in pairs(AllPlayers) do for x=-1600,1600,35 do for y=-1600,1600,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end

It is a bit of a hack, it assumes that x=-1600,1600 and y=-1600,1600 are sufficiently large to cover your entire map.

This is true for a world of default size, but if you generate a world that is much larger, you might need to make those numbers even bigger.

Please note that the whole server hiccups and freezes for a moment when you run it.

 

Link to comment
Share on other sites

20 hours ago, Maarx said:

FOUND - Console Command to Reveal Whole Map for All Players (ANewReignBeta)

Following A New Reign Beta, I wanted to quickly generate a whole bunch of different caves and quickly view the map, to observe the patterns in world generation.

Even better if I could reveal the entire map not just for myself, but for other players on the server, too.

I checked a bunch of websites and mods, but couldn't find anything that worked for all players in A New Reign Beta on a Dedicated Server with Caves.

So I dug through the source code (started with Ocuvigil code, lol) and managed to hack it together myself.

Here is the command:


for k,v in pairs(AllPlayers) do for x=-1600,1600,35 do for y=-1600,1600,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end

It is a bit of a hack, it assumes that x=-1600,1600 and y=-1600,1600 are sufficiently large to cover your entire map.

This is true for a world of default size, but if you generate a world that is much larger, you might need to make those numbers even bigger.

Please note that the whole server hiccups and freezes for a moment when you run it.

 

This is gona be so useful in running game related tests.

Thank you so much.

Link to comment
Share on other sites

On 11/6/2016 at 0:18 PM, Maarx said:

It is a bit of a hack, it assumes that x=-1600,1600 and y=-1600,1600 are sufficiently large to cover your entire map.

Here is one that makes no assumption:

local w,h = TheWorld.Map:GetSize();for _,v in pairs(AllPlayers) do for x=-w*4,w*4,35 do for y=-h*4,h*4,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end

And here's one that uses a hexagon approach for packing the circles for a slight optimization in the networking:

local r=25;local p=math.sqrt(3);local q=.5*p*r;local w,h=TheWorld.Map:GetSize();w=4*w;h=4*h;for _,v in pairs(AllPlayers) do for x=-w,w,3*r do for y=-h,h,2*q do v.player_classified.MapExplorer:RevealArea(x,0,y) end end for x=-w+q*p,w,2*q*p do for y=-h+q,h,2*q do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end

 

Link to comment
Share on other sites

39 minutes ago, mags01 said:

sorry for being a newb, how do i implement the code on the console should i just copy paste? thank you :)

coz i tried copy/paste it and nothing happened 

 

Also if you're copy pasting ensure to hit control again, lest you send it to the client instead of the "Remote:" server.

Link to comment
Share on other sites

6 minutes ago, mags01 said:
9 minutes ago, CarlZalph said:

Also if you're copy pasting ensure to hit control again, lest you send it to the client instead of the "Remote:" server.

Thanks Carl, now it works thank to pinpointing to hit control again :), is there a way to remove the fog of war completely? i mean i see the revealed map but it doesn't remove the fog of  war.

Cheerios :)

Link to comment
Share on other sites

6 minutes ago, mags01 said:

Re-edited. Thanks Carl, now it works thank to pinpointing to hit control again :), is there a way to remove the fog of war completely? i mean i see the revealed map but it doesn't remove the fog of  war.

Cheerios :)

Unfortunately not.

The fog of war is there because the server unloads everything out of every player's view distance, and as such nothing changes so the map doesn't update.

Link to comment
Share on other sites

2 minutes ago, CarlZalph said:

Unfortunately not.

The fog of war is there because the server unloads everything out of every player's view distance, and as such nothing changes so the map doesn't update.

Thank you, but is there a way to show the prefabs? like set pieces when revealing the map ..(walls/pig houses/ etc..)

Link to comment
Share on other sites

5 minutes ago, mags01 said:

Thank you, but is there a way to show the prefabs? like set pieces when revealing the map ..(walls/pig houses/ etc..)

The command @CarlZalph posted should work.

local w,h = TheWorld.Map:GetSize();for _,v in pairs(AllPlayers) do for x=-w*4,w*4,35 do for y=-h*4,h*4,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end

 

Link to comment
Share on other sites

3 minutes ago, Kzisor said:

The command @CarlZalph posted should work.


local w,h = TheWorld.Map:GetSize();for _,v in pairs(AllPlayers) do for x=-w*4,w*4,35 do for y=-h*4,h*4,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end

 

It does work thank you :), but the map doesnt show walls/ pighouses/ etc.. :)

 

Link to comment
Share on other sites

Is there a way to reverse the map reveal?  

I'm getting into DST with friends as map host and it's helpful to reveal a map and see it's not too hostile.  After that I want to reverse it to uncovered (like the map commands in DTS which cease to apply after you log out).

Link to comment
Share on other sites

On 2016/11/8 at 0:31 AM, CarlZalph said:

Here is one that makes no assumption:


local w,h = TheWorld.Map:GetSize();for _,v in pairs(AllPlayers) do for x=-w*4,w*4,35 do for y=-h*4,h*4,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end

 

These commands works fine in all worlds with caves in DST. But..

I generated a world without caves in DST. Pressed "`" to open the console and pasted this code. After several seconds the map revealed. Then I pressed "`" again to open the console, the game crashed suddenly.

I tried another time, and the game crashed as before.

Is there any logs that I can provide?

Link to comment
Share on other sites

after me and a friend tried this command on mine and her map, my game started bugging when i entered a friend's server, it's only with her server, i tried any other server and it worked perfectly, it's just with hers, another friend entered too and has the same bug. The bug is that it shows me i can make anything from the craft menu (but actually i can't), and my health, hunger and sanity is bugged, it shows like everytime i'm losing health, or shows that i only have 100 when i just entered the server for the first time, and sometimes suddenly starts the burn animation on the hud or te freeze or sometimes the overheating, when i die more usually, and my ghost disappears, and sometimes i can't even move

bug.jpg

bugg.jpg

buggg.jpg

20170419172613_1.jpg

Link to comment
Share on other sites

27 minutes ago, ihr_schutzengel said:

after me and a friend tried this command on mine and her map, my game started bugging when i entered a friend's server, it's only with her server, i tried any other server and it worked perfectly, it's just with hers, another friend entered too and has the same bug. The bug is that it shows me i can make anything from the craft menu (but actually i can't), and my health, hunger and sanity is bugged, it shows like everytime i'm losing health, or shows that i only have 100 when i just entered the server for the first time, and sometimes suddenly starts the burn animation on the hud or te freeze or sometimes the overheating, when i die more usually, and my ghost disappears, and sometimes i can't even move

bug.jpg

bugg.jpg

buggg.jpg

20170419172613_1.jpg

Happens on  a specific server I join too, it's not the command. Most likely mods.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...