Jump to content

help with papyrus script how ?


Recommended Posts

Posted

The player does not have a current mount. The closest that the game tracks is the last horse ridden, and there is no simple way to attach a notification to that. The only mount that is current is the one the player is actually riding, and no notification is needed for that.

 

A quest that provides the player with a mount could use an alias to attach a script to the mount, but that would have to be done as a modification to all such quests, base game and mods alike.

 

Checking if the last ridden horse is dead is easy enough, but knowing you need to ask is the hard part.

Posted

How about a quest, with an actor alias. Assign the horse to that alias. Give the alias a script and listen for the OnDeath event. The quest can then track whether or not the horse is alive, and can be queried externally if needed.

Posted
On 5/15/2024 at 3:03 AM, ghastley said:

The player does not have a current mount. The closest that the game tracks is the last horse ridden, and there is no simple way to attach a notification to that. The only mount that is current is the one the player is actually riding, and no notification is needed for that.

 

A quest that provides the player with a mount could use an alias to attach a script to the mount, but that would have to be done as a modification to all such quests, base game and mods alike.

 

Checking if the last ridden horse is dead is easy enough, but knowing you need to ask is the hard part.

thx for explain!

Posted
12 hours ago, traison said:

How about a quest, with an actor alias. Assign the horse to that alias. Give the alias a script and listen for the OnDeath event. The quest can then track whether or not the horse is alive, and can be queried externally if needed.

May I ask how to implement it specifically?

Posted
4 hours ago, sosoxia said:

May I ask how to implement it specifically?

 

One script for the quest, another for the alias.

 

Have the quest script track when the player mounts a horse:

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
    If (akSource == PlayerRef && asEventName == "tailHorseMount")
        Actor horse = Game.GetPlayersLastRiddenHorse()
        
        TravelCompleted()
        
        If (PlayerOwnsHorse(horse))
            ; Mark horse as alive again, afterall, you can't mount a dead horse right?
            ; Asign horse to the "current horse" quest alias
        EndIf
    EndIf
EndEvent

 

Assign that player owned horse to the quest alias.

 

Have the alias script track when the horse dies:

Event OnDeath(Actor akKiller)
	; Mark horse as dead in the quest script
EndEvent
Posted
On 5/16/2024 at 6:21 PM, traison said:

 

One script for the quest, another for the alias.

 

Have the quest script track when the player mounts a horse:

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
    If (akSource == PlayerRef && asEventName == "tailHorseMount")
        Actor horse = Game.GetPlayersLastRiddenHorse()
        
        TravelCompleted()
        
        If (PlayerOwnsHorse(horse))
            ; Mark horse as alive again, afterall, you can't mount a dead horse right?
            ; Asign horse to the "current horse" quest alias
        EndIf
    EndIf
EndEvent

 

Assign that player owned horse to the quest alias.

 

Have the alias script track when the horse dies:

Event OnDeath(Actor akKiller)
	; Mark horse as dead in the quest script
EndEvent

Bro thx! but.. how can i use these ??? save as a psc? then transfer to Pex? idk how to use

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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