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 Professional Discussion / Missile positioning problem

Author
Message
acurrate eye
16
Years of Service
User Offline
Joined: 28th Aug 2009
Location: ur house under your pillow was under bed
Posted: 11th Jun 2010 20:08 Edited at: 11th Jun 2010 20:13
I want to position 2 missiles on the sides of my plane but it is moving away or closer to my plane when it turns in circles. Here is the code

object 41 = missile
mdelay = how long you wait till you can shoot another missile
mislife = how long it lasts

I know the code set object to object orientation 41,1,1 makes it so the missile shoots from the place the bullets come from but i need a alternate like this

0<|>0

0 = missile
<> = wings
| = torso



Thank you ahead of time

if you can't do it try try again and if you still cant do it ask for help
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Jun 2010 20:58
If you have IanM's matrix1utils, there are commands,

move object left
move object right

Position your missiles at the origin of your plane, set them to the plane's orientation, then move one left the appropriate amount, and the other right.

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 12th Jun 2010 05:50
or if you don't have matrix utilities, postition the missiles at the plane and facing the same direction of the plane, rotate the missiles right and/or left, move them, and then rotate them back.


If it hasn't exploded yet, I haven't touched it.
acurrate eye
16
Years of Service
User Offline
Joined: 28th Aug 2009
Location: ur house under your pillow was under bed
Posted: 12th Jun 2010 18:17
Thanks ill try both of these i just got ianM's dll it looks like it would help alot.

Thanks for your help ill post back soon!!!!!!

if you can't do it try try again and if you still cant do it ask for help
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 12th Jun 2010 19:09
Quote: "rotate the missiles right and/or left, move them, and then rotate them back."


That works too.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Jun 2010 15:36
Or position them once, and glue them to the object.

My signature is NOT a moderator plaything! Stop changing it!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Jun 2010 16:06 Edited at: 15th Jun 2010 16:07
Quote: "Or position them once, and glue them to the object."

That's another way but fiddly as positioning the missile has to be done in relation to the global origin not the actual position of the 'plane'.

Here is a function I wrote that works it all out for you (it uses EZ rotate plugin though... sorry):


EDIT: I had a slightly better version where you can set the limb to glue to

acurrate eye
16
Years of Service
User Offline
Joined: 28th Aug 2009
Location: ur house under your pillow was under bed
Posted: 17th Jun 2010 23:41 Edited at: 17th Jun 2010 23:42
Cool srry it took me a while to get back ive been really busy with family work...

i didnt know you could paste limbs on .x files it doesnt work with the add limb command but this looks col the limb to glue
ill try this out in a copy of my game

oh and i got the missile positioning right almost every time you click spacebar it moves to the objects orientation even though I named a different object this i might be able to fix with the limb code since i have ez rotate

thanks for the help guys

if you can't do it try try again and if you still cant do it ask for help
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 18th Jun 2010 04:12 Edited at: 18th Jun 2010 14:14
Can I suggest creating a node attachment system. Basically, you add position node to an object, then attach objects or whatever to the nodes. So a quick example:



I just rushed coding this so it could be massively improved, for example angular offsets, getting rid of 'nodeLimbObj' and just doing the math, only updating active objects, changing the way the array/type are handled for multiple objects to be attached to one node.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
acurrate eye
16
Years of Service
User Offline
Joined: 28th Aug 2009
Location: ur house under your pillow was under bed
Posted: 19th Jul 2010 19:30 Edited at: 22nd Jul 2010 23:57
baxlash i have ezrotate but it is the older version so the objfindoffsetfrompoint doesnt work its not in the commands thing ill look for the newer version one.(for later uses)

ill post my missile code next time im on so others who have a problem like this can use it.

Thanks for your help guys

added: its the free ezrotate so it doesnt have everything

if you can't do it try try again and if you still cant do it ask for help
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Jul 2010 22:38 Edited at: 19th Jul 2010 22:39
I found this code from searching for "Global Rotation" and it works really well (for those who don't have EZ Rotate...)



acurrate eye
16
Years of Service
User Offline
Joined: 28th Aug 2009
Location: ur house under your pillow was under bed
Posted: 23rd Jul 2010 00:17
Heres the code i said i'd put here for others:
(its for a airplane in my game but it can be whatever you want)

i made the object numbers blank you need to fill it in yourself

delete the # and replace it with your objects

missile and m = same thing objects 41 to 44
mdelay = missile delay so you can shoot the missiles how fast you want it(you can change it to fit your needs)

mislife = missile life (change to your needs)

mswitch= missile switch starts at 1 goes to 4 then back to 1
you may notice it goes 1,5,2,3,4,1...(it shot 2 missiles without making a (fake missile) or a # that stands for no object)




if you can't do it try try again and if you still cant do it ask for help
Ermes
23
Years of Service
User Offline
Joined: 27th May 2003
Location: ITALIA
Posted: 23rd Jul 2010 18:18 Edited at: 23rd Jul 2010 18:19
well, there's a more practical way.
when you create your airplane in 3dmax,for example, make two little sphere where the missiles must be positioned. if you want you can create hardpoints all under the wings in the same way.

now, you must give an exclusive name at those spheres, example "link1","link2".... and so on.

then, when you load the object in dbpro, make a routine search the limbs with that name (example link1 for the right missiles...), store its number in an array, and hide that limbs.

you can even do that manually,just record the limb numbers and what they are (a wing, the nose, the tail, or the harpoint you are looking for)

use respective limbs numbers to get limb positions and position missiles and rotate in the same direction of the airplane.

100% accurate,FAST, no math, only 3 limb position calls.

this is the way i do that for link engine flames,where bullet must starts, where missiles must be fired,where ship must leak and smokes,and so on.

ogni scarafone รจ bello a mamma sua.
acurrate eye
16
Years of Service
User Offline
Joined: 28th Aug 2009
Location: ur house under your pillow was under bed
Posted: 11th Aug 2010 00:29 Edited at: 20th Aug 2010 20:15
Sounds good but what do u mean by limbs i try adding limbs in dbpro to my .x plane it wont add the limb to the plane. Im using sparkies so i cant make it a mesh (i think) and have the collision still working so what do u mean by make limbs. im using blender 3d so. Do u mean make 2 spheres position them at the planes wings and do a limb search in dbpro. or do u mean add an armature i highly doubt u can export bones? and what do u mean by hardpoints.

Edit: ok i found out what u ment export all the objects seperatly

if you can't do it try try again and if you still cant do it ask for help

Login to post a reply

Server time is: 2026-07-25 11:48:20
Your offset time is: 2026-07-25 11:48:20