Jump to content

Lushia182

Premium Member
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Lushia182

  1. Hey Guys,

    I'm just playing around with some ideas for tracking Distance between objects in Skyrim to trigger a function such as spawning an Enemy Actor.

    Normally I would just use a trigger box, but I'm trying to make the event trigger whenever the Player is anywhere near the object regardless of player angle to that object.

     

    Here's an example of what I was attempting:

    Scriptname _TestNPCSpawnOnProximity extends ObjectReference  
    {Spawn an NPC of the appropriate type when Proximity distance trigger is met.}
    
    Actor Property Player Auto
    
    Event OnInit()
    	;Test Script is running
    	Debug.MessageBox("SpawnOnProximity Script Is Running...")
    	;Assigning the Player
    	Player = Game.GetPlayer()
    	; Register Script for Proximity Tracking to Base Object
    	ScriptObject.RegisterForDistanceLessThanEvent(Player, self, 25.0)
    EndEvent
    
    Event OnDistanceLessThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance)
    	Debug.MessageBox("Player is now " + afDistance + " units away from " + self)
    EndEvent
    
    

    When running the above I get the error:

     

    - RegisterForDistanceLessThanEvent is not a function or does not exist

    After some research It seems like this perfect event function i needed doesn't exist for Skyrim but only Fallout 4.

    Is there an equivalent event for Skyrim that can do something similar to the above, and still can consistently run checks until distance to that object has been met?

     

    Thanks ^^

     

×
×
  • Create New...