Page 2 of 3

Posted:
Sun Apr 22, 2007 1:59 am
by Sgt. Sparky
make a variable called DIR, make it an actor variable not global.
put this on the draw actor event of you're enemy
- Code: Select all
if(xvelocity < 0)DIR = 0;
if(xvelocity)DIR = 1;
when he is supposed to shoot,
- Code: Select all
if(DIR == 1 && player.x > x) {
make him shoot;
}
if(DIR == 0 && player.x < x) {
make him shoot;
}
I hope that helps.

wow

Posted:
Sun Apr 22, 2007 2:26 am
by d-soldier
Sparky, you are on fire today! :P

Posted:
Sun Apr 22, 2007 2:28 am
by Sgt. Sparky

xD
I am downloading linux to the other computer so I cannot get busy coding xD

hmmm

Posted:
Sun Apr 22, 2007 4:53 am
by kyensoftware
Gogo...your speed wont matter if u have 32 or 2 gb of ram...it depends on your gfx card and processor.....*starts dreaming about AMD 64-bit Dual-Core Athlon processor(...wow, its so fast......i can have 400000 fps......)*


Posted:
Sun Apr 22, 2007 5:22 am
by Sgt. Sparky
*dreams about a faster graphics proccessor...
falls over crying*
http://www.youtube.com/watch?v=lLxv38cjEDU
xD
look at that video I made xD
c0oL

Posted:
Sun Apr 22, 2007 3:55 pm
by kyensoftware
COOL! nice touch!
*shoots someone and starts jumping on back*
ohh... it dosnt work...
---

Posted:
Sun Apr 22, 2007 4:12 pm
by d-soldier
Hey Sparky... So I changed around different things (proccess of elimination) to determine what isnt working right... By changing on directional attack (create actor) to a rocket, and the other a laser, I was able to figure out that the script works as making the enemy shoot differently depending on what side (of him) the player is on, but is still shooting out of his back after he turns around and starts walking away... So it works to determine which side the player is on, but as far as only attacking the direction he is moving??? Ideas?

Posted:
Sun Apr 22, 2007 9:42 pm
by Sgt. Sparky
I wrote:make a variable called DIR, make it an actor variable not global.
put this on the draw actor event of you're enemy
- Code: Select all
if(xvelocity < 0)DIR = 0;
if(xvelocity > 0)DIR = 1;
when he is supposed to shoot,
- Code: Select all
if(DIR == 1 && player.x > x) {
create the shot;
}
if(DIR == 0 && player.x < x) {
create the shot;
}

I hope that helps.

that is the code to use xD
only I wrote it as make him shoot,
which is creating the shot,
that code has to work I used it for my spear dudes in Samurai Dude so they would not throw the spears backwards, same with the whip dude so he would not attack backwards

hmm...

Posted:
Sun Apr 22, 2007 10:56 pm
by d-soldier
Okay, so I rechecked everything, and I think I know whats messing it up. Once the enemy finishes a path, the he changes animation (turns around)as he starts his next path.. This seems to be where all the shooting is coming from his back. How would I script the shooting direction to not be based on x-velocity, rather the animation number (and of cousse if the player is on the correct x side)?

Posted:
Mon Apr 23, 2007 3:31 am
by Sgt. Sparky
if(animpos == what you want)DIR = whatever;
but what events happen when it changes to another path?
there is not really a direct answer unless you have information(I only have 10 minutes left hurry

!)
...

Posted:
Mon Apr 23, 2007 3:37 am
by d-soldier
To solve the problem I may just re-render him with a walking legs, and a (parented) 180 degree rotating torso... Seems like that would be the hard way though...

Posted:
Mon Apr 23, 2007 3:46 am
by Sgt. Sparky
hmm,
make a variable called shoot. make it a global integer.
if it is just not a path finish event of any path just use on the path finish event of left,
- Code: Select all
DIR = 0;
shoot = 1;
and on the path finish event of right
- Code: Select all
DIR = 1;
shoot = 1;

and on the draw actor event use,
- Code: Select all
if(shoot == 1) {
if(DIR == 0 && player.x < x)make_him_create_missile_here;
if(DIR == 1 && player.x > x)make_him_create_missile_here;
}
I hope that helps.
I will be on tomorrow(for me)

damn!

Posted:
Mon Apr 23, 2007 8:12 am
by d-soldier
... So I re-rendered my walker... For some reason I cant even get the new version to do what I want... The rotating top piece is parented to the legs, and should rotate around and follow the player (tried both 180 and 360 angles for this)... Anyone?!?
Re: damn!

Posted:
Mon Apr 23, 2007 8:39 am
by Caaz Games
d-soldier wrote:ThePicture thingy
That is the COOLEST game i have ever seen!
Thanks!

Posted:
Mon Apr 23, 2007 2:15 pm
by d-soldier
Thanks Caaz, I expect to have level1 completed and all the bugs worked out withing the week, at which time I will make a demo available for everyone to play!
BTW: Your in Fresno?! I'm in Sacramento!