enemy shooting

Non-platform specific questions.

enemy shooting

Postby dimster » Sat May 19, 2007 8:39 am

ok, i have had a few problems with my game, but i have finaly almost finished it. i am on the last level, the "boss" level and i am having trouble making him shoot towards the player. i havent made my character able to shoot yet either but i think i understand how to do that. but i dont know how to make the enemy shoot towards the character every 3 seconds.

help would be greatly appreciated
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Re: enemy shooting

Postby Tytan McAnguns-PL » Sat May 19, 2007 9:10 am

In enemy shot create actor event .

code wrote:angle = direction(x, y, player.x, player.y);
directional_velocity = 10;
Project: Ninja Fighter (full) for tekdino
Shadow mask warrior (full) 100 % IIIIIIIIIII download :
http://www.esnips.com/doc/ff4b58fa-600b ... sk-warrior
POLISH FORUM GE:
http://www.ge.4.pl
User avatar
Tytan McAnguns-PL
 
Posts: 67
Joined: Sat Mar 31, 2007 9:38 am
Location: POLAND
Score: 16 Give a positive score

Postby dimster » Sat May 19, 2007 11:39 am

k thnx, i sorted all that out now. im trying to make lives now.
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby Tytan McAnguns-PL » Sat May 19, 2007 12:14 pm

In global code , create the "life" varible type and in
create player actor event "life = 100"
And in the draw actor this :

if(health <= 0)
{
DestroyActor("Event Actor");
}
Project: Ninja Fighter (full) for tekdino
Shadow mask warrior (full) 100 % IIIIIIIIIII download :
http://www.esnips.com/doc/ff4b58fa-600b ... sk-warrior
POLISH FORUM GE:
http://www.ge.4.pl
User avatar
Tytan McAnguns-PL
 
Posts: 67
Joined: Sat Mar 31, 2007 9:38 am
Location: POLAND
Score: 16 Give a positive score

Postby dimster » Sat May 19, 2007 1:10 pm

kk thnx, ill have a go at that. im pretty new to the software and this is my first game so im still learning the scripts. 8)
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby dimster » Sat May 19, 2007 2:17 pm

ok, ive put
Code: Select all
if(life <= 0)
{
DestroyActor("THEBOSS");
}


and put it on the draw actor for "THEBOSS"

and when i reach the level the boss is already destroyed, what have i done wrong?
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby d-soldier » Sat May 19, 2007 3:17 pm

in the boss's create actor event did you set his life? Typically this happens when no life is set. Be sure you have a create-actor script that says:
life=100;

or whatever amount you want.. Any make sure that your "life" variable is an actor variable, not global.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby dimster » Sat May 19, 2007 3:37 pm

oh kk... i created him on collision with another actor that takes you to that level, ill try creating him from script instead.
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby dimster » Sat May 19, 2007 3:41 pm

ok i tried that and put:
Code: Select all
CreateActor("THEBOSS", "wizzyboss", "(none)", "BOSS'path", 2700, 445, true);
(life = +100);
if(life <= 0);
{
DestroyActor("THEBOSS");
}



but it hasnt worked... what else do i need to add?
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby d-soldier » Sat May 19, 2007 3:51 pm

Not like that... Your boss actor is always there right? (wherever he is in your level)? Or does something create him at a certain point? In his actor control, click add event, select "create actor", then "script editor". You should be looking at a blank script. Assuming from the previous messages that "life" is your health variable (set to actor variable instead of global) you would have the following script:

life=100;

remove all that junk from the draw actor script except for:

if ( life <= 0 )
DestroyActor("Event Actor");

The easy way to think of it is that GE check the create actor events only once, when the actor is created... this is where you would place starting information. The draw actor scripts are constantly checked by GE to update the game during play. Use the above scripts in the correct places, and repost with any problems / the answer to my initial questions.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby dimster » Sat May 19, 2007 3:56 pm

well the boss is only seen on the last level and is on a continuous path, it can be created at anytime aslong as its still there when you reach level 10.

(as you can tell im a script vergin when it comes to GE)

anyway ill try that out now and tell you how it goes
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby d-soldier » Sat May 19, 2007 3:58 pm

Be sure to follow those directions exactly, and if you still have problems, upload the ged/source files and I'll take a look for you and get your squared away.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby dimster » Sat May 19, 2007 4:14 pm

hmmm still doesnt work... heres the zip (it should everything in it you will need)
Attachments
Mymazegame.zip
(1.72 MiB) Downloaded 172 times
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby d-soldier » Sat May 19, 2007 4:40 pm

... First let me say, cool game man. Did you make all the graphics youtself? Pretty cool little game here...
Okay, so here's what I did to get it working... exactly what I said above. I dont know if you didn't save it after trying the scripts I gave you, but nothing was setup as I said it needed to be. The life variable was still global, there was no create actor script for theboss, and the draw actor script still had all that junk in it.
1) Click on on the SCRIPTS tab in GE, click GLOBAL CODE, the VARIABLES, EDIT / LIFE, switch from global to actor.
2) Click on THEBOSS (be sure it doesn't accidently click the fireball below him as i did a few times) and bring up the actor controls. Click "add event" / "create actor" / "Script Editor". In that blank script use:

life=100;

then click OKAY / IMMEDIATE ACTION

3)Click on EDIT EVENT / DRAW ACTOR / SCRIPT EDITOR
and remove eveything from the script, and paste in:

if ( life <= 0 )
DestroyActor("Event Actor");

then click OKAY / IMMEDIATE ACTION

---
Thats it, I'm watching the wizard running all around the screen shooting fireballs at me right now. And dont worry about not being good with the scripting, I was asking the same questions just a month ago, and getting frustrated when people would answer without being speciffic enough to really help me due to my limited understanding. Let me know how this works out.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Kodo » Sat May 19, 2007 4:53 pm

Got lots of errors on trying to load your game, some were sorted out by renaming your data directory back to 'data', then I got an error about a missing font, which I copied over the one in the data directory from my windows fonts directory, then I started getting different missing art errors so I gave up, too much hassle :(
Inogames: http://www.inogames.com iOS gaming
Firetop Adventure (app store): http://itunes.apple.com/us/app/firetop- ... ?mt=8&ls=1
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest