Check if player is in the wilderness

Post » Sat Feb 19, 2011 2:53 am

Currently I'm using if player.GetInCell Wilderne == 0 and created a cell in World Space Interiors called Wilderne to check if the player character is not located in the wilderness. For some reason however this method doesn't seem to work for everybody. Is it possible that some mods change the Wilderness cells somehow, or if there's some other possible issue? Thanks in advance.
User avatar
suniti
 
Posts: 3176
Joined: Mon Sep 25, 2006 4:22 pm

Post » Sat Feb 19, 2011 6:08 am

The wilderness cells only tend to be called wilderness when they really have nothing in them, often getting renamed after whatever significant landmark. So unfortuately I don't think that GetInCell is really viable here. One option would be to check the player's distance from every town, but you'd have to get a lot of coords if you want to not include villages etc. as well. Another option would be to check that they're outside and NOT in any of the city/village cells. Although that is also a little long winded. Or you could make an area-of-effect spell to cast on the player, that simply counts how many trees are in the vicinity. Personally I think your going to have to use a comination of these techniques if you wan't anything reliable.
User avatar
NeverStopThe
 
Posts: 3405
Joined: Tue Mar 27, 2007 11:25 pm

Post » Fri Feb 18, 2011 9:14 pm

Is there a method to check if the player character is not in the interior worldspace? It seems GetInWorldspace will always return 0 when in the interior worldspace, so seems not a viable option.
User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm

Post » Sat Feb 19, 2011 6:55 am

Ah, so are you counting dungeons as being 'wilderness' as well, or do you just want outside to count?
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am

Post » Sat Feb 19, 2011 7:36 am

No, only outside. I can use IsInInterior to check for inside dungeons and houses, but inside city walls also returns false for IsInInterior. So ideally I would like to use a combination of IsInInterior == 0 and something to check not being in town. Thinking about it it might work with the Tamriel worldspace, but i guess that wouldnt work with shivering isles.
User avatar
Alberto Aguilera
 
Posts: 3472
Joined: Wed Aug 29, 2007 12:42 am

Post » Fri Feb 18, 2011 8:39 pm

What I did in my Vampirism Mod was use getinCell with the town cells, then just assumed everything else was Wilderness-- not perfect if there are, for example, new Mod-added towns, but it works well enough for what I needed-- maybe it would work for you too? Each Town has it's own GetInCell Interior, so it should be easy enough to code in :)
User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am

Post » Fri Feb 18, 2011 8:28 pm

GetParentWorldspace
GetCurrentRegions

One of those two should be it then
User avatar
Amy Siebenhaar
 
Posts: 3426
Joined: Fri Aug 10, 2007 1:51 am

Post » Sat Feb 19, 2011 4:28 am

Is there a method to check if the player character is not in the interior worldspace? It seems GetInWorldspace will always return 0 when in the interior worldspace, so seems not a viable option.

What's the problem with GetInWorldspace Tamriel ?

Are you running Open Cities, so that the cities are in Tamriel, instead of their own worldspaces? Do you want to specifically exclude the areas around houses, Inns, villages, dungeon entrances etc (these have cell names other than Wilderness)?
User avatar
Daniel Lozano
 
Posts: 3452
Joined: Fri Aug 24, 2007 7:42 am

Post » Sat Feb 19, 2011 9:42 am

oh, and GetNumRefs could be used to check for the number of, say trees or NPCs, in the current and surrounding cells. A lot of trees, probably wilderness, a lot of NPCs probably not, plus you could find NPCs and check what factions they're in, or if they're guards.
User avatar
Jade MacSpade
 
Posts: 3432
Joined: Thu Jul 20, 2006 9:53 pm

Post » Sat Feb 19, 2011 9:34 am

I tested GetParentWorldspace, but that doesn't work as the docks of Anvil also returns no name and would therefore be considered "wilderness". It also doesn't work with Open Cities. GetCurrentRegions doesn't seem to be helpful either (does something different). Checking for cell names doesn't work either as many places (like docks of Anvil) don't have a name. In the end there doesn't seem to be a substitution for checking for Wilderness directly.

Instead, would anybody be able to tell me which mods could be conflicting with checking for wilderness? I've not been able to find any myself.
User avatar
Sammygirl
 
Posts: 3378
Joined: Fri Jun 16, 2006 6:15 pm


Return to IV - Oblivion