ClearObjectVisualTransformation Question
nwfan87
Member Posts: 100
Very quick one. What is the best way to delay ClearObjectVisualTransformation, on the assumption that SetObjectVisualTransformation has already been executed? It seems it will not take a DelayCommand prompt.
Thank you!
Thank you!
0
Comments
It should work with DelayCommand.
If for some reason it doesn't, try putting it in a function, then delay execution of the function.
Here's the line, which I think follows the info on Lexicon
DelayCommand(4.0, ClearObjectVisualTransform(oCreature, -1));
int ClearObjectVisualTransform(object oObject, int nScope = -1);
The function returns an int. So it can't be used directly in DelayCommand(). You need to wrap it in a little void function (which is what @Proleric suggested in his last line there...).
int iNumber = ??? (some sort of function to grab the visual transformation?), not sure on what it means when it asks for nScope, but then how to put that into a DelayCommand?
Do you mean something like
DelayCommand(3.0, ClearObjectVisualTransformation(oCreature, OBJECT_VISUAL_TRANSFORATION...));
Then
The function does nothing except trick the compiler into accepting the void argument it's expecting.
You can also delay a script that executes the entire ClearObjectVisualTransform command, but that's an unnecessary complication in this simple case.
Couldn't get your version to compile, so used a structure similar to the Lexicon, but no luck there either. I'm trying some other method now, hoping that I'll come up with something that is in my capabilities as an average joe script sticker together-er. But I'll persist on trying who knows, I might strike the nail one day!
One reason you might have run into problems with ClearObjectVisualTransform is that it's asking specifically for one of the "OBJECT_VISUAL_TRANSFORM_DATA_SCOPE_........" for the second parameter.
The reason you couldn't get it to work is right there in the first line of your code. The function must return a VOID type, not an INT type, which means that the return must be empty. Just "return;" and nothing else.