What the heck is wrong with "Event" anyway?

Post » Sun Dec 08, 2013 7:18 pm

I'll get right down to it:

Scriptname MyScript extends GameEvent ThisIsTotalCrap()    ;Do SomethingEndEvent

This compiles without a single complaint even though it's patently obvious the Game.psc script has nothing associated with this.

Why did this even come up, you might ask? The http://www.creationkit.com/OnReset_-_ObjectReference page has some information that is contradictory - saying in one line that Quests and Aliases receive this event - while on the very next, claiming they don't.

After checking Quest.psc and Alias.psc, sure enough, OnReset() is not listed as a valid event there. Only in ObjectReference.psc.

Am I missing something here? How is the compiler not realizing these aren't valid events? Especially the obviously bogus one I just wrote.

In any case, that wiki page needs updating but I didn't want to do so before this got sorted out.

User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Sun Dec 08, 2013 6:54 am

An event is just like a function. You can define your own and call them. There is no rule that says these events must match anything on the native side.

( :ninja:?)
User avatar
Michelle Smith
 
Posts: 3417
Joined: Wed Nov 15, 2006 2:03 am

Post » Sun Dec 08, 2013 9:33 pm

I don't think the compiler checks to see if events are defined in the parent. If they did, then many events used in ReferenceAlias scripts and ActiveMagicEffects will not compile. Also OnInit() isn't defined in any script (which is why it must be defined in the empty state if you use this event in a State).

No idea what OnReset() does though for quests, if anything. If you use OnReset() in an ReferenceAlias, I would assume that it is triggered by the ObjectReference OnReset() event.

It seems like someone made a mistake?

User avatar
aisha jamil
 
Posts: 3436
Joined: Sun Jul 02, 2006 11:54 am


Return to V - Skyrim