Ok,
I have a problem I am making a Star Trek game and I am attempting to create a Scene where Kirk, Spock, McCoy beam down to a planet
Fairly basic Trek scene that will be used though out the game.
I have all my beaming down sprites cycles and have scripted it in so that kirk beams down no problem even have the sound playing and its all timed just right.
My problem lays in when I add spock to it what happens is spock appears on screen in his normal standing view waits for kirk to go though the beam down cycle and then spock goes into beam down cycle after kirk has. I need them to both do it at the same time
here is what I scripted and I am sure I left a lot of things out I am totaly new to scripting and figuring most of this out as I go.
function room_AfterFadeIn()
{
PlaySound(1);
ckirk.LockView(VKIRKBEAM1);
ckirk.Animate(0, 5, eOnce);
cSpock.LockView(VSPOCKBEAM1);
cSpock.Animate(0, 5, eOnce);
}
I will need to script this so I can have multiple people going though the beam down cycle at the same time I am sure it is simple just do not know what to add.
thank you.
Make sure you set animate to non-blocking, otherwise the script will always wait until the first animation is finished:
ckirk.Animate(0, 5, eOnce, eNoBlock);
should do the trick.
Works perfectly except one problem kirk instantly start beaming down like he should but spock for a moment appears in his stranding mode then goes though beam cycle its only for a split sec other then that the script works just as I want it too.
Try locking both views first, add a Wait(1) and then start the animation, that should work.
function room_AfterFadeIn()
{
PlaySound(1);
ckirk.LockView(VKIRKBEAM1);
cSpock.LockView(VSPOCKBEAM1);
Wait(1);
ckirk.Animate(0, 5, eOnce, eNoBlock);
cSpock.Animate(0, 5, eOnce, eNoBlock);
}
That didn't work I changed his normal view to transporter view and that did the trick guess i Just need to change the view back after he means down.
Thanks very much for the help and the quick replies
An alternate way of doing this (and the way I did it in a game I made years ago), is to have another character stand 1 pixel in front of each of the characters, and use the same transporter effect for all of them, essentially superimposing the effect on all characters. It saves on sprites and views/loops, and you can even alter Kirk and Spock's transparency to make it even better.
Ok fixed it this is what I had to do
//Introduction room script
function room_AfterFadeIn()
{
mouse.Visible = false; //turns mouse off
RemoveWalkableArea (1); //keeps player from moving
PlayMusic(1); //play star trek theme
SetBackgroundFrame(0); //switch to title screen 1
Wait(600); //wait for a moment
SetBackgroundFrame(1); //switch to title screen 2
Wait(350); //wait for a moment
SetBackgroundFrame(2); //switch to title screen 3
Wait(1000); //wait for a moment
StopMusic (); //stop the music
mouse.Visible = true; //Restores Mouse usage
player.Transparency=(0); //make character visable
PlaySound(1); //play transporter sound
ckirk.LockView(VKIRKBEAM1); //sets kirks transporter sprite view
cSpock.LockView(VSPOCKBEAM1); //sets spocks transporter sprite view
ckirk.Animate(0, 5, eOnce,eNoBlock); // show kirks transporter beaming in effect under title
cSpock.Animate(0, 5, eOnce, eBlock);//Blocks the script till everyone has beamed onto screen
ckirk.LockView(VKIRKWALK); //Locks kirks view so he is frozen on screen
}