Making non-auto Properties properly?

Post » Thu Jun 21, 2012 5:17 pm

So, i have a mod with a crapton of books using the same script. I want to add a property to the script but I don't want to create an auto property that needs to be filled on every single book by me. It's an esm with slave esps that have the books.

Can I get away with this? It's been working for me but people have reported problems that ought to be related.

EffectShader property lorecraftBOOKGlowFXS		EffectShader Function Get()				return  Game.GetForm(0x02022f5e) as EffectShader		EndFunctionEndProperty


If this is bad, why is it and do I have other options?
User avatar
Ally Chimienti
 
Posts: 3409
Joined: Fri Jan 19, 2007 6:53 am

Post » Thu Jun 21, 2012 1:43 pm

I am not completly sure about that, but I think that the getformID returned depends of the mod load order. Vanilla ID are always correct (0x01xxxxxx), since it's always loaded at first, but not yours.
This function also probably should be used for debug purposes only anyway
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am

Post » Thu Jun 21, 2012 3:09 pm

McGuffin is right. If your mod isn't the third one in the load order, your property won't work the way it is right now.
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Thu Jun 21, 2012 5:33 pm

So mindless clicking it is, I suppose. Any alternatives?

Thanks for the input!
User avatar
Samantha Mitchell
 
Posts: 3459
Joined: Mon Nov 13, 2006 8:33 pm

Post » Thu Jun 21, 2012 2:02 pm

You may try cutting the first two digits from the book and attaching to the 6 last digits of the shader. Something like this.

return Game.GetForm((((((self as string) as float)/(0X1000000)) as int) as float) + (0x00022f5e)) as EffectShader

Anyway, I'm not sure about the part where the string is converted to a float, as the string will show a exadecimal number and the float may take only decimal numbers. If so, it will be really complicated.

If I were you would fix things in the CK. You may have a few hundreds of books at worst. At least this way you will be sure you will be able to do it and you will know how much it will last.
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am


Return to V - Skyrim

cron