Ok! Here's my problem...when my character reads a spell in a book an object starts animating...no problems there...but when that smokeanimation reaches frame 3 i want the character to disappear. I looked through the forum but couldn't find an appropriate answer. This doesn't quite work
Here's when the animation starts...could someone please help? :)
object[3].Visible = true;
object[3].SetView(5, 3);
object[3].Animate(3, 2);
if (object[3].Frame!=2) {
"Character disapperars"
Quote from: Mouth for war on Wed 25/02/2009 21:06:29
object[3].Visible = true;
object[3].SetView(5, 3);
object[3].Animate(3, 2);
if (object[3].Frame!=2) {
"Character disapperars"
Why do write "Frame!=2" instead of "Frame==3" ? In this case he would disappear right at the beginning of the animation, doesn't he?
i tried to type frame = 3 too but nothing happens until the animation is finished...and i want it to happen on frame 3 as i said
it has to be "frame==3". note the two equels.
You have to write object[3].Animate(3, 2, eNoBlock);
..because eBlock is the default and thus the script will be stopped until the animation is finished.
This is what it says now...it's another thing...i want it to play a sound instead when the animation plays frame 10 but it doesn't work
// room script file
function room_AfterFadeIn()
{
Wait (50);
object[0].Visible = true;
object[0].SetView(5, 3);
object[0].Animate(3, 0, 1, eNoBlock);
if (object[0].Frame!==10) { (Parse error in expr near object)
PlaySound (3);}
object[0].Visible = false;
cEgo.Transparency = 0;
}
You wrote !== instead of just ==.
function room_AfterFadeIn()
{
Wait (50);
object[0].Visible = true;
object[0].SetView(5, 4);
object[0].Animate(4, 2, 1, eNoBlock);
if (object[0].Frame==10) {
PlaySound (3);}
object[0].Visible = false;
cEgo.Transparency = 0;
}
Now the animation don't even play :( just skips to everything after that
AGS doesn't wait, every command is executed right away.
function room_AfterFadeIn()
{
Wait (50);
object[0].Visible = true;
object[0].SetView(5, 4);
object[0].Animate(4, 2, 1, eNoBlock);
}
bool done;
// create this function using the room's event pane
function Room_RepExec() {
if (!done && object[0].Frame==10) {
PlaySound (3);
object[0].Visible = false;
cEgo.Transparency = 0;
done = true;
}
}
function room_RepExec()
{
if (!done && object[0].Frame==10) {
PlaySound (3);
object[0].Visible = false;
cEgo.Transparency = 0;
done = true;
}
Error line 13 "undefined symbol done" I'm quite new to this scripting stuff as you can tell :)
You have to declare variables. In this case "bool done;" like KhrisMUC wrote.
ah missed that...thanks :D works now