Scripting a death marker

Post » Sat Nov 22, 2014 6:53 am

Is it possible to make it so that while the PC is in a certain cell, if they die, rather than reloading it'll place them at a marker? It's supposed to be sort of a dream area, and so it'd be preferable if they restarted at the marker when they died rather than loading a save. It might be hardcoded though, so I'm not sure.

User avatar
CRuzIta LUVz grlz
 
Posts: 3388
Joined: Fri Aug 24, 2007 11:44 am

Post » Sat Nov 22, 2014 7:33 am

Simple OnDeath() Event on the NPC's ObjRef and then...

Static Property MyDeathMarker AutoEvent OnDeath(Actor akKiller)      self.MoveTo(MyDeathMarker)EndEvent

If you happen to have placed the actor via leveled list, then you'd need to move the leveled marker (spawner).

User avatar
JERMAINE VIDAURRI
 
Posts: 3382
Joined: Tue Dec 04, 2007 9:06 am

Post » Sat Nov 22, 2014 3:15 am

This will work on the player? And wouldn't OnDying be better? Won't you have to restore their health and such?

User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Sat Nov 22, 2014 11:32 am

I could definitely be wrong, but I don't think that will work on the player. If you make the PC essential (through an alias, most likely) this may get you most of the way there:

ScriptName PlayerRespawn Extends ReferenceAliasActor Property PlayerRef Auto                      ;player referenceObjectReference Property RespawnMarker Auto        ;player respawn markerEvent OnEnterBleedout()    PlayerRef.MoveTo(RespawnMarker)EndEvent

I think you'd also have to end the bleedout quickly either by changing a bleedout recovery time variable or doing something similar in the script (possibly cancelling the animation, healing or the like). I don't remember if you can change the bleedout time in the alias/actor settings or if you'd have to change a GMST variable, which may not be ideal.

User avatar
Sarah Kim
 
Posts: 3407
Joined: Tue Aug 29, 2006 2:24 pm


Return to V - Skyrim