WarbirdShaman Posted May 1, 2021 Share Posted May 1, 2021 I'm trying to disable a slice of navmesh under certain conditions so that NPCs path in a specific way.Tried linking it to a lever and a gate, but that didn't seem to work.Tried linking it to a "PC OnEnter/Exit" trigger box, couldn't get that working either.Any help would be amazing! This is the last piece in a large mod I've been working on for a few months.Thank you! Link to comment Share on other sites More sharing options...
maxarturo Posted May 1, 2021 Share Posted May 1, 2021 I think your actual issue is not the enable/disable of the NavCut (if the script you are using is correct), but as i've discovered, in order for the collision NavCut to work correctly it must have a specific size and placement. The collision box must be at least 1 meter above the floor and 1 meter bellow it and it has to cover all the lenght of the NavMesh (not the whole NavMesh but only the specific section). Quite some time ago i was trying to cut the path to some rabbits and chickens which could only be accessible after certain condition (it was for a piece of a house construction), but the stupid animals kept spawning in the NavCuted area, after i did what i mentioned above no actors could pass that specific part until the NavCut was disabled. Have a happy modding. Link to comment Share on other sites More sharing options...
WarbirdShaman Posted May 1, 2021 Author Share Posted May 1, 2021 Thanks for the reply!I am such a scripting noob, if it's a script that I need to do this, then that's where I'm falling short as I don't have one.I was attempting to get it done just by linked refs and fiddling with enable parents which isn't working for me.I don't suppose you have a script template for this sort of thing at hand do you? Link to comment Share on other sites More sharing options...
maxarturo Posted May 1, 2021 Share Posted May 1, 2021 (edited) It's quite easy. Here you have one example that when you activate for example, a lever, it will disable and then enable the REF, according to the initial state that the reference is.Example: ObjectReference Property Object01 Auto Event OnActivate(ObjectReference akActionRef) If (Object01.IsEnabled()) ; If the object is ENABLED then DISABLED it Object01.disable() Else ; Else = means that the object is not ENABLED so ENABLED it Object01.enable() EndIf EndEvent Good night, i'm hitting the bed... Edited May 1, 2021 by maxarturo Link to comment Share on other sites More sharing options...
WarbirdShaman Posted May 1, 2021 Author Share Posted May 1, 2021 Hey just before I gave this script a shot I tried once more and actually managed to get the Navcut box working with the trigger box, resulting in a certain corridor NOT being walked by NPCs when the PC is in a certain area, and allowing it to be pathed when the PC is somewhere else.No idea what happened there. But I'll save your script in my resource folder so I'm sure it'll still end up helping me somewhere down the road. Thank you again! Link to comment Share on other sites More sharing options...
Recommended Posts