Page 1 of 2

Help with levels tranparency

PostPosted: Tue Sep 04, 2007 8:35 pm
by arcreamer
hey guys for going from level 1-2 i have on create actor for all my level 2 actors on transparent so u cant see them and i added a variable called enem and since i have 20 enemies in my level 1, i have on create actor of my main actor, enem = 20;
and then on my draw actor i have
if (enem = 0)
{
ChangeTransparency("l2background2", 0.000000);
ChangeTransparency("l2backround1", 0.000000);
ChangeTransparency("l2blocker", 0.000000);
ChangeTransparency("l2ene1", 0.000000);
ChangeTransparency("l2ene10", 0.000000);
ChangeTransparency("l2ene2", 0.000000);
ChangeTransparency("l2ene4", 0.000000);
ChangeTransparency("l2ene3", 0.000000);
ChangeTransparency("l2ene5", 0.000000);
ChangeTransparency("l2ene6", 0.000000);
ChangeTransparency("l2ene7", 0.000000);
ChangeTransparency("l2ene8", 0.000000);
ChangeTransparency("l2ene9", 0.000000);
ChangeTransparency("l2rock", 0.000000);
ChangeTransparency("land", 0.000000);
ChangeTransparency("Planet", 0.000000);
}



and on collision with enemies i have enem -=1;

but when i kill all the enemies i still dont see any level 2 stuff... nothing because untransparent :P what did i do wrong?

Re: Help with levels tranparency

PostPosted: Tue Sep 04, 2007 8:36 pm
by arcreamer
became untransparent**

Re: Help with levels tranparency

PostPosted: Tue Sep 04, 2007 11:42 pm
by Game A Gogo
thats because you made it do everything not transparent! 0 = not transparent and 1 = transparent =3

Re: Help with levels tranparency

PostPosted: Tue Sep 04, 2007 11:43 pm
by arcreamer
i made everything transparent on create actor for level 2 then when enem = 0, i made all the level 2 stuff become not transparent but it was still transparent :P

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 1:12 am
by Game A Gogo
then maybe use the transp variable instead? like this:
... wait, *looks at the if statement* it needs to be "==" not "=" ;)

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 2:17 am
by arcreamer
i got the levels thing all worked out but now i have another problem :roll:
i have a couple of actors that i want their health to be 2 and have on collision with them health-=1; so i did on create actor with the enemies,
if (health=0);
{
CreateActor("explosion1", "el01", "(none)", "(none)", 0, 0, false);
DestroyActor("Event Actor");
score.textNumber=score.textNumber +20;
}

and then on my draw actor i have
health=2;
and then on collision, health-=1;
but then when i ran the game, they died on startup :roll:
what did i do wrong this time?

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 3:25 am
by d-soldier
if (health=0); should be: if (health<=0)
{
CreateActor("explosion1", "el01", "(none)", "(none)", 0, 0, false);
DestroyActor("Event Actor");
score.textNumber=score.textNumber +20;
}

and then on my draw actor i have <- SHOULD NOT BE IN DRAW ACTOR SCRIPT, USE CREATE-ACTOR INSTEAD
health=2;
and then on collision, health-=1;
but then when i ran the game, they died on startup :roll:
what did i do wrong this time?

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 7:43 pm
by arcreamer
thanks D! ill try that

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 8:04 pm
by arcreamer
ok i put the health=2; in create actor and added the < symbol to the other script but they still die at startup =(

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 8:12 pm
by arcreamer
i got it all working! i had to remove the semicolon after if (health<=0);

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 8:14 pm
by arcreamer
OMG... now after i removed the semicolon... they WONT die after 2 hits... :x

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 9:43 pm
by d-soldier
if (health=0); should be: if (health<=0)
{
CreateActor("explosion1", "el01", "(none)", "(none)", 0, 0, false);
DestroyActor("Event Actor");
score.textNumber=score.textNumber +20;
}

THIS SHOULD ALL BE IN THE DRAW ACTOR SCRIPT OF THE ENEMY: right?

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 10:33 pm
by arcreamer
i have it all in create actor.. :P

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 10:41 pm
by arcreamer
i got that working but i now have one more tiny problem... when i hit 1 of them 2 times, they all blow up... :?

Re: Help with levels tranparency

PostPosted: Wed Sep 05, 2007 10:42 pm
by arcreamer
if i change the health variable to independent, would that do it?