Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / alternating misile shots

Author
Message
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 29th Apr 2005 07:57 Edited at: 29th Apr 2005 07:59
i want to make it so that the first time you fire the misile, it comes from the left, and the second time, it comes from the right. it looks good, but for some reason it's not alternating. what am i doing wrong???
ShadowCentaur 2
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Free Country USA
Posted: 29th Apr 2005 10:31
you look like your making things way too complicated. from the sound of things, it looks like your making a space shooter of some sort (a decent-esque game?). i would recommend placing an object to the left and one to the right of your camera, to serve as your "missle launchers" and then simply position the missle at the position of the appropriate launcher, and toggle the variable that stores which launcher your using. thatss the way i'd do it. hope i helped

Truth suffers from too much analysis.
-Ancient Fremen Saying
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 29th Apr 2005 13:29
the problem is caused by the interaction of your 2
"if-then" sections ... you need to change this so there
is only 1 "if-then" code ....

so, change this ...
if shot=0
the usual code here ....
so far, no real changes

ELSE
now the code for shot=1,
but without the "if shot=1"

endif

I like such simple problems ...
much easier than tracking down a problem
with miss-matched data sized memblocks
being sent over the web
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 30th Apr 2005 06:15
ah. i see. thanx lots! and its a flight sim, although somewhere in production i might change it to a space shooter. thats not a half bad idea.
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 30th Apr 2005 07:36
ok. heres another, completely un-related problem. when i launch my misile, if your x-axis is completely flat, it goes in front of you like a good little misile. now, even though i told it to set itself to the camera orientation, if you are not flat, it will go on at a flat x-line and not angle itself to the camera angle. i have no clue why its not working right, and ive checked it millions of times. if you read this, please help!!!!!!!!!!!
ShadowCentaur 2
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Free Country USA
Posted: 30th Apr 2005 07:42
i think i see your problem. you are placing the set object to camera orientation command before you are rotating it manually. that might work, but im not really sure. using moving the camera to position the missle might be messing it up too

Truth suffers from too much analysis.
-Ancient Fremen Saying
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 30th Apr 2005 22:34
i found what the problem was and fixed it. you see, in my first version of the game, you could actually see the plane (it was 3rd person.) for some reason the plane was backwards and i had to move it negatively, so the misile moved negatively to go the right direction. but now i have to make it flip backwards and then move negatively. so i removed the negativeness and the flipping, and it works like a charm.

and(im sorry for all the random questions) i have yet another unrelated question. my lock on mechanism works just fine, ut i only have one enemy. i basically said if object on screen(15) then locked = 1 and later in the shootmisile function i said if locked = 1 then point object 10(my misile), and then the coordinates for the enemy. how do i do this with multiple enemies without having to put the same locking code lines a hundred times??
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 1st May 2005 07:15
How about using an array of missilelocks?

if Missilelock(currentmissile)

then point missile at object MissileLock(currentmissile)

endif
move missile
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 1st May 2005 10:17 Edited at: 1st May 2005 10:21
sorry, im stupid, could you please explain that, waffle? i havent a clue when it comes to arrays. here are my codes for locking on.

this locks on if the enemy is on the screen


this makes the little "lock on" icon track the tank


this is in my shootmisile subroutine:
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 3rd May 2005 15:37


Its will need adjusting to work for you, but its a start.
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 5th May 2005 08:17
ill get to work on doing that waffle, thanks a bunch !!!!!
the chode
20
Years of Service
User Offline
Joined: 27th Apr 2005
Location: desert
Posted: 5th May 2005 13:49
in my opinion, descent was the best space game ever coded. wooweewooowoooo

Dude

Login to post a reply

Server time is: 2025-05-23 06:22:24
Your offset time is: 2025-05-23 06:22:24