TheCutSnake Posted November 24, 2017 Author Share Posted November 24, 2017 Scriptname SDPAInterfaceScript extends Quest Keyword Property FurnitureTypePowerArmor Auto Quest Property SDPAInterfaceQuest Auto Function SDPAPowerArmorSearch() ;Check for nearby power armors ObjectReference[] nearbyPowerArmors = Game.GetPlayer().FindAllReferencesWithKeyword(FurnitureTypePowerArmor, 100) debug.trace( "Found " + nearbyPowerArmors.Length + " nearby unoccupied power armors" ) If nearbyPowerArmors.Length > 0 ObjectReference nearestPowerArmor float fnearestDistance = 9999.0 int i = 0 while (i < nearbyPowerArmors.Length) float fcurrentDistance = Game.GetPlayer().GetDistance(nearbyPowerArmors[i]) if( fcurrentDistance < fnearestDistance ) nearestPowerArmor = nearbyPowerArmors[i] fnearestDistance = fcurrentDistance endIf i = i + 1 endWhile Endif If (nearbyPowerArmors == none) SDPAInterfaceQuest.setstage (10) Else SDPAInterfaceQuest.setstage (20) endif EndFunction Ahh. There you go. It works and I'm happy. Link to comment Share on other sites More sharing options...
Recommended Posts