assigning views to objects

Started by markcull, Tue 09/09/2003 20:55:32

Previous topic - Next topic

markcull

I'm trying to animate a simple object (just two frames, mind) . The game though crashes as it says I haven't set the view for the object i want animated. The only thing I must do is set the view for the object- is there any way to do this without using manual scripting? and if that is the only way to do it, can you tell me exactly (exactly!) where the script must go in the script editor?

Thanks

Timosity

#1
This is what you will need to do.

SetObjectView(int object, int view)

eg. SetObjectView(0, 5) // where 0 is the room object number and 5 is the view number.

then

AnimateObject(int object, int loop, int speed, int repeat) //the explanations are in the manual.

now where to put it in your script totally depends on what the animation is for.

eg. if you want the animation to repeat continually in the room, put something like this in, before fadein - run script:

SetObjectView(0, 5);
AnimateObject(0,0,5,1);

by the way, I think you need to have at least 3 frames for the animation to work.

if you want it to animate when you click on a hotspot, go to the particular hotspot in the editor, click on interaction, then choose which interaction (eg. interact, look etc) then choose run script, then put something like:

SetObjectView(0, 5);
AnimateObject(0,0,5,0);
while (IsObjectAnimating(0)==1) Wait(1); //waits for the animation to finish.


Also for the above one, you can do the same if you choose interact for an object, or character etc.

There's many other places to put animations in the script, it just depends how you want to trigger it.

This will help, just experiment with it a bit and I'm sure you can work it out. If you need more help, make sure you're more specific in your description.

~Tim

SMF spam blocked by CleanTalk