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.

Code Snippets / U5 - Picking Matrix Tiles with Mouse

Author
Message
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 20th Jul 2003 15:55
This snippet uses the new U5 Pick Object and Pick Screen commands, to make an easier to understand matrix height editor.

Basically a cube is created and positioned at each point on the matrix. You then click and drag to move each point around.

This method works OK for matrixes of up to 20x20 tiles. Above that, it gets slow because of the sheer number of objects created. Therefore you could implement a simple function to only show the objects nearest the mouse.

Note that PICK OBJECT still picks hidden objects.

For users of the first U5 beta, because of the SET MATRIX HEIGHT inversion bug, you'll need to comment out the line which sets the matrix height and uncomment out the other line above it (which is a workaround)
http://rob.vapournet.com/combo.gif[/img]
BLUE GUI Plugin: http://blue.robert-knight.net
haggisman
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Jul 2003 18:11
Nice code, I have posted a little alteration to it. Instead of testing lots of objects all at once, i test a single object that is being positioned all over the matrix. It appears to work quicker for large matrices.

project: light/obscurance mapper (85% done)
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 20th Jul 2003 18:54 Edited at: 20th Jul 2003 18:58
Thanks - I was considering possible improvements but you've done it for me

Your version is better, but to get good accuracy, you need to make the object smaller (eg size 1)

A very slightly tweaked version attached.



haggisman
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Jul 2003 19:06
There is also a problem when working out space#, since its doing interger division it causes problems when you increase the tilecount variables. Though it is an easy fix:-



The new pick commands are great.

project: light/obscurance mapper (85% done)
HZence
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 25th Jul 2003 00:35
"could not determine parameter of Pick Object(MouseX(),MouseY(),1,1) at line 30"

...?

SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 25th Jul 2003 00:52
HZence - obviously these commands will not work until Update 5 comes out!!!!

Some people like Rob K and haggisman get beta versions to play with and are the guinea pigs for testing purposes.

The programmer formerly known as sonic
lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 25th Jul 2003 01:02
cool code rob

HZence
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 25th Jul 2003 07:28
oh i didn't know that.

SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 25th Jul 2003 15:07
@HZence

I did put "U5" in the title

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 25th Jul 2003 17:06
But you know some people cant read...


Its better than a poke in the eye...
Gu re gu
21
Years of Service
User Offline
Joined: 14th Dec 2002
Location: United Kingdom
Posted: 26th Jul 2003 00:33
Like me I can't read ... Or write
I did the same thing :p
Any ideas when the final version will be out? Hopefully won't be long seeing as the Beta's out now.

Daih thel phae 'e, clann 'e phaen
Blame it on INSANITY!

Login to post a reply

Server time is: 2024-03-29 11:19:26
Your offset time is: 2024-03-29 11:19:26