Functions in quests

Post » Sat Dec 01, 2012 8:29 am

I have a series of really tedious lines of code I want to throw together into a function for tidyness. How do I do this so it can be called from any quest-stage scripting?

(I'm a total noob to using functions in the CK, and it's been a few years since I've touched my C++ work)

Most of it will consist of just calling setscale() on a bunch of objects, either going from 0.001 or to 1 depending on when it's called (I'd feed this number to the function I'd assume).
User avatar
Kortniie Dumont
 
Posts: 3428
Joined: Wed Jan 10, 2007 7:50 pm

Post » Sat Dec 01, 2012 11:37 am

Just put the script in a quest, for example SetScaleQuest on its script tab and name it SetScaleScript. The function will be called Sizing in my example, and will accept a float Scaler and an ObjectReference Scaled.Fill all properties of course.
Now, when you need it (actually anywhere in any script it will work perfectly) you use the following syntax:
(SetScaleQuest as SetScaleScript).Sizing(0.10, PonyHorse)

This command will take the ObjectReference PonyHorse and set it to one tenth of its size regardless of where this command is used.

I think.
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am


Return to V - Skyrim