help with code

Non-platform specific questions.

Postby Troodon » Sun Aug 05, 2007 8:11 pm

Ah yeah, I forgot the bullet stops when it reaches the location where the actor2 is. So you need another code but I'm too tired to remember what code it exactly was.
Directions are controlled with the "angle" value. So the code will be in the create actor code but it will be something like

angle = //I dont' know this one now;
directional_velocity = 1;
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Zehper48 » Sun Aug 05, 2007 8:16 pm

thanks tekdino, does anybody know the code for it?? thanks
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby d-soldier » Sun Aug 05, 2007 8:19 pm

So your trying to make the bullet be like a heat-seeker? Where it adjusts it's velocity to compensate for a moving target???
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Troodon » Sun Aug 05, 2007 8:22 pm

Nooo, the opposite.

EDIT: He wants the opposite. That's why the code is in create actor in my example.
Last edited by Troodon on Sun Aug 05, 2007 8:23 pm, edited 1 time in total.
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Zehper48 » Sun Aug 05, 2007 8:23 pm

not heat seeking the velocity doesnt have to be changing but it needs to move to an actor but not follow it
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby d-soldier » Sun Aug 05, 2007 8:47 pm

If you are using move-to, then it is going to change it's direction as the target actor moves (heat-seeking like)...
What's wrong with: [CREATE-ACTOR]

angle = direction(x, y, target.x, target.y);
directional_velocity = 25;
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Zehper48 » Sun Aug 05, 2007 8:49 pm

if you use move to with draw actor it will keep following it but if you use create actor it will move to were the actor was and stop, it wont continue moving thank you d-soldier for the code

also is there a code to make actor1 create actor2 when actor3 is within 500 units of actor1?
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby pixelpoop » Mon Aug 06, 2007 5:54 am

you can use the distance function in a draw actor script

if (distance(actor1.x, actor1.y, actor3.x, actor3.y)<500)CreateActor......
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby Zehper48 » Mon Aug 06, 2007 10:35 am

i made a code so when my guy has 0 health it would load lose.ged
Code: Select all
if (M1health.textNumber <=0)
{
DestroyActor("Event Actor");
LoadGame ( "lose.ged");

}

when his health is 0 the screen just goes black instead of loading lose.ged
does anybody know why?
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby Troodon » Mon Aug 06, 2007 4:26 pm

Yeah, it's because it can't load other projects in the game mode. Or they should be in the same folder.
Replace the .ged with .exe and then make executable of all your ged files. Then it will work but only in the exe file. (The ready version)
Of course it can be whatever export file.
:)
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest