help with destroying actors please

Game Editor comments and discussion.

help with destroying actors please

Postby mr-game » Mon Feb 19, 2007 5:14 pm

i want to make it so when you hit the spikes he dies within 3 hits
i tryed making lives in numbers and i got it so when it hits it goes down one till 00 but i want it so when the lives reaches 00 the player dies ive tryed everything please help

plus i made it so when the actor hits the spikes he goes transparant but how do i make it so he cant get hurt while transparant
erm hi
mr-game
 
Posts: 28
Joined: Mon Jan 29, 2007 10:32 pm
Location: my computer
Score: 1 Give a positive score

Postby Sgt. Sparky » Mon Feb 19, 2007 5:40 pm

okay,
first make an actor Var called Health.
on the create actor Event of you player:
Code: Select all
Health = 99;

or whatever you want it to be.
on the colliison of the spikes:
Code: Select all
Health -= 33;

and on the draw actor event of the player:
Code: Select all
if (health == 0)
{
   DestroyActor("Event Actor");
}
if (health < 0)
{
   DestroyActor("Event Actor");
}

:D
I hope that helps!
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

a reply

Postby mr-game » Wed Feb 21, 2007 10:24 pm

A reply

that didnt work for me its probly me and im so dumb i missed out somthing realy realy stupid but it didnt work just came up with aload of random things wronge and wouldnt let me play game coz there is errors in the script or somthing like that and im so anoyed coz i realy want to make this game and i made this reply last much longer than it had to be but i dont think anyone will care coz im stupid if that makes sence and no one els will reply knowing my luck
the end
wrote by mr-game
erm hi
mr-game
 
Posts: 28
Joined: Mon Jan 29, 2007 10:32 pm
Location: my computer
Score: 1 Give a positive score

Postby DilloDude » Thu Feb 22, 2007 12:01 am

Sgt. Sparky wrote:
Code: Select all
if (health == 0)
{
   DestroyActor("Event Actor");
}
if (health < 0)
{
   DestroyActor("Event Actor");
}


That should be:
Code: Select all
if (Health == 0)
{
   DestroyActor("Event Actor");
}
if (Health < 0)
{
   DestroyActor("Event Actor");
}

also, you can simplify it:
Code: Select all
if (Health <= 0)
{
   DestroyActor("Event Actor");
}

Make sure instead of 'Health' you put the name of your variable.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Sgt. Sparky » Thu Feb 22, 2007 1:56 am

or it could be:
Code: Select all
if(Health < 1)
{
    DestroyActor("Event Actor");
}

:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby morcior » Thu Feb 22, 2007 2:23 am

Code: Select all
if (Health<1) DestroyActor("Event Actor");


8)
morcior
 
Posts: 83
Joined: Fri Jan 12, 2007 12:16 am
Location: UK
Score: 9 Give a positive score

Postby Sgt. Sparky » Thu Feb 22, 2007 2:33 am

morcior wrote:
Code: Select all
if (Health<1) DestroyActor("Event Actor");


8)

Bah,
can we just stop it,
:D
it is getting to be more of a competition,
I want to quit while I'm in the lead :P


8)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby morcior » Thu Feb 22, 2007 3:41 pm

i won :P
morcior
 
Posts: 83
Joined: Fri Jan 12, 2007 12:16 am
Location: UK
Score: 9 Give a positive score

Postby Sgt. Sparky » Thu Feb 22, 2007 3:44 pm

No I won. :P


MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE! :x









:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Game A Gogo » Fri Feb 23, 2007 12:37 am

Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME WON!!!
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

Postby Sgt. Sparky » Fri Feb 23, 2007 1:24 am

Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!
Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!
Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!
Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!




I won!!! :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby UltimatHedgehog » Fri Feb 23, 2007 1:33 am

sparky went crazy

P.S. sparky can you explain what you said on the health thing to me
Image
I always thought Hell would be a giant load screen that goes on for eternity, then one day, eons later, it would end, only to reveal a slightly different loading screen.
User avatar
UltimatHedgehog
 
Posts: 325
Joined: Fri Jan 19, 2007 1:48 pm
Location: http://downloads.khinsider.com/?u=112542 plz click
Score: 10 Give a positive score

Postby Sgt. Sparky » Fri Feb 23, 2007 1:36 am

wich part?
there is alot of it! :lol:
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby UltimatHedgehog » Fri Feb 23, 2007 1:37 am

read it i asked a few things you only put 1 post anyway
Image
I always thought Hell would be a giant load screen that goes on for eternity, then one day, eons later, it would end, only to reveal a slightly different loading screen.
User avatar
UltimatHedgehog
 
Posts: 325
Joined: Fri Jan 19, 2007 1:48 pm
Location: http://downloads.khinsider.com/?u=112542 plz click
Score: 10 Give a positive score

Postby Sgt. Sparky » Sat Feb 24, 2007 10:19 pm

well, wich part do you not understand?
:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Next

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron