Jump to content

[LE] Multiple Areas Under One Location (For Scripts)


Recommended Posts

I've had some success with my formation scripts I had mentioned in earlier posts. However, there is one issue I am running into: chokepoints. When a large formation of soldiers come across a bridge or a town, their pathfinding is all messed up. Originally my plan was to create X-Markers and place them all over bridges and use them as a proxy to compare the formation leader's distance to the marker (if they are close to the marker ie. the bridge, the formations will stop). However, there are far too many bridges throughout Skyrim and comparing distance of over 10+ bridges seems like an inefficient and slow option.

 

I was wondering if there are any other methods to detect whether an NPC has encountered a bridge. I have one idea but I am not exactly sure how to execute it. It involves locations. Maybe I could create a single "ChokepointLocation" where I make each bridge part of this singular location and determine whether the formation leader NPC is in this "ChokepointLocation" or not to determine whether the formation script should fire or not.

 

Take for example, WhiterunLocation, it covers part of Whiterun's walled exterior entrance but also near the Honningbrew Meadery and the two bridges nearby (it would seem that WhiterunLocation covers multiple separated areas. If there is a way to create a new location and mark each bridge or chokepoint under the same location, I think I wouldn't need to create individual locations/xmarkers and could operate under a single location and speed up the process, however I am unsure as to how the game creators managed to specify certain areas/geometry of a map or cell to be marked as a certain location, and if someone could point me towards the right direction or add some new ideas as to how to accomplish this I would really appreciate it.

 

I suspect some of the primitive boxes in CK may have something to do with this?

 

Also, could another option be attaching scripts to trigger volume's? So once an NPC enters a bridge a script fires that stops the formation script?

 

 

 

 

Edit: It seems like locations are tied to a cell, and you can't add additional locations to a cell without changing the original location, which means you'll have to do a bunch of linking, so locations are out of the question.

 

However, I have gone through and discovered trigger boxes. Perhaps I can create a script where if the formation leader enters a trigger volume, they are added to a "Chokepoint Faction" which then is removed once they leave the trigger volume, and the formation script could check whether or not the formation leader is in the "Chokepoint Faction" or not to determine whether they should go into formation or not.

 

 

Edit: Through testing I have come up a solution I will have to test. The solution is to add a dummy item to object references which have specific keyword related to the formation leaders every time that they enter the trigger box, and removing them every time they leave the trigger box. The formation script will then check whether the formation leaders have this dummy object in their inventory, and if so, their formations will cease. A much better solution that the approach of adding a ton of X markers everywhere.

 

Edit: The solution had worked! Hoorah!

Edited by Guest
Link to comment
Share on other sites

  • Recently Browsing   0 members

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