Page 2 of 2

PostPosted: Sun Sep 26, 2004 10:35 am
by ingsan
Step-by-step instructions to put a code on a Helper actor

- Create an Actor. Call it " Helper".

- Place it off screen, so that it might never be seen in your game.

- On Helper :
on DrawActor event > Script, write :

    if (shipCounter == 0)
    {
    DestroyActor("yourMainactor");
    }

on DestroyActor ( of yourMainactor ) event > CreateActor ( yourMainactor ) action. Here you tell your main actor to reappear where you want :wink:

PostPosted: Fri Oct 01, 2004 1:37 pm
by VYTIS_KNIGHT
INGSAN,

I am having a problem with all the different options that I see in the post. I have it set so when the actor gets hit and destroyed that a ship gets destroyed in the ship counter area. It also destroys the main player ship, but the ship was never created again. I tried it so when the main player ship gets hit it changes the visibility to disable and it never draws the ship again, but the actor is there because when I hit the key to fire the missile it fires. Here is what I am trying to do.

1. when player's ship is hit it disappears
2. if ships in ship area greater than 0 destroy one of the remaining ships. like the asteroid demo.
3. if ships in counter area is = 0 then loadgame("gameover.ged")

Once I have this figured out I will have no other issues except for when all aliens are dead it needs to loadgame("level2.ged").. But I am sure I can figure tha out.

"Game Editor, is there anything like it, (russian accent) I THINK NOT! (/russian accent)"

PostPosted: Sat Oct 02, 2004 4:22 am
by Just4Fun
VYTIS_KNIGHT:
Below are two previous solutions that I posted on this thread. Didn't they work for your problems: 1 & 3?

"1. when player's ship is hit it disappears"

if (shipCounter == 0) // or some other integer that you want to check
{
VisabilityState("playerShip",ENABLE); //make the player ship reappear. Use "DISABLE" to make it disappear.
}

"3. if ships in counter area is = 0 then loadgame("gameover.ged") "

shipCount=shipCount-1; //decrement the counter
ships.textNumber=shipCount; //show the number on screen text
if(ships.textNumber ==0); //once the text is equal to 0
LoadGame("GameOver.ged"); //load a file

PostPosted: Sat Oct 02, 2004 6:53 pm
by VYTIS_KNIGHT
Just4Fun,

Where do I setup the shipcount = 3 at the beggining?

Where do I put the following code on the bullet when it impacts the player or on the player?
if (shipCounter == 0) // or some other integer that you want to check
{
VisabilityState("playerShip",ENABLE); //make the player ship reappear. Use "DISABLE" to make it disappear.
}

Where do I put the following code and also I am not using a number counter I am displaying 3 small ships like the asteroid demo?
shipCount=shipCount-1; //decrement the counter
ships.textNumber=shipCount; //show the number on screen text
if(ships.textNumber ==0); //once the text is equal to 0
LoadGame("GameOver.ged"); //load a file

I need it destroy shipcount1, shipcount2, and shipcount3. If there are no more ships displayed loadgame("gameover").

PostPosted: Sun Feb 13, 2005 2:44 pm
by Dark RyNo
I tryed to do it using this code.
Its basically the same as yours but on the final bit.
Destroy Actor
Script editor
if(Lives.textNumber<=0) {CreateActor("GameOver", "icon", "no parent", "no path", 0, 0, false);}/if 0 or less lives, create "Game Over"
if(Lives.textNumber>0) {CreateActor("Loselife", "icon", "no parent", "no path", 0, 0, false);}/if more than 0 lives, create "Lose Life"

It should work, but it doesnt. It just comes up with "Game Over" Every time.