Help with levels tranparency

Non-platform specific questions.

Help with levels tranparency

Postby arcreamer » Tue Sep 04, 2007 8:35 pm

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?
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Tue Sep 04, 2007 8:36 pm

became untransparent**
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby Game A Gogo » Tue Sep 04, 2007 11:42 pm

thats because you made it do everything not transparent! 0 = not transparent and 1 = transparent =3
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Tue Sep 04, 2007 11:43 pm

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
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby Game A Gogo » Wed Sep 05, 2007 1:12 am

then maybe use the transp variable instead? like this:
... wait, *looks at the if statement* it needs to be "==" not "=" ;)
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 2:17 am

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?
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby d-soldier » Wed Sep 05, 2007 3:25 am

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?
Last edited by d-soldier on Wed Sep 05, 2007 9:42 pm, edited 1 time in total.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 7:43 pm

thanks D! ill try that
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 8:04 pm

ok i put the health=2; in create actor and added the < symbol to the other script but they still die at startup =(
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 8:12 pm

i got it all working! i had to remove the semicolon after if (health<=0);
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 8:14 pm

OMG... now after i removed the semicolon... they WONT die after 2 hits... :x
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby d-soldier » Wed Sep 05, 2007 9:43 pm

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?
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 10:33 pm

i have it all in create actor.. :P
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 10:41 pm

i got that working but i now have one more tiny problem... when i hit 1 of them 2 times, they all blow up... :?
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: Help with levels tranparency

Postby arcreamer » Wed Sep 05, 2007 10:42 pm

if i change the health variable to independent, would that do it?
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest