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 / problems with drawing lines for targeting

Author
Message
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 9th Mar 2004 20:39
Im using a box that goes around the enemy units that are targeted. Im using the 2d box command and drawing them around the target. But as the ships move the boxes start to scramble. They will produce multiple copies of the same box and its realy annoying not to mention nausiating. How do i stop the boxes from scambling so?
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 9th Mar 2004 20:42
can't really help with this unless you show your code...

In the beginning, the universe was created...
This made alot of people very angry and it has been widely regarded as a bad idea...
Visit http://redeye.dbspot.com
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 9th Mar 2004 21:02
if object exist(currenttarget+4999)=1
point object tfinder,object position x(currenttarget+4999),object position y(currenttarget+4999),object position z(currenttarget+4999)
if OBJECT IN SCREEN(currenttarget+4999)=1
if object exist(currenttarget+4999)=1
msxp=object screen x(currenttarget+4999)+10
msxn=object screen x(currenttarget+4999)-10
msyp=object screen y(currenttarget+4999)+10
msyn=object screen y(currenttarget+4999)-10
line msxp,msyn,msxn,msyn
line msxp,msyn,msxp,msyp
line msxn,msyn,msxn,msyp
line msxp,msyp,msxn,msyp
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2004 17:40 Edited at: 10th Mar 2004 17:40
The problem here is that the lines stay on the screen after the sync command updates the screen. This is because the lines are 2d whereas your objects are 3d.

You would be better to create a plane object, texture it with a white box, make the plane object transparent and lock it to the screen. Then position that plane object each game loop over the object screen x and object screen y of the "target" object, providing the object screen x and y are within the boundaries of the screen.

Hope this helps.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 10th Mar 2004 20:22
yea thats what it thought i should do, thanks philip. and now that i think about it this will work better because it will allow me to scale the box without any funky code

Login to post a reply

Server time is: 2024-09-22 00:34:20
Your offset time is: 2024-09-22 00:34:20