Jump to content

Could someone write a simple ondeath script for me


WOTmodsproductions

Recommended Posts

Could someone please write me a script (I really cant get my head around the scripting)

 

I wanted it to activate ondeath of an npc with the code:

 

000Adventurer13

 

on their death I wanted another NPC called:

000Adventurer25

 

to be placed at an Xmarker (with placeatme command) with the ref:

XSP1

 

 

thanks

All credit will be given

 

This is what I tried but it saves and succeeds just nothing happens on death of the npc

 

Scriptname SIMAVventdeath13

{Scriptname SIMAVventdeath13

 

Event OnDeath 000Adventurer13test

 

XSP1. placeatme 000Adventurer25 1

 

 

end}

Edited by thelonewarrior
Link to comment
Share on other sites

This script will need to be added to the actor 000Adventurer13.

 

You'll need to add two properties, Click properties > add new property. Select Actor as the Type for the first one and name it 000Adventurer25 then OK. It may automatically fill in the value but if it doesn't you need to set the value, this will be fairly straight forward.

 

For the next property, Select ObjectReference as the Type and name it XSP1. If the value doesn't fill in repeat what you did for the first using ObjectReference instead of Actor.

 

Scriptname SIMAVventdeath13 Extends Actor

Event OnDeath(Actor akKiller)
    XSP1.PlaceAtMe(000Adventurer25,1)
endEvent

 

If you have any problems you might try uploading your ESP or a screenshot to make it easier to see what's going on.

Link to comment
Share on other sites

I tried that and it says it cant compile the script then when I make an objectreference it says this:

 

 

Starting 1 compile threads for 1 files...

Compiling "SIMTEST2"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SIMTEST2.psc(4,14): no viable alternative at input 'Actor'

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SIMTEST2.psc(4,20): mismatched input '000' expecting RPAREN

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SIMTEST2.psc(0,0): error while attempting to read script SIMTEST2: Object reference not set to an instance of an object.

No output generated for SIMTEST2, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on SIMTEST2

 

 

I renamed the script SIMTEST2 by the way as it didnt work with the first script, it also does the same when I try and make an actor as the property

Link to comment
Share on other sites

OK, Variables can't to be able to start with numbers so take the 000 off the front of those.

 

Also it should be ActorBase for the property not actor.

 

For the actor you want to spawn:

  1. Click Add Property
  2. Type: ActorBase
  3. Name: Anything that doesn't start with a number
  4. Click OK
  5. Click Edit Value
  6. Find the actor you want to spawn

 

For the place you want to spawn it at:

  1. Click Add Property
  2. Type: ObjectReference
  3. Name: XSP1
  4. Click OK
  5. Click Edit Value
  6. if you have it in the render window just do the "Pick from Window" thing else
  7. otherwise either select the cell it's in or just do "ANY"
  8. find the marker

 

The script should end up something like this:

Scriptname ocyondeath extends Actor  

ActorBase Property E3Soldier  Auto  

ObjectReference Property XSP1  Auto  

Event OnDeath(Actor akKiller)
    XSP1.PlaceAtMe(E3Soldier  ,1)
endEvent

Edited by Ocyris
Link to comment
Share on other sites

  • Recently Browsing   0 members

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