Jump to content

Quick question regarding scripts


elseagoat

Recommended Posts

I am trying to wrap my head around payrus, and I am having trouble.

 

My question pertains to the different types of scripts, for example, extends activemagiceffect or extends actor.

 

When I go to the wiki here: http://www.creationkit.com/ActiveMagicEffect_Script

 

I see a list of functions and events. Are these the ONLY functions and events that I can use? (It does say that I can use actor events from the target actor of the magic effect the script is attached to.)

 

 

 

 

Questions:

 

Does that mean that I cannot use functions such as placeAtMe because it is listed in the ObjectReference script page on the wiki, and not in the Actor or ActiveMagicEffect pages? That would be a giant pain in the ass if so, because that would make it ten times harder to script a simple magic effect that creates an actor at the target's location.

 

Does this mean that I can use

Event OnDeath(Actor akKiller)

in an ActiveMagicEffect script even though it is listed not on the ActiveMagicEffect page but is listed on the Actor page?

Edited by elseagoat
Link to comment
Share on other sites

The functions are tied to the calling variables, not script types. In other words, the functions you can see there are the ones that you can run on an ActiveMagicEffect, and the events are the ones you can run in an ActiveMagicEffect script. If you say 'MyActor.kill()', it will still work (if you're doing this in an OnEffectStart Event, you could use akTarget for that purpose), because the variable in question is (presumably) an Actor. If you just say 'kill()' in an ActiveMagicEffect script it won't work, because it'll assume you want to kill the ActiveMagicEffect itself and that would be silly. :P

 

It also means, yes, that PlaceAtMe can only be run on ObjectReference variables and not Actor variables. You can get around this by either casting the Actor variable as an ObjectReference (that is, if I have this right, 'MyObject = MyActor as ObjectReference'. I only ever tried it once) or use the PlaceActorAtMe function instead.

 

As for using an OnDeath event in an ActiveMagicEffect script, don't take my word for it because I'm a bit of a newbie too and have never tried, but I don't think it would work. Back in Oblivion I would use OnEffectFinish (effects end when their subject dies) and check if the subject is dead inside.

 

EDIT: Oh, yeah: A warning about PlaceAtMe. Most of the stuff in Skyrim is stored in the .esp and .esm files, but you can't do this when using PlaceAtMe to create new objects in-game. Instead, they get stored in the save file, and that adds up. As the save gets bigger, it starts causing bugs and making the game load more slowly, so using PlaceAtMe a potentially indefinite number of times is frowned upon if you don't use the Delete function to clean the objects up when you're done with them.

Edited by LoginToDownload
Link to comment
Share on other sites

  • Recently Browsing   0 members

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