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 / HELP with actions (dbc)

Author
Message
Satchmo
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 19th Sep 2005 14:43
Hello im asking about how to make it so if you went to a certain place you would transport to another place or something would happen?
i would be happy if you told me
thanx
-fxgamer

http://www.dabip.stonerocket.net/next/images/other/couch.jpg
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 19th Sep 2005 19:20 Edited at: 19th Sep 2005 19:29
If you want to have it so that you transport to another place you would just have to move your object position.
The best way to find out what the second(or the position you would like to end up in)position is to


ok now step two if you have already set up movement controls I suggest you move your player to the postition you would like to end up and record the numbers in the top of the screen.
Remember to have X then Y then Z it makes it a lot easier.

You should then use step two and do the same to find the position of the teleport pad or what ever.

then you would write something like


then code is not intended to be used as it is, it is just a demo.


This will work for 3d

I hope it helped tell me if you are unsure about anything said.

Our aim is to keep the loo's clean, your aim can help.
Louiz ofRohr
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 19th Sep 2005 21:28 Edited at: 19th Sep 2005 21:54


ok.. this is gonna take the position of the object 1 in the 3D space and print it on screen..

Now lets make a function to detect if the object is in a certain area..



If there is some problem to understand the function above, please tell..
It just checks if the object is in a 3D box in the world,
then returns 1 if the object is in or 0 if the object isn't in..

now, lets implement it to example:




:EASIER WAY:

of course you could just put a dummy object in the world and check
the collision to it..

But the fastest way is using the distance formula:

sqrt((xpositionofcharacter-xposition2)^2 + (ypositionofcharacter-yposition2)^2 + (zpositionofcharacter-zposition2)^2)

well..



It checks if the character is at less than 200 points from the position2..


Implementing it to the example above (it is much more clear):


[REMEMBER]: You need not to create the sphere (I created it just to show the area)..
Note that you check a distance between character and the point:
P(x,y,z) => P(250,50,350)

Hope that helps

The worst foe lies within the self..
Louiz ofRohr
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 19th Sep 2005 22:03
The inmage in the attachment is much more clear to understand
the "ObjectInBox" function..

But my hint is to use the easier way..

The worst foe lies within the self..

Attachments

Login to view attachments
Satchmo
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 20th Sep 2005 00:31
thank you Louiz ofRohr that code will help me with ALOT of stuffy.
topic closed
mods u can lock this

http://www.dabip.stonerocket.net/next/images/other/couch.jpg

Login to post a reply

Server time is: 2024-11-27 16:29:35
Your offset time is: 2024-11-27 16:29:35