Jump to content

[LE] Load dors event tracking


Recommended Posts

Hello everyone Sorry for my bad english.

 

I have a dummy quest which reequip armor on player via script (on player alias) after every loadscreen in the game (save load, loaddor etc)

 

How to intercept an event when a player goes through the load door?

 

OnLocationChange event is not enougth for this. For example Whiterun city gates: the location change event does not occur when the player passes through the gate (load dor) to the city or leaves it. But autosave on location chsnge works even at that case.

Link to comment
Share on other sites

I'm not sure if i understand exactly what you're saying, but if i do, then this is what you need :

OnCellAttach()

OnCellDetach()


And there is also a Papyrus Extender by "Powerofthree's Papyrus Extender".

bool function IsLoadDoor(ObjectReference thisDoor) global native


Edited by maxarturo
Link to comment
Share on other sites

 

I'm not sure if i understand exactly what you're saying, but if i do, then this is what you need :
OnCellAttach()
OnCellDetach()
And there is also a Papyrus Extender by "Powerofthree's Papyrus Extender".
bool function IsLoadDoor(ObjectReference thisDoor) global native

 

OnCellAttach()
OnCellDetach()
Thank you for your reply, but these events are for ObjectReference, not for Actor. I need to intercept the event when the player has passed through the loading door. Any load door in the game.
Link to comment
Share on other sites

The fact that they are ObjectReference doesn't mean that they can't be used by Actor script, for example in one of my script i have :

Scriptname WerewolfChanger extends Actor


EVENT OnCombatStateChanged()


EVENT OnEnterBleedout()


EVENT OnDeath()


EVENT OnHit()


EVENT OnUpdate()


EVENT OnCellAttach()


EVENT OnCellDetach()


* It all comes down to what and how you will make your script.


* ObjectReference events can be use by Actors, ActorReference events can not be use by Objects.

Edited by maxarturo
Link to comment
Share on other sites

Nah, OnLocationChange is poor for this sort of thing, since there can be several cells owned by one location.



 

I'm not sure if i understand exactly what you're saying, but if i do, then this is what you need :
OnCellAttach()
OnCellDetach()
And there is also a Papyrus Extender by "Powerofthree's Papyrus Extender".
bool function IsLoadDoor(ObjectReference thisDoor) global native

 

Those two events need to be attached to an object, or an actor(but obviously not on the player) in order to listen for the player. This works best with interiors imo, but in exteriors, these events will fire whenever the cell becomes part of the loaded cell grid around the player(hence oncellattach), which is 5x5 by default.

 

 

You can try this: https://www.creationkit.com/index.php?title=IsPlayerMovingIntoNewSpace

Edited by Rasikko
Link to comment
Share on other sites

 

 

I'm not sure if i understand exactly what you're saying, but if i do, then this is what you need :
OnCellAttach()
OnCellDetach()
And there is also a Papyrus Extender by "Powerofthree's Papyrus Extender".
bool function IsLoadDoor(ObjectReference thisDoor) global native

 

Those two events need to be attached to an object in order to listen for the player. This works best with interiors imo, but in exteriors, these events will fire whenever the cell becomes part of the loaded cell grid around the player(hence oncellattach), which is 5x5 by default.

 

Yeap, didn't thought of that, stupid mistake on my part !. "these events will fire whenever the cell becomes part of the loaded cell grid around the player(hence oncellattach)"

But the "IsLoadDoor" can be use somehow.

Edited by maxarturo
Link to comment
Share on other sites

To solve the above problem, if you store a reference to the previous location you can check whether the cell attach/detach was accompanied by a location change. You can also check whether the previous cell was interior or exterior.

Link to comment
Share on other sites

This is how you can catch when the player is activating a load door:

1. Create a new perk, make it hidden and non-playable.

2. Add a perk entry of type entry point 'Activate' like in the picture below



3. Add the follwing script code to the perk entry. You will need powerofthree's papyrus extender to distinguish between load doors and other doors, like maxarturo suggested (see his post for the link)

Script code for perk entry:

if PO3_SKSEFunctions.IsLoadDoor(akTargetRef)
debug.messagebox("Load Door activated")
; do stuff here
endif


4. Finally, you'll need to find a way to add the perk to player. This can be done with a quest that starts game enabled and a little script attached to the quest. Example:

Scriptname _TestScript extends Quest 

Perk Property _TestPerk auto

Event OnInit()
	game.GetPlayer().AddPerk(_TestPerk)
EndEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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