Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //A pointer to the actor generated by the player when they perform actions like jumping,
- //so that actor can be made into the dwellers' target, so they initially chase that last heard location instead of the player directly.
- Actor LastHeardLocation;
- Private Void A_AlertDwellers (Double AlertRadius = 600.0)
- {
- BlockThingsIterator FindDwellers = BlockThingsIterator.Create (Self,AlertRadius);
- Actor FoundActor;
- While (FindDwellers.Next()) //Iterate through the nearby actors.
- {
- FoundActor = FindDwellers.Thing;
- If (FoundActor && FoundActor is "NPC_Dweller" && NPC_Dweller(FoundActor).ActualTarget) //If a found actor is a dweller.
- {
- If (LastHeardLocation) {LastHeardLocation.Destroy();} //Delete that last heard location if a new one is to be spawned.
- LastHeardLocation = Spawn ("LastHeardPlayerLocation",Self.Pos);
- FoundActor.Target = LastHeardLocation; //And make that point the player was last heard in the dwellers' target.
- NPC_Dweller(FoundActor).ActualTarget = Self; //And keep a pointer to the player themselves as well, so the dweller can check if they are around.
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement