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.

Newcomers DBPro Corner / Locked Objects...invisible properties?

Author
Message
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 16th Oct 2002 04:07
I was working on my gun "training" when i decided to go 1st person..as anyone would i locked the gun onto the screen in the proper position and added in movement controls...I specificly made the bullets go to a relative position to the gun itself...They just stayed and fired from the 0,0,0 origin...the origin where the bullets initilaly fired from...how is it the the bullets do not got to the position of the gun?Its as if once an object is locked its propertys become irrelevant!can anyone help?

Rem * Title : Simple Gun
Rem * Author : TGWDNGHN
Rem * Date : Sept 23
`Standard Initialization
Sync On
Sync Rate 0

`Make a Sight
Make Object Sphere 13,10
Position Object 13,-75,-50,750
Color Object 13,RGB(255,0,0)
Hide Object 13
Lock Object On 13

`Load Gun
Load Object "Gun.x",1
Scale Object 1,200,200,200
Position Object 1,1,-0.75,2
Point Object 1,Object Position X(13),Object Position Y(13),Object Position Z(13)
Lock Object On 1
Autocam Off

`Make Bullets For Gun
for x=2 to 12
make object sphere x,0.025
Color object x,RGB(0,255,0)
hide object x
next x

`make array in which it checks to see if bullet is ready
dim bullets(10)
dim bullet_life(10)
dim bullet_used(10)
wait=10
`Bulet Used...to move it
BU=2

`change the variable to read all bullets as not ready
for x=1 to 9
bullets(x+1)=0
bullet_life(x+1)=0
bullet_used(x+1)=0
next x

`Main Loop
Do

`decrease the "waiting amount"
dec wait

`See if Spacekey was pressed
if spacekey()=1
`check to see which bullet is ready
for x=1 to 9
if bullets(x+1)=0 and wait
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 16th Oct 2002 07:35
Once an object gets locked to the screen, it's properties probably ARE irrelevant. Work off the camera position, and just add the offset of the gun. I won't say it's right, but I will say that's probably the way it's working right now.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 16th Oct 2002 23:16
Is anyone for sure that the properties are irrelevant? Is there anyway I can lock it ANd make them relevant or willl I just have to position relative to the camera?!

ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 17th Oct 2002 01:32
the co-ordinate system of the object becomes mapped to the camera after you lock it. you can't have it both ways, unfortunately. the only way to do this is to either work off of the camera or (better way) store your current coordinates into some variables, modify those on player_move, and use those coordinates to generate both your camera offset and your bullet starting point.

think about it this way: if you wanted to make something jiggle/wiggle/spin that was locked to the camera, would you rather do it with world co-ordinates, or based off the view of the camera itself?



-= i only do what my rice krispies tell me to do =-
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 17th Oct 2002 07:54
maybe this example might shed some light



http://www.lunarpixel.com/ is my new site
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 18th Oct 2002 02:52
locked objects rest back to 0,0,0?!

Oh and how do you do those collapsable code snippet thingys?

TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 18th Oct 2002 02:59
Oh yea and how can I position the gun...lets say 1 unit to the the of my camera's view area?

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 18th Oct 2002 06:27
TGWDNGHN

locked objects rest back to 0,0,0?!

***From where they are locked, that position for them becomes there new 0,0,0, similar to fix object pivot but for the position

Oh and how do you do those collapsable code snippet thingys?

***the collapsed code snippet can be made
bye wrapping your code around with [ c o d e ] and finshing with [ / c o d e ]

remove the spaces or it wont work, I did that so u can see it.


Oh yea and how can I position the gun...lets say 1 unit to the the of my camera's view area?

***Imagine the camera at loc 0,0,0
and an object at 0,0,10
this object is 5 x 5 x 5
once u lock it to the screen u can adjust its,
up / down or the Y dimenison
left / right or the X dimenison
Forwards/Backwards or the Z dimension

keep adding small integer amounts or decimal amounts until u have something u want.

http://www.lunarpixel.com/ is my new site
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 18th Oct 2002 21:45
don't answer my Q...how can you position the gun WITHOUT locking it lets say 1 unit to the left of the center of the camera view screen?

TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 19th Oct 2002 04:46
PEOPLE! HELP ME! I really need to know how to either

1. Position my bullets at the LOCKED Gun's position

OR

2. I need to know how to position the gun about 0.5 units to the right of the camera's center of the viewscreen

I REALLY NEED YOUR HELP!

Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 19th Oct 2002 15:52
To have the gun .5 to the right of the camera and a bit forward:


To have the bullets coming from the point of the gun:


System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 19th Oct 2002 19:05
is this with the object locked or unlocked?

TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 19th Oct 2002 19:07
There is no move object right command! maybe in DBP but I got DBE!

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 20th Oct 2002 11:57
you may be looking for turn object left
or altering the x position of the model incrementally

also consider positioning your bullets by using the
object position X,Y,Z() command.

http://www.lunarpixel.com/ is my new site

Login to post a reply

Server time is: 2024-03-29 10:13:25
Your offset time is: 2024-03-29 10:13:25