Jump to content

Any way to extract Hold designation from a map marker ?


Recommended Posts

e.g if I have a map marker ObjRef in a Formlist ?

I'm trying to compare the Hold location of the player (a) with the Hold location of a particular place (b) (via its map marker). 

If a = b
        give information (cuz npc is in the region and knows)
else
       tell player to ask around in (b).

 

EDIT: I guess I'm doing something like: 

if player.IsInSameCurrentLocAsRef MapMarkerInFormlist LocTypeHold
     give information blah blah

 

But I don't understand how to set up the following more complex checks:

If currentHoldofPlayer == 0   ;   e.g if player is in whiterun hold currently
      If (holdofAParticularLocation(via map marker) == 0) || (holdofAParticularLocation(via map marker) == 3) || (holdofAParticularLocation(via map marker) == 5)   ;ie,a nearby hold 																																		
           give information to player because npc is in the hold or a nearby hold.
      Else
          npc tells player they don't know, and sends them to hold (of mapmarker) 
      Endif
Elseif currentholdofplayer == 1
...
Endif


 

 

Edited by csbx
Link to comment
Share on other sites

Bool InTheSameAreaA = WhateverRef.GetCurrentLocation() == PlayerRef.GetCurrentLocation()

Bool InTheSameAreaB = WhateverList.HasForm(PlayerRef.GetCurrentLocation())

Bool InTheSameAreaC = WhateverMapMarker.GetDistance(PlayerRef) < 5000.0

Many ways to scan, and perhaps all the above are not ideal. Depends mainly what your specific goal is, before good specific advice can be offered, but above are some ways to wing it with proximity

Link to comment
Share on other sites

Use Location.isSameLocation:

Keyword property LocTypeHold auto

ObjectReference testThis
ObjectReference mapMarker

if testThis.getCurrentLocation().isSameLocation( mapMarker.getCurrentLocation(), LocTypeHold)
	isThere()
else
	isNotThere()
endif

Either that, or I didn't get what you're looking for.

Link to comment
Share on other sites

Posted (edited)
18 hours ago, Sphered said:
Bool InTheSameAreaA = WhateverRef.GetCurrentLocation() == PlayerRef.GetCurrentLocation()

Bool InTheSameAreaB = WhateverList.HasForm(PlayerRef.GetCurrentLocation())

Bool InTheSameAreaC = WhateverMapMarker.GetDistance(PlayerRef) < 5000.0

Many ways to scan, and perhaps all the above are not ideal. Depends mainly what your specific goal is, before good specific advice can be offered, but above are some ways to wing it with proximity

Right ! I'll have a look at these possible angles.  Much appreciated.

4 hours ago, xkkmEl said:

Use Location.isSameLocation:

Keyword property LocTypeHold auto

ObjectReference testThis
ObjectReference mapMarker

if testThis.getCurrentLocation().isSameLocation( mapMarker.getCurrentLocation(), LocTypeHold)
	isThere()
else
	isNotThere()
endif

Either that, or I didn't get what you're looking for.

Thanks for taking the time. What happens if the player is currently in Dragonreach (just as an example) or in some cave in Whiterun hold. Does the game count the parent location (type hold) as Whiterun hold ? I'm worried my checks will work 95% of the time, but that I'm not solid enough on how the game designates this stuff that I'll fail to properly formulate conditions.

Edited by csbx
Link to comment
Share on other sites

8 hours ago, xkkmEl said:

Use Location.isSameLocation:

Keyword property LocTypeHold auto

ObjectReference testThis
ObjectReference mapMarker

if testThis.getCurrentLocation().isSameLocation( mapMarker.getCurrentLocation(), LocTypeHold)
	isThere()
else
	isNotThere()
endif

Either that, or I didn't get what you're looking for.

So rather than a comparison, what ends up making sense for my situation is the following. Now, the following does NOT work, so I'm hoping you have an idea why that is !

If PlayerRef.IsInLocation(w)                                 ; w is a location property and is filled by "WhiterunHoldLocation"
		debug.messagebox("player is indeed in whiterun")
		If MapMarker.IsInLocation(w) || MapMarker.IsInLocation(h) || MapMarker.IsInLocation(f)				h,f are loc properties for other hold locations
			debug.messagebox("work normally, help the player")
		Else
			csbmagmapchosen.setvalue(93)																
			debug.messagebox("can't help the player")
		Endif

elseif ..
endif

 

Link to comment
Share on other sites

3 hours ago, xkkmEl said:

Add more traces to confirm the content of your variables and properties.

PlayerRef.IsInLocation(w) 

The above never gets satisfied, though the player is definitely in Whiterun Hold (tamriel worldspace). Property w is assigned to WhiterunHoldLocation.

I think I know what's wrong here. I should be asking if WhiterunHoldLocation is a 'parent' to the location that is currency in my code. I think..

Link to comment
Share on other sites

Posted (edited)
Location Property PlayerLoc auto

PlayerLoc = game.getplayer().getcurrentlocation()           

debug.messagebox(playerLoc)

    if PlayerLoc.isSameLocation(w, keyword.getkeyword("LocTypeHold"))

the debug yields NONE so clearly I don't understand even the basic portion of this 😕

EDIT: I just remembered something you said in another thread about locations in the wilderness potentially being NONE. So my code may potentially be set up almost correctly after all.

So PlayerLoc is getting me nothing here--but I need to return the hold level info; then I could just use If PlayerLoc == w   ;whiterunholdlocation

Edited by csbx
Link to comment
Share on other sites

Locations are hierarchical, so Bannered Mare is a separate location child of WhiterunHold...  You do need the isInLocation, or isSameLocation test.

However, if you refer to a colored map showing you borders between holds, most cells won't correspond to the map because they do not have a location set at all, and others will have a location that is not attached to any hold.

I know of no way to fill in the gaps in order to get a clean and complete cell-to-hold mapping.

In my WIP mod, I have processing that is triggered by a change of hold... I assume the player is in the last hold visited until he enters a cell that is positively attached to a different hold...  The gaps are large... so very few cells have an actual location set.

Link to comment
Share on other sites

1 hour ago, xkkmEl said:

Locations are hierarchical, so Bannered Mare is a separate location child of WhiterunHold...  You do need the isInLocation, or isSameLocation test.

However, if you refer to a colored map showing you borders between holds, most cells won't correspond to the map because they do not have a location set at all, and others will have a location that is not attached to any hold.

I know of no way to fill in the gaps in order to get a clean and complete cell-to-hold mapping.

In my WIP mod, I have processing that is triggered by a change of hold... I assume the player is in the last hold visited until he enters a cell that is positively attached to a different hold...  The gaps are large... so very few cells have an actual location set.

Well sheeeit. That's rough. I actually have my setup working now, but, yes, it only works if the player is talking to an npc that is currently in a normal kind of location. E.g. if the npc is outside whiterun city, works beautifully. if it's the fisherman you're talking to down below the standing stones south of riverwood, it fails--presumably because of the

PlayerLoc = game.getplayer().GetCurrentLocation()

that I'm then running through 

If (PlayerLoc.IsSameLocation(PlaceInWhiterunHold, loctype)) 

 

I guess I should have really understood the topology around the topic before delving in headfirst presuming it would work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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