shooting problem

Talk about making games.

shooting problem

Postby harleyb12 » Tue Jan 09, 2007 3:59 am

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
harleyb12
 
Posts: 7
Joined: Thu Oct 19, 2006 11:12 pm
Score: 0 Give a positive score

cmon guys

Postby harleyb12 » Wed Jan 10, 2007 2:31 am

cmon guys i need help i know im o noob but im only 12
harleyb12
 
Posts: 7
Joined: Thu Oct 19, 2006 11:12 pm
Score: 0 Give a positive score

Postby makslane » Wed Jan 10, 2007 2:58 am

Change the xvelocity of the bullet:

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

Code: Select all
xvelocity = -1; //Move to left
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

umm...

Postby harleyb12 » Thu Jan 11, 2007 3:46 am

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;
harleyb12
 
Posts: 7
Joined: Thu Oct 19, 2006 11:12 pm
Score: 0 Give a positive score

Try this

Postby speckford123 » Sat Jan 13, 2007 6:12 pm

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
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

or this

Postby speckford123 » Sat Jan 13, 2007 6:16 pm

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.
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

ohhh

Postby harleyb12 » Wed Jan 17, 2007 4:20 am

i think i get it ill try that as soon as i buy the update.... i axedentally downloaded it without any plan to pay
harleyb12
 
Posts: 7
Joined: Thu Oct 19, 2006 11:12 pm
Score: 0 Give a positive score

it worked! sortoff

Postby harleyb12 » Tue Jan 23, 2007 10:16 pm

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
harleyb12
 
Posts: 7
Joined: Thu Oct 19, 2006 11:12 pm
Score: 0 Give a positive score

Postby Sgt. Sparky » Wed Feb 21, 2007 6:39 pm

if(xvelocity < 0)ChangeAnimation("Jump_Left", "FORWARD");
: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 FiLLLe1 » Tue Feb 27, 2007 8:53 pm

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?
FiLLLe1
 
Posts: 16
Joined: Mon Feb 26, 2007 10:05 pm
Score: 1 Give a positive score

Postby DilloDude » Tue Feb 27, 2007 10:43 pm

If you want to put the animation name in, you need to do
getAnimIndex("animation_name");
otherwise, just put the number in.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest