Hello,
I am trying to have a shooting star fly across the sky in the game, so I created a view animation (vStar) and then assigned it to an object:
function room_FirstLoad()
{
Object[0].setview(vStar);
Object[vStar].Animate(1,1);
}
But I get the error message “fixed size array cannot be used in this wayâ€
What am I doing wrong?
Thank you
Why do you use Object[vStar].Animate(1,1)?
As you've already assigned the view to the object, just animate object #0:
Object[0].Animate(1,1);
I tried that also, but I get the same result
View names have to be used in all caps. VSTAR.
function room_FirstLoad()
{
object[0].SetView(VSTAR); // AGS code is case sentive, and setview is not the same as SetView
object[0].Animate(1,1);
}
Note that, when you are in the room, you can call the object by it's name. So you could have it this way (assuming your object is called oStar:
function room_FirstLoad()
{
oStar.SetView(VSTAR);
oStar.Animate(1,1);
}
EDIT: changed Object[0] to object[0] as Khris mentioned bellow. (I didn't caught that one. :-[ )
You can assign a name to the object and use that: oStar (only in a room script)
Or you can use its ID and the global array: object[0]
Note the lowercase name.