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 / Isometric game question.

Author
Message
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 15th Aug 2003 20:26
Would it be possible to make this code so the game knows what tile/plain the mouse is over?

"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 17th Aug 2003 07:01
Fixed up the code a bit, can anyone help me?


"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 22nd Aug 2003 02:34 Edited at: 23rd Aug 2003 08:00
Please can anyone help me? I want to know how to let the game know what plain the mouse is pointing to. By the way I am using DarkBASIC Classic. This code might make it easier to see:


"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 23rd Aug 2003 21:01
Why isn't anyone helping me?

"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 24th Aug 2003 21:06
Please, can anyone help me with my problem?

"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 24th Aug 2003 21:47 Edited at: 25th Aug 2003 00:33
if you had Pro you could use the pick object command, but since you ain`t you have a much harder problem and thats why it all went quite all of a sudden ,some of the things you could do are to move an object at z1000 so that it has screenx and screeny the same as the pointer, then have a long box that is pointed at the object and positioned at the pointers position, so any object it hits would be under the pointer, then just check for that object colliding with a tile number, if it has then you have the tile you pointed to, you can move the far object with a binary search of the correct screen value, it`s not that easy to do, the other way would be to rethink tile selection and highlight the tiles as you move the mouse, I assume you have the tiles in ranks like this

123
456
789

so when you move the mouse up/down you add/subtract (in this example) 3 to the position, when you go left/right then you just add or subtract 1, this would give you the number of the tile and you could then swap it for a lighter coloured tile to make it look highlighted, so when you move the mouse the tiles lighten and darken as you move forwards/backwards, and that shows what tile is selected (like block select in Dungeon Keeper), another way would be to use the object screen x and object screen y commands to find the screen position of the center of the tile and then check for the pointer being close to that position, or place VERY small triangles at the four edges of the tiles just underneath and the check their screen positions compared to the pointer, any of those will work, just a matter of what you want, cheers.

Mentor.
koshi
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Cyberspace
Posted: 25th Aug 2003 00:26 Edited at: 25th Aug 2003 00:27
[edited]

Famous last words -
Pull the pin and count to what?
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 25th Aug 2003 19:18 Edited at: 25th Aug 2003 19:24
OK, I think I understand. Thanks.
EDIT: I downloaded the DBPro Trial, could you tell me the syntax for the pick object command? I can't find it in the help document. Thanks.

"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Aug 2003 19:44 Edited at: 25th Aug 2003 19:45
pick object came in with patch 5, I am not sure if it is on the demo, but the syntax is

selected=pick object screenx,screeny,start,end

where selected is the number of the object at the screen co-ordinates screenx and screeny, start and end allow you to have objects ignored, for example if you had tiles from object number 1 to 50 then start would be 1 and end would be 50, that way you only select the tiles and not any objects that may be stood on them, if there was no object in range stood there then you would get a return of 0, you would use it like this

if mouseclick()=1 then tile_selected=pick object cursorx,cursory,first_tile_number,last_tile_number

that would return the number of the tile you clicked on, it`s a realy welcome function and pixel perfect, you can select right on the edge of an irregular object and it detects it every time, and much easier than having to code a pick object routine.

Mentor.
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 26th Aug 2003 19:44
Thanks, I think I'm going to save for DBPro.

"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949

Login to post a reply

Server time is: 2024-11-10 16:57:33
Your offset time is: 2024-11-10 16:57:33