OBSE 18 SetScript

Post » Sun May 29, 2011 1:27 am

Alright, I want to use the OnHit and OnMagicEffectHit blocks on the Player. I figured out how to set an Object script to the Player itself. I do check for there being a script and there is not one before I apply this script. The question is: Is SetScript ready to be used? I am absolutely baffled of how to use those blocks on the player otherwise.
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Sun May 29, 2011 1:33 am

Attaching scripts to the player is considered bad form since only one mod can be allowed to do so.
SetScript is still officially considered beta until 0019 is released, though assuming there's no script already attached to the player when you call it you should have no problems.
However with 0019 you'll be able to register a function script to handle the OnHit/OnMagicEffectHit events without having to attach a script to the player so that will probably be a better option, at least for compatibility's sake.
User avatar
Dean Brown
 
Posts: 3472
Joined: Fri Aug 31, 2007 10:17 pm

Post » Sat May 28, 2011 11:48 am

However with 0019 you'll be able to register a function script to handle the OnHit/OnMagicEffectHit events without having to attach a script to the player so that will probably be a better option, at least for compatibility's sake.


:o
This sounds awsome. :goodjob:


If I wouldn't already love OBSE that's just another reason to immediately start doing so. :)
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Sat May 28, 2011 4:16 pm

Attaching scripts to the player is considered bad form since only one mod can be allowed to do so.
SetScript is still officially considered beta until 0019 is released, though assuming there's no script already attached to the player when you call it you should have no problems.
However with 0019 you'll be able to register a function script to handle the OnHit/OnMagicEffectHit events without having to attach a script to the player so that will probably be a better option, at least for compatibility's sake.

Oh, I see why. I always wondered what the deal was with that being not kosher.

I guess using setscript until 0019 comes out is the only way I am going to get OnHit/OnMagicEffectHit for now. Is that a planned feature? Is it kosher to let people know there may be an issue with other mods that may use setscript on the player? Then update for 0019? It is a feature I really want for tracking things that affect the player. I guess what I can do is check for an existing script and if there is one don't do use that functionality. Maybe a big warning that says, "Another mod is setting a script on the player. You are going to lose gameplay features from this mod."

Anyway, sounds really cool with the handler.

Another way this could be handled though is this:
1. setscript a function that allows OBSE Functions to be added to an array that is called from OnHit/OnMagicEffectHit2. each mod adds their Function to the list of called functions


Yes, this would have to be coordinated between mods for compatibility, but COBL would be the place to do this, right?

BTW, calling OBSE Functions by reference is such a great feature. I use it for a ton of different cool things. I used it to build a parser that can be extended by other mods. Keep up the great work!
User avatar
Lizzie
 
Posts: 3476
Joined: Sun Nov 19, 2006 5:51 am


Return to IV - Oblivion