Leurnid wrote...
*does a double take*
GetLocalObject is freaking me out... the beginning and the end of that I get, but the GetLocalObject... can you store an object in an object!?!?
Sure you can -- except that strictly speaking, you're not storing "an object in an object" with this. You're storing and getting a
handle to an object, which is what all the "Get Object" functions give you. Objects exist globally in the game's object data structures, which is why you have to search for them with
GetObjectByTag, etc. But object handles are relatively stable, so you can store one on another object for easy retrieval later from that object. I say "relatively" because you have to be careful; object handles can change or go away, say, if a creature is destroyed (which includes what happens to a horse when you mount it).
Leurnid wrote...
Retrieving a string from a local var, no problem
making said string be recognized as a constant for an effect... not happening.
That'll never work, because the constant name is just a label to refer the compiler to it's associated constant int value. It's not saved in the .ncs file and not available at runtime.
I was thinking I could just store the int value of the constant as a local var, and plug that in, skipping the constant. That should be much simpler. I am not able to verify this until later, but before I get that far, is this a good way to go about this?
*The goal is a reusable script on a switch or trigger that can turn on as many lights as I set, all with different colors and radii to be assigned when the light objects are placed. I would rather drive complexity out of the switch script and keep the light information localized to the objects, if at all possible.
That's how I've done it when I've scripted similar things. You should be able to look up the int values for the constants in the Lexicon for easy reference.
Modifié par AndarianTD, 10 mai 2012 - 11:33 .