Jump to content

Trying to understand papyrus


chuckmccaw

Recommended Posts

So, scripting is completely new to me, frustrated at it always failing and once i thought i finally got it i got some new error

Heres the script:

Scriptname WalkingDeadInfection extends ObjectReference

 

Faction Property FactionAdding Auto

Race Property SetRace Auto

Spell property reanimateSpell Auto

 

Event OnDeath(Actor akActor)

Utility.Wait(5)

Actor.SetRace(SetRace)

Actor.AddToFaction(FactionAdding)

EndEvent

 

 

The Errors:

Starting 1 compile threads for 1 files...

Compiling "WalkingDeadInfection"...

cannot call the member function SetRace alone or on a type, must call it on a variable

cannot call the member function AddToFaction alone or on a type, must call it on a variable

No output generated for WalkingDeadInfection, compilation failed.

 

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

Failed on WalkingDeadInfection

Link to comment
Share on other sites

Scriptname WalkingDeadInfection extends ActiveMagicEffect

Faction Property ZombieFaction Auto
Race Property ZombieRace Auto

Event OnEffectFinish(Actor akTarget, Actor akCaster)
If (akTarget.IsDead() == 1)
	Utility.Wait(5)
	akTarget.SetRace(ZombieRace)
	akTarget.AddToFaction(ZombieFaction)	
Endif
EndEvent

Link to comment
Share on other sites

Good catch Steve

 

Scriptname WalkingDeadInfection extends ActiveMagicEffect

Faction Property ZombieFaction Auto
Race Property ZombieRace Auto

Event OnEffectFinish(Actor akTarget, Actor akCaster)
If (akTarget.IsDead() == 1)
	Utility.Wait(5)
	akTarget.Resurrect()
	akTarget.SetRace(ZombieRace)
	akTarget.AddToFaction(ZombieFaction)	
Endif
EndEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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