That's the only way to do it... with those slow tile coordinates. The challenge is converting 3D positions into those tile coordinates so you can edit more easily.
Here's something I made a while back to test some of my functions from
This Thread. Maybe it could help? It has a useful position to matrix tile function (called POS_TO_TILE) in it and it has lots of comments in it. Let me know if you need any help
.
type _TileR_
X as integer
Z as integer
endtype
global FTile as _TileR_
sync on
sync rate 60
hide mouse
autocam off
Make Matrix 1,1000,1000,60,60
Make object sphere 1,5
make object box 2,2,2,20
position object 2,0,0,0
make object box 3,2,20,2
position object 3,0,0,0
Merge_Object(1,3,11,0,0,0)
color object 11,rgb(255,0,0)
create bitmap 1,100,100
ink rgb(0,255,0),0
box 0,0,100,100
for z = 1 to 500
x=rnd(99)
y=rnd(99)
ink rgb(0,155,0),0
box x,y,x+1,y+1
next z
Box_Clear(0,0,100,100,2)
get image 1,0,0,100,100
delete bitmap 1
prepare matrix texture 1,1,2,2
fill matrix 1,0,1
rem make matrix a little bumpy
for x = 0 to 59 : for z = 0 to 59 : set matrix tile 1,x,z,1+rnd(3) : next z : next x
do
rem Print text to screen
set cursor 0,0
ink rgb(255,255,255),0
print "Use the arrowkeys to move around."
print "Use w and s to raise and lower the matrix."
rem camera follow (custom function)
Third_Person_Camera(11,0,20,100,10,1)
rem object control (custom function
Control_Object_Using_Arrowkeys(11,2,2)
rem get position and ground height
x#=object position x(11)
z#=Object position z(11)
y#=get ground height(1,x#,z#)
rem restrict object movement so it cant go off matrix
if x#>=1000 then x#=1000
if x#<=0 then x#=0
if z#>=1000 then z#=1000
if z#<=0 then z#=0
rem position the object
position object 11,x#,y#,z#
rem make it rotate and look cool :D
rotate limb 11,2,limb angle x(11,2),wrapvalue(Limb angle y(11,2)+1),limb angle z(11,2)
rotate limb 11,3,wrapvalue(Limb angle x(11,3)+1),Limb Angle y(11,3),limb angle z(11,3)
rem convert the object's position to a matrix tile (uses a custom function)
Pos_To_Tile(1,1000,60,x#,z#)
rem use the W and S keys to raise/lower the matrix by 2.
if keystate(17) then set matrix height 1,FTile.x,FTile.z,Get MAtrix Height(1,FTile.x,FTile.z)+2
if keystate(31) then set matrix height 1,FTile.x,FTile.z,Get MAtrix Height(1,FTile.x,FTile.z)-2
rem update everything
update matrix 1
sync
loop
rem **********STARTING FUNCTIONS!!!!***********************
function Control_Object_Using_Arrowkeys(Obj,MS,TS)
`Works just like move camera using arrowkeys!
`MS=Move Speed
`TS=Turn speed
`OBJ=Object Number
`USe arrowkeys to move object
if upkey() then move object Obj,MS
if downkey() then move object OBJ,-1*MS
if leftkey() then yrotate object OBJ,wrapvalue(Object angle y(OBj)-TS)
if rightkey() then yrotate object OBJ,wrapvalue(Object angle y(OBj)+TS)
endfunction
function Third_Person_Camera(Obj,Cam,Dist#,Height#,Smooth,FLAG)
`Obj=Object that you want to follow
`Cam=Camera number of camera used (Psst...0 is default camera...)
`Dist#=Distance from target
`Height#=Height of camera above object
`Smooth=Amount of steps it takes to reach the target
`1=No smoothing
`100=LOTS of smoothing
`Height Smoothing Flag. 0=No height smoothing and 1=Height smoothing
rem Store Camera Target Position
cx#=newxvalue(OBject position x(Obj),Object angle y(Obj),-1*Dist#)
cy#=Object Position y(Obj)+Height#
cz#=newzvalue(OBject position z(Obj),Object angle y(Obj),-1*Dist#)
`Store Camera Current Position
Camx#=curvevalue(cx#,Camera Position x(Cam),Smooth)
Camy#=curvevalue(cy#,Camera Position y(Cam),Smooth)
Camz#=curvevalue(cz#,Camera Position z(Cam),Smooth)
`Position Camera
if FLAG=1 then position camera Cam,Camx#,Camy#,camz#
if FLAG=0 then position camera Cam,Camx#,Object Position y(Obj)+Height#,camz#
point camera Cam,OBject position x(Obj),object position y(Obj),object position z(Obj)
endfunction
function Merge_Object(SObj,EObj,TOBj,X#,Y#,Z#)
remstart
SOBJ=Start Merge OBject
EOBJ=End MErge Object
TOBj=The final object number
X# Y# and Z# = The center point in the object (not sure what the word for this is). It's what the object's position is based on.
NOTE: The limbs are stated in this way: Limb 1=SObj.
The limb number goes up by 1 with each limb added. So, the second object would be limb 2.
remend
`Set Start Limb Number to 1
Limb=1
`Make a TINY almost invisible sphere to mark the center of the object
make object sphere TObj,0
`Begin to select all of the objects from the SOBj to the EObj
for M = SOBj to EObj
`Make a mesh from the selected object
make mesh from object m,m
`Add the object to the final object as a limb
add limb TObj,Limb,m
`Position the limb where the object was, but in a local way instead.
offset Limb TObj,Limb,Object Position x(m)-x#,Object Position y(m)-y#,Object Position z(m)-z#
`Rotate the limb to the old object's position.
rotate limb TObj,Limb,Object angle x(m),Object angle y(m),Object angle z(m)
`Increasethe limb number.
inc Limb
`Delete the original object
delete object m
`Delete the Mesh
delete mesh m
`Keep going until you're done!
next m
Endfunction
function Pos_To_Tile(Matrix,Size,Tiles,x#,z#)
remstart
NOTE: ONLY WORKS ON A SQUARE MATRIX WITH SAME AMOUNT OF TILES ON BOTH AXIS!!!
MAtrix=Matrix Number
Size=MAtrix Size (In the make matrix command this would be the Width or Height value)
Tiles=Number of tiles that the matrix has (in the Make MAtrix command, it's be the XSegment or ZSegment value. These should both be the same, because it's a square.)
x#=X Coordinate to convert
z#=Z Coordinate to convert
Palce the following code at the start of your program. Make sure none of these names have been used, for the function uses them.
type _TileR_
X as integer
Z as integer
endtype
global FTile as _TileR_
The variable FTile is a global type. To retrieve the X tile generated, use FTile.X. To retrieve the Z tile, use FTile.Z.
IF you are unsure about how to use types, type in the command "type" in the editor and press F1. Scroll down to the section about types.
remend
`Store the size of each tile
MTS#=Size/Tiles
`Store the matrix positions
MX#=MAtrix position x(MAtrix)
MZ#=MAtrix Position z(Matrix)
`Check every tile on the matrix for a match
for y = 0 to Tiles
for x = 0 to Tiles
`IF the coordinates specified are within the range of the selected tile, then set the FTile type variable to the tile's coordinates.
if x#>MTS#*(x)+MX# and x#<MTS#*(x+1)+MX# and z#>MTS#*(y)+Mz# and z#<MTS#*(y+1)+Mz#
FTile.X=x : FTile.Z=y
endif
next x
next y
endfunction
function Box_Clear(Left,Top,Right,Bottom,Thick)
`LEFT=how far left the box should start out
`TOP=At what height the top of the box is at.
`RIGHT=How far right the box should go
`BOTTOM=Where the bottom of the box is.
`Make Top line of the box, making more lines until the line is as thick as it should be.
For T = 0 to Thick
line Left,Top+T,Right,Top+T
next T
`Bottom line
for T = 0 to Thick
line Left,Bottom-T,Right,Bottom-T
next t
`Left side
for T = 0 to Thick
line Left+T,Top,Left+T,Bottom
next t
`Right side
for T = 0 to Thick
line right-T,Top,right-T,Bottom
next t
endfunction