Page 1 of 1

shooting problem

PostPosted: Tue Jan 09, 2007 3:59 am
by harleyb12
k im making shooter where u look to side of guy enywhey enter button to shoot... he can look left or right.... but the bullets always go to his right!!!! how do i get bullets to go the way hes looking? also when hese lookin left and he crouches he switches to right same when he jumps plz help thx P.S. i am willing to change quite a bit o scripting cause i know i didnt do it the right way but i dont want to tear my hole game apart!!!! though we dont always get wat we want :roll: my games whey early in dev but it still took me a while to put together

cmon guys

PostPosted: Wed Jan 10, 2007 2:31 am
by harleyb12
cmon guys i need help i know im o noob but im only 12

PostPosted: Wed Jan 10, 2007 2:58 am
by makslane
Change the xvelocity of the bullet:

Code: Select all
xvelocity = 1; //Move to right

Code: Select all
xvelocity = -1; //Move to left

umm...

PostPosted: Thu Jan 11, 2007 3:46 am
by harleyb12
i know that... what i dont know is how to program when he's facing 1 way use the x = x - 1; and when he's facing the other x = x + 1;

Try this

PostPosted: Sat Jan 13, 2007 6:12 pm
by speckford123
for when you shoot try:

if(creator.animindex==0) // put your right animation #
xvelocity=5; // enter speed of bullet
if(creator.animindex==1) // put your left animation #
xvelocity=-5; // enter speed of bullet

or this

PostPosted: Sat Jan 13, 2007 6:16 pm
by speckford123
or try on create actor event:

if(animindex==0) // your bullets right #
xvelocity=5;
if(animinex==1)
xvelocity=-5;


use this if the bullet has more than one animimation,
if not use first one.

ohhh

PostPosted: Wed Jan 17, 2007 4:20 am
by harleyb12
i think i get it ill try that as soon as i buy the update.... i axedentally downloaded it without any plan to pay

it worked! sortoff

PostPosted: Tue Jan 23, 2007 10:16 pm
by harleyb12
it worked except when i shoot then turn around bullets come back :( and i do not know how to aply this script to the jumping animation examp: guy facing left jumps facing left. i have a animation for jumping

PostPosted: Wed Feb 21, 2007 6:39 pm
by Sgt. Sparky
if(xvelocity < 0)ChangeAnimation("Jump_Left", "FORWARD");
:D

PostPosted: Tue Feb 27, 2007 8:53 pm
by FiLLLe1
with those tips i managed to make my bullets come left,when face left etc. But they only appear, they aren't using the speed i set.
(---> skott_1.xvelocity=100; <--- )

My whole script is following:

CreateActor("Skott_1", "random_skott", "Gubbe_1", "(none)", 0, -45, false);
if(creator.animindex =="USMC_1_stilla_right")
Skott_1.xvelocity = 100;
else
if(creator.animindex =="USMC_1_stilla_left")
Skott_1.xvelocity = -100;

can anyone tell me whats wrong plz??

and on script line 4 and 7 I get a warning: Suspicious pointer conversion. Why am I getting that?

PostPosted: Tue Feb 27, 2007 10:43 pm
by DilloDude
If you want to put the animation name in, you need to do
getAnimIndex("animation_name");
otherwise, just put the number in.