Aller au contenu

Photo

How to hide sections of the mini map until explored


  • Veuillez vous connecter pour répondre
26 réponses à ce sujet

#1
Clyordes

Clyordes
  • Members
  • 300 messages
Hi folks,  First off, apologies as I'm sure this is a simple thing, but I can't get it to work.
I'm virtually at the end of my current project & on playtesting I'm noticing that you can see virtually all of each dungeon level (around 16x16 squares) as soon as you enter the level. 
I'd really like to limit the area that can be seen, but I'm not having much luck so far.  I've added closed doors on some long passages & some are stopping line of sight at the door, but others make no difference.
I remembered seeing a thread somewhere about using the estates Lid placeable, blown up to cover areas, then destroyed on entering a relevant trigger.  I've found that the lids are great for hiding areas of the map, but I can't get a script to destroy them. 
This is what I'm using at the moment (via Lilac Soul):
/*   Script generated by
Lilac Soul's NWN Script Generator, v. 2.3

For download info, please visit:
http://nwvault.ign.c...=4683&id=625    */

//Put this script OnEnter
void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

object oTarget;
oTarget = GetObjectByTag("lid_1");

DestroyObject(oTarget, 0.0);

}

Can anyone tell me where I'm going wrong with the script, or whether there's some obvious tick box in area properties or similar that I can use to limit what can be seen on the minimap to what the PC can actually see / has explored already?

Everything else is working fine apart from this - so once sorted I can upload it to the vault :crying:

#2
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Regarding your overall desire to not have the map revealed all at once: I believe that Lance Botelle has fixed this with a mod he has on the vault.

Here's the link:

http://nwvault.ign.c...I.Detail&id=157


Regarding your script (which is probably irrelevant since Lance's mod is great), maybe the placeable was set to plot? Or maybe static? Change these settings to false and it should work.

#3
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
Generally rooms that share an adjacent wall with an area that is visible on the mini-map will also be visible. Careful dungeon design using doors and avoiding adjacent walls can prevent areas from being visible.

In your script I would try using GetNearestObjectByTag since you probably have the same tag used multiple times.

Modifié par Kaldor Silverwand, 29 mars 2011 - 05:37 .


#4
Clyordes

Clyordes
  • Members
  • 300 messages
Thanks chaps, M. - you were right, the 'lid' was set as static, but I decided to try Lance's solution & it seems to work really well. I particularly like the way that the map isn't accessible during combat - very nice touch & could lead to some nice chaos when trying to escape if things are going badly!

For some reason it doesn't seem to do anything to the minimap though - except make it huge (maybe its my resolution settings).

Either way, I'm a happy bunny & will try uploading the adventure first thing in the morning.

Kaldor - I found that out the hard way - trying to keep the dungeon maps faithful to the original PNP adventure maps led to a few rooms being visible 'through' walls - and one room that is visible sometimes when you enter through a door into the area, but not others. Not sure what's going on there - maybe something to do with where the characters are in the room when they spawn? Anyhow - all sorted now - until the first feedback comes in.....

Cly.

#5
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I think there is an update that fixes the mini-map. Not sure though.

#6
Clyordes

Clyordes
  • Members
  • 300 messages
Oops, thanks, looks like you're right if I'm reading lance's notes right. And It seems I need to edit the hak to implement it - another new thing to learn ;-)
Wish me luck.

#7
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Clyordes wrote...

Oops, thanks, looks like you're right if I'm reading lance's notes right. And It seems I need to edit the hak to implement it - another new thing to learn ;-)
Wish me luck.



Hi Clyordes,

If you want to keep to the smaller mini-map, download and use the alternative XML file on the Vault. As you say, this is the one you need to place in the hak if you want the smaller mini-map.

Also, you can disable/enable the minimap with code in your module with the additions I have made. So, if you want to turn off the mini-map (to prevent any clues), then do so. Posted Image

If you have any questions regarding the use of the system, do ask. And if you haven't already, don't forget to vote. Posted Image There is a direct email contact to me in the manual.

Lance.

Modifié par Lance Botelle, 30 mars 2011 - 11:43 .


#8
Clyordes

Clyordes
  • Members
  • 300 messages
Hi Lance, thanks for the response - the other contributors are right, you're support puts a lot of 'official' organisations to shame!
Couple of questions if you would care to answer:
I have around 30 areas - some big that I want to use the fog of war effect on, and some little ones that I don't.
Your instructions state that to avoid the FOW effect, I need to put a waypoint somewhere in the area, but wouldn't I get the same effect by just not including your OnEnter script in the area properties? Or am I missing something obvious here?

#9
Shaughn78

Shaughn78
  • Members
  • 637 messages
Lance's system is the solution, I have been using it and it is very nice.

For the mini-map, I have been disabling it for interior areas, so players aren't given too much of the map without exporing. For exterior area I modified the the mini-map gui so that it doesn't have the zoom in/out feature. The default zoom setting in the mini-map is about the equivalance of the players line of sight with default fog settings.

#10
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Clyordes wrote...

Hi Lance, thanks for the response - the other contributors are right, you're support puts a lot of 'official' organisations to shame!
Couple of questions if you would care to answer:
I have around 30 areas - some big that I want to use the fog of war effect on, and some little ones that I don't.
Your instructions state that to avoid the FOW effect, I need to put a waypoint somewhere in the area, but wouldn't I get the same effect by just not including your OnEnter script in the area properties? Or am I missing something obvious here?


Hi Clyordes,

"Do unto others" is my policy regarding responses. I know I need help and I always appreciate quick responses.

There is a ResfreshMap function in the OnEnter code that clears the map for areas that do not use the FoW. If it is not called, then the FoW from a previous map will remain covering the new map. Therefore, unfortunately, you still need the code. There are also one or two other functions for other mapping functions that you may like to use to reveal or hide the maps altogether.

If you are like me, however, you probably only have one area OnEnter script, whch should be very easy to add to each area - a simple matter of copy and paste the script name into each area. Even 30 or so areas would not take that long. Posted Image Obviously, you have to make sure there is a line that prevents any specific code from firing on every area entered, but that is easy enough to add.

Let me know how you get on.

Lance.

Shaughn78 wrote...

Lance's system is the solution, I have been using it and it is very nice.

For the mini-map, I have been disabling it for interior areas, so players aren't given too much of the map without exporing. For exterior area I modified the the mini-map gui so that it doesn't have the zoom in/out feature. The default zoom setting in the mini-map is about the equivalance of the players line of sight with default fog settings.



Thanks for the support Shaughn. Your settings sound similar to my own.

Lance.

Modifié par Lance Botelle, 30 mars 2011 - 06:16 .


#11
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Does the FOW system have settings for disabling the min map, or did you have to code that yourself, if you have to code it yourself, would you mind sharing?

#12
Shaughn78

Shaughn78
  • Members
  • 637 messages
M.Rieder, it is part of the current code. It uses a local variable on the individual areas and you can set it to use both maps, disable only mini-map, disable only area map or diable both maps.
just looked they aren't in the walkthrough (at least not my version) but they are in post in the cc forum. If i find it I will put a link.

**Edit link to Lance anouncement, answers some of the questions here and likely a few other things.
CC Forum

Modifié par Shaughn78, 30 mars 2011 - 09:30 .


#13
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

M. Rieder wrote...

Does the FOW system have settings for disabling the min map, or did you have to code that yourself, if you have to code it yourself, would you mind sharing?



Shaughn78 wrote...

M.Rieder, it is part of the current code. It uses a local variable on the individual areas and you can set it to use both maps, disable only mini-map, disable only area map or diable both maps.
just looked they aren't in the walkthrough (at least not my version) but they are in post in the cc forum. If i find it I will put a link.

**Edit link to Lance anouncement, answers some of the questions here and likely a few other things.
CC Forum


Hi Matt & Shaughn,

Thanks for answering this Shaughn. Posted Image

Matt, Shaughn is correct. Unfortunately, I did not go into much detail about this part of the code as I thought the function was self-explanatory ... and I was probably being a little presumptious. My apologies. Posted Image

However, the link Shaughn provides does cover the answer and here is the function explanation:

///////////////////////////////////////////////////////////////////////////////////////////////////
// MAPS GUI CHECK/UPDATE FACILITY - JUST AREA MAP (OR BOTH AREA & MINI MAP)
// CHECKS LOCAL VARIABLE ON AREA & UPDATES MAP STATUS ACCORDINGLY
// Override can be 0, 1, 2 or 3 and will immediately update the current map status.
// If Override is 0, then area and mini maps are both enabled.
// If Override is 1, then area map is disabled. Mini map is enabled.
// If Override is 2, then area and mini maps are both disabled.
// If Override is 3, then area map is enabled. Mini map is disabled.
///////////////////////////////////////////////////////////////////////////////////////////////////
void UpdateMapGUI(object oPlayer, int Override);
void UpdateMapGUI(object oPlayer, int Override)

Passing a variable via this function onto the player in question will alter the map accessibility. The demo module has a working example of this code in action.

Lance.

Modifié par Lance Botelle, 31 mars 2011 - 11:36 .


#14
Clyordes

Clyordes
  • Members
  • 300 messages
Many thanks Lance - tested everything last night & all seems to work grand. I've left the minimap enabled for anyone who really wants to see everything, albeit in a small radius around themselves, and the main map works really well. I don't know how long it took you to put together, but it was worth every minute.
Adventure now uploaded & on the vault - thanks again.

#15
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Clyordes wrote...

Many thanks Lance - tested everything last night & all seems to work grand. I've left the minimap enabled for anyone who really wants to see everything, albeit in a small radius around themselves, and the main map works really well. I don't know how long it took you to put together, but it was worth every minute.
Adventure now uploaded & on the vault - thanks again.



Hi Clyordes,

You're welcome. And thanks for the vote on the Vault. (I forgot to thank you there when answering your comment.)

The coding took me some time, but that's mainly due to ill health.

And to answer your Vault comment here too: I have created a Map Pins system of sorts. Check out Show Me The Way and Map Pins Have A Future? from my blog.

Unfortunately, because it is more integrated into my own module via other menus, it is not as easy to upload as a seperate system. If you are interested, be sure to follow my blog and download a copy of the module when it's released. Blog link in my sig.

Lance.

Modifié par Lance Botelle, 01 avril 2011 - 01:20 .


#16
Clyordes

Clyordes
  • Members
  • 300 messages
Ah - interesting Lance. Well done for working so hard on trying to sort this.
Part of me gets so frustrated that NWN2 didn't have at least the same level of functionality as NWN1 - seemed a real backward step when I first installed it.
But, 2 is so pretty compared to 1 that I'm really resistant to go back - call me shallow! I can see why so many people stayed with the original.
I'm presuming that the legal wrangles between Obsidian & Atari (if I've got it the right way round) are a big part of what's stopping any more patches being released.

#17
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Clyordes wrote...

Ah - interesting Lance. Well done for working so hard on trying to sort this.
Part of me gets so frustrated that NWN2 didn't have at least the same level of functionality as NWN1 - seemed a real backward step when I first installed it.
But, 2 is so pretty compared to 1 that I'm really resistant to go back - call me shallow! I can see why so many people stayed with the original.
I'm presuming that the legal wrangles between Obsidian & Atari (if I've got it the right way round) are a big part of what's stopping any more patches being released.



Hi Clyordes,

I do agree that there do appear to be some backward steps. However, the "pros" of NWN2 far outweigh its "cons" in my opinion. Posted Image The ability to add one's own GUIs is a great benefit.

Having experienced some building with programs now, I would really have liked to see a z axis incorporated and made easy to build with. (By this, I mean where we can have a walkmesh that handles bridges and things that can be walked under as well as over.) That's my only real disappointment.

Lance.

Modifié par Lance Botelle, 06 avril 2011 - 11:51 .


#18
Clyordes

Clyordes
  • Members
  • 300 messages
Good point Lance - and did I mention how pretty it is? :-)

Someone else recently mentioned in the forums that NWN2 is one of the only games where you can get together with buddies & watch a great sunset with dynamic shadows etc. - I think it was in a debate about how demanding the engine is compared to dragon age, despite DA being newer.

I've never played DA, but it seems that the shadows are somehow 'fixed' which seems like a good way of making it much less demanding, but much less immersive at the same time.

#19
Clyordes

Clyordes
  • Members
  • 300 messages
Hmm - I'm getting feedback from at least one player so far who noticed that the FogOfWar isn't working right.  I've not had any problems myself, but I've had a report of it not functioning at all in some areas - although it has in others.  Apparently some areas of my latest project aren't showing any map at all - its all black. 

Lance, if you're still watching this one, the link to my page is nwvault.ign.com/View.php
- just in case that's useful.

In case its not, what sort of info would be useful for you?

Cly.

#20
Arkalezth

Arkalezth
  • Members
  • 3 188 messages

Clyordes wrote...

Hmm - I'm getting feedback from at least one player so far who noticed that the FogOfWar isn't working right.  I've not had any problems myself, but I've had a report of it not functioning at all in some areas - although it has in others.  Apparently some areas of my latest project aren't showing any map at all - its all black.

I'm that player. I already explained my issues at the module's page, but if anyone needs to ask me something, send me a PM, I may not see it otherwise because I rarely visit builders' section of the forums.

#21
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Clyordes,

Sorry for the late reply. I have been away from the boards. I will check out your link and see if I can understand what your problem is. My guess is that it's not a major issue.

Lance.

Here is my Vault response:

Hi All,

The FoW issue does not sound like one related to the FoW code itself, unless it has not been implemented correctly.

The only reason an area would be completely black is if the area OnEnter does not have the map update function attached to it that removes areas previously updated by movement in them. Of course, if the area has not been visited before, then it will be black until one starts moving.

Otherwise, as soon as the map is opened the map update function fires and begins removing the fog.

If you want me to take a closer look at the particular game in question, upload the game files to something like Dropbox and I will take a look.

Lance.


Modifié par Lance Botelle, 21 avril 2011 - 09:30 .


#22
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Clyordes,

From the Vault:

Hi Clyordes,

Having downloaded your mod and taken a look, I can see that you have not implemented the FoW correctly. All areas MUST have the onarea exit script attached to them.

If this script is not added or incorporated into existing OnExit scripts then the variable is not deleted and the system does not know to start again when entering a new area.

That is just what I have found after an initial look. I will continue looking for any other issues, but this definitely needs to be done to fix any potential FoW issues.

Lance.


EDIT: I am working on a version that tries to remove the need for the OnExit script. I am not sure why I did not do this before, so maybe there was a reason I could not do it. However, I will let you know and supply udated code for you if I succeed. < This is not possible, see please explanation in the next post. A timing issue prevents being able to remove the variable at any other time and the variable does need to be removed to ensure all aspects of the system work and do not overload the system.

Modifié par Lance Botelle, 22 avril 2011 - 04:01 .


#23
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Clyordes,

A paraphrased/slight reword copy of what I posted on your Vault page:

Hi All,

This does appear to be down to a timing issue between when the player leaves an area and loads a new one and the mapping startng to map the new area. If the mapping variable is not removed from the player as they leave an area, then there is a risk that the mapping function will stop (due to being between areas and returning an invalid area), but not be able to update the variable on the player as they cannot be accessed between areas, so the variable is not corrected for this map stopping. Therefore, when the player enters the new area, the mapping system thinks the player is still mapping and so does not start the process again - and would also be why opening the map will also not restart the mapping. This check is made to prevent multiple versions of the mapping function firing and causing massive overload for the module.

THE FIX: This problem does require Clyordes to implement the OnExit script to each area as explained in the FoW manual. This will then ensure the variable is set correct on the player prior to any area transitions, which is then updated upon arriving in the new area.

Lance.


Modifié par Lance Botelle, 22 avril 2011 - 04:00 .


#24
Clyordes

Clyordes
  • Members
  • 300 messages
Doh! - you're right Lance - thanks for checking this out - definitely a case of less haste, more speed on my part.
Lets see how soon I can amend it with V1.4...........

Cly.

#25
Clyordes

Clyordes
  • Members
  • 300 messages
Ah - I've seen why I went wrong & didn't add in the on_exit script. Lance - in your pdf there's a section labelled "Basic Area Map Building Steps", and it mentions the on enter script, but not the on exit one - I think I must have just skimed straight down to that & missed the bit right at the start that states clearly that the on exit script has to be included in every area.

Cly.