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.

Dark GDK / 1 simple question for GDK pros

Author
Message
tvzen
14
Years of Service
User Offline
Joined: 3rd Dec 2009
Location:
Posted: 25th Feb 2010 01:58
how do you make something come/spawn from something else (i.e. a bullet from gun,soldiers from barracks,a player from spawn point,etc.)
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 25th Feb 2010 02:28 Edited at: 25th Feb 2010 02:31
Get the position from your "Gun" find the offset for the location puts you at the end of the "barrel" and then create your "bullet" at that location

EDIT: That will create the "Appearance" of a bullet firing out of a gun, that is if you could see the bullet at that speed
tvzen
14
Years of Service
User Offline
Joined: 3rd Dec 2009
Location:
Posted: 25th Feb 2010 04:25
ok,but how do you find position of the "gun"
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 25th Feb 2010 04:40 Edited at: 25th Feb 2010 04:40
dbObjectPositionX(id);
dbObjectPositionY(id);
dbObjectPositionZ(id);

id being the object id of the gun object

From there its just trial and error adding and subtracting different values from the x, y, and z until it looks like the bullet is origionating from the proper location.
tvzen
14
Years of Service
User Offline
Joined: 3rd Dec 2009
Location:
Posted: 25th Feb 2010 05:02
thanks.
haliop
User Banned
Posted: 25th Feb 2010 06:35
im not sure that will work
cause if the gun will be towards upwards then the bullet will come from the middle or something... am i wrong?

isnt it supposed to be something like
Static Geometry calculation of the gun , then you can always tell where the end is , cause if its rotated.. then it will have bugs.

atleast if its a multiplayer and i see the backfire after the shot.. well i could be wrong.
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 25th Feb 2010 18:57 Edited at: 25th Feb 2010 18:58
Thats why you have to take the angle of the object into account when writing the equation.

EDIT: as for supplying the equation thats where you the programmer get to use your brain.
tvzen
14
Years of Service
User Offline
Joined: 3rd Dec 2009
Location:
Posted: 26th Feb 2010 00:13
ok,that will work?
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 26th Feb 2010 03:08
you use
That should give you a general understanding of how to accomplish your task.
haliop
User Banned
Posted: 26th Feb 2010 07:21
nice
tvzen
14
Years of Service
User Offline
Joined: 3rd Dec 2009
Location:
Posted: 27th Feb 2010 01:45
that anwsers that...
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 27th Feb 2010 03:16
Huh? Did it work for you?

Add me to your MSN!
tvzen
14
Years of Service
User Offline
Joined: 3rd Dec 2009
Location:
Posted: 27th Feb 2010 03:44
i assume i have to copy that for x y and z,right,(if no,tell me,ill screw up my code)

Login to post a reply

Server time is: 2024-10-05 16:21:32
Your offset time is: 2024-10-05 16:21:32