Map Reveal help

Place to get help with not working mods / modding interface.
Post Reply
User avatar
dtoxic
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Fri Apr 01, 2016 8:40 pm
Contact:

Map Reveal help

Post by dtoxic »

Is there a way to completely disable map reveal by the player only? radars and similar items should remain unaffected.

any code for that?

mrvn
Smart Inserter
Smart Inserter
Posts: 5575
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Map Reveal help

Post by mrvn »

What is supposed to happen when the player walks off the revealed map?

User avatar
dtoxic
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Fri Apr 01, 2016 8:40 pm
Contact:

Re: Map Reveal help

Post by dtoxic »

nothing,like have wrote no map reveal by walking/driving unless you have some sort of a radar with you...i am trying to make a mod that would allow you to equip a portable radar so you can reveal the map (in the map view) if you don't have it and don't have any radars placed the map view would remain black

mrvn
Smart Inserter
Smart Inserter
Posts: 5575
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Map Reveal help

Post by mrvn »

And then I can drive over water because I don't yet know that the black chunk has water there? Or aliens? Or do you want the black to be impassable?


What you could to is catch the either of these events

https://lua-api.factorio.com/latest/eve ... _generated
or
https://lua-api.factorio.com/latest/eve ... nk_charted

and replace the chunk with out-of-map tiles. They are black and impassable then.

Then also catch

https://lua-api.factorio.com/latest/eve ... or_scanned

to get where radar looks at and restore those chunks to their original content if you have them blacked out.

So a player revealing a chunk would get all out-of-map tiles while the radar reveal restores it to the real map. Expect some side effects with pollution going into the deep dark behaving differently or no more aliens coming out of the deep dark to spread into charted regions or to attack you.

Qon
Smart Inserter
Smart Inserter
Posts: 2046
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Map Reveal help

Post by Qon »

dtoxic wrote:
Thu Oct 19, 2023 8:28 am
Is there a way to completely disable map reveal by the player only? radars and similar items should remain unaffected.
I was going to suggest starting with setting character prototype radar_range to 0, but turns out data.raw doesn't contain anything using the radar_range field, so for the character it seems to be un-removable and hard coded in the engine (but you probably can set it and have an overlapping longer range).

So it looks from documentation that it would be easy to just set radar_range to 0, but that probably doesn't do anything :(

Post Reply

Return to “Modding help”