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 / [SOLVED] Position object in front of another object=player object

Author
Message
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 7th May 2019 05:14
So, I'm trying to make it look as a player object is holding a box, and can carry the box, then drop it off at said location.

How can I position the second object?

Here is what I have and it does not work, the object just rotates around the player object.


The author of this post has marked a post as an answer.

Go to answer

Scorpyo
17
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 7th May 2019 08:47
This post has been marked by the post author as the answer.
You have refer the picked up object position and angle to the player object ( I guess it's object number 200)

to offset ahead you need to use :


if you want it offset also sideways:


full example (very old code):

locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 7th May 2019 20:19
Trying it now, thank you.
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 7th May 2019 20:34
Scorpyo

I'm not sure how to implement this in my code to my player object?
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th May 2019 23:40
x# = object position x(yourPlayerObjectNumber)
z# = object position z(yourPlayerObjectNumber)
a# = object angle y(yourPlayerObjectNumber)
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 7th May 2019 23:44
Ok, Ok, lol.

I'm trying it now
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 8th May 2019 00:09
Ok, so this is what I have so far, it works but the box is behind the player and not in front, the smaller I make the step value the closer it is to the player, at 0 it is in the player and at - the player walks back wards, lol.

We are close to fixing this


Scorpyo
17
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 8th May 2019 14:08
Show us your bit of code for managing the player
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 9th May 2019 00:39
Ok, so I did fix this, thank you any how, this is all I did. I chanced the step value to a higher - value and now it works.

Login to post a reply

Server time is: 2019-10-17 13:46:20
Your offset time is: 2019-10-17 13:46:20