Jump to content

Any way to tell if Player is in a 'child' worldspace (like diamondcity, Nukaworldmarket)?


PJMail

Recommended Posts

Via script. I don't want to have to hard code all the current known IDs either...

 

Already looked into:

  • getcurrentlocation - doesn't help (as many wilderness cells have none)
  • getworldspace - can't get any attributes of it ("parent" would have been nice!)
  • Pre-existing Formlists - there are none that contain these 'psuedo internal' spaces
  • Vertibirds - they seem to know, but not by anything exposed to modding that I can find.

Any ideas?

Link to comment
Share on other sites

The only one I can find is "GetisWorldspace <worldspace>" which returns 1 if you are in an exterior cell of specified worldspace.

I can do this already by using script (game.getplayer().getworldspace == <worldspace>).

Having to specify a worldspace is even worse as I want to be able to handle mod - added Worldspaces.

I am trying to avoid having a list of 'bad' worldspaces for the above comparison...

Link to comment
Share on other sites

The location of a main worldspace doesn't have a parent location, so you could use Location.GetParent() which is a F4SE function to determine if the current location is a child worldspace or not. But also a parent worlspace's location should have LocTypeWorld keyword, but if we are talking about mod worldspaces there's no guarantee.

Link to comment
Share on other sites

The location of a main worldspace doesn't have a parent location, so you could use Location.GetParent() which is a F4SE function to determine if the current location is a child worldspace or not. But also a parent worlspace's location should have LocTypeWorld keyword, but if we are talking about mod worldspaces there's no guarantee.

 

I am kind of confused by his term "child worldspace", I am not sure if he means a child location in general or a child location that is also an exterior because some interiors are considered child locations of the main worldspace. Both his examples are child locations that are exteriors so I assume that's what he meant by worldspace.

Edited by NoCashNoExp
Link to comment
Share on other sites

I ran some traces to try and develop logic to detect small/child worldspaces for my spawning solutions, but never found a robust case handler.

 

Example NukaWorldMarket worldspace is not an interior does not have its own Location and does not have MapMarkerIsInWorldspace. Ya may want to riff on this script:

 

 

 

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)

Bool bInSmallWorldspace = False
Location ThisLocation = pPlayerRef.GetCurrentLocation()

If (pPlayerRef.IsInInterior() == TRUE)
   bInSmallWorldspace = False
ElseIf (ThisLocation == None) ;Typically Wilderness
   bInSmallWorldspace = False
ElseIf (ThisLocation.HasKeyword(pMapMarkerIsInWorldspace) == TRUE) ; DC & GN
    bInSmallWorldspace = True
ElseIf (ThisLocation.HasKeyword(pLocTypeWorld) == TRUE) ; Commonwealth, Coast, Nuka
    bInSmallWorldspace = False
EndIf
	
Debug.Trace("SKK_TestLoc World: " + pPlayerRef.GetWorldspace() + " Cell: " + pPlayerRef.GetParentCell()+ " Loc: " + pPlayerRef.GetCurrentLocation() + " Int: " + pPlayerRef.IsInInterior() + " Small: " + bInSmallWorldspace )

EndEvent 

 

 

Link to comment
Share on other sites

DieFeM - I considered this at would have been perfect, but my first point "getcurrentlocation - doesn't help (as many wilderness cells have none)" explains why this is not useful. The player could be anywhere when I want to test this.

NoCashNoExp - "Child Worldspace" was my term, I don't know what to call an 'exterior space' that is considered part of a bigger one (the 'parent' worldspace).

SKK50 - As I mentioned to DieFeM, GetCurrentLocation returning None made me discount using it, but I could assume (like you have) that small child worldspaces won't have 'winderness' so could have my test as:

 

Location ThisLocation = Game.GetPlayer().GetCurrentLocation()
Bool IsParentWorldspace = (!ThisLocation || ThisLocation.HasKeyword(pLocTypeWorld)) as bool

 

I will test this logic on a few mod made worlds...

Though I have done some tests and my Vertibird happily lands in Diamond City if called from in there (though it is a bit 'tight' - lucky the game disables collision) so perhaps I will just not worry.

Edited by PJMail
Link to comment
Share on other sites

Why not just store references to the three main worldspaces Commonwealth, Nukaworld and Farharbor and then when the player's location changes check if the worldspace is not one of the three main worldspaces? If it's not then it must be a child worldspace.

Edited by NoCashNoExp
Link to comment
Share on other sites

I was after a more 'generalized' method so I could support Mod added worldspaces, so hardcoding those 3 would be a bad idea.

If I was going to hardcode anything it would be known 'child' worldspaces, just trying not to.

Link to comment
Share on other sites

One thing worldspace locations have in common is the keyword"LocTypeWorld", which other locations don't. So maybe that's a starting point for wilderness cells, modded or not

 

Edit: You already attempted to do this, sry.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...