Posted: 8th Dec 2021 5:22
I am using this code to generate the board:

+ Code Snippet
function createBoard(width, height)
	for w = 0 to width
		for h = 0 to height
			boardpiece[w,h].x = 1 * w
			boardpiece[w,h].z = 1 * h
			boardpiece[w,h].id = CreateObjectBox(BOARD_WIDTH, BOARD_HEIGHT, 1)
			SetObjectPosition(boardpiece[w,h].id, boardpiece[w,h].x, 0, boardpiece[w,h].z)
			SetObjectColor(boardpiece[w,h].id, COLOR_NORMAL_RED, COLOR_NORMAL_GREEN, COLOR_NORMAL_BLUE, 100)
		next h
	next w
endfunction

The issue I am having is the board's y origin is backwards. That is 0 is at the bottom and 7 is at the top. I tried changing it to:
+ Code Snippet
function createBoard(width, height)
	for w = 0 to width
		for h = height to 0 step -1
			boardpiece[w,h].x = 1 * w
			boardpiece[w,h].z = 1 * h
			boardpiece[w,h].id = CreateObjectBox(BOARD_WIDTH, BOARD_HEIGHT, 1)
			SetObjectPosition(boardpiece[w,h].id, boardpiece[w,h].x, 0, boardpiece[w,h].z)
			SetObjectColor(boardpiece[w,h].id, COLOR_NORMAL_RED, COLOR_NORMAL_GREEN, COLOR_NORMAL_BLUE, 100)
		next h
	next w
endfunction

However it made no difference and the baord was still backwards. I also checked my highlight code but, all it does is take a x and z coordinate and uses that information to get the ID from the object type.

+ Code Snippet
function highlightCursor(x as integer, z as integer, r, g, b, a)
	objectid as integer
	objectid = BoardPiece[x, z].id
	SetObjectColor(objectid, r, g, b, a)
endfunction


The only other thing I can try is reversing the loop so its height outer, width inner , but it's late, and I am tired. I have attached the source code for reference.

UPDATE
I got objects to spawn on the cursor by changing this line from:
+ Code Snippet
SetObjectPosition(playerdefense[playerdefensecounter].id, playerdefense[playerdefensecounter].x, 2, 5 - cellz)

to:
+ Code Snippet
SetObjectPosition(playerdefense[playerdefensecounter].id, playerdefense[playerdefensecounter].x, 2, cellz)


but the issue still persists and the board's z coordinate is still reversed.
Posted: 8th Dec 2021 8:41
Bear in mind that the positions are relative to the camera position, so it may look backwards from one angle and correct from another

like, this looks reversed on both x and y


but this one it looks like the y is reversed, its not, as you can see from the bigger object still at 0x0



+ Code Snippet
BaseWidth = GetMaxDeviceWidth()
BaseHeight = GetMaxDeviceHeight()
SetWindowSize( BaseWidth, BaseHeight, 1 )
SetVirtualResolution( BaseWidth, BaseHeight)
SetWindowAllowResize( 1 ) 

UseNewDefaultFonts(1)

SetCameraPosition(1, -50, 100, -100)
SetCameraLookAt(1, 25, 0, 25, 0)

// place a bigger object at 0-0 for bearings
CreateObjectBox(5, 10, 5)

// loop y first
for grid_y = 0 to 10
	// now loop the x
	for grid_x = 0 to 10
		
		id = CreateObjectBox(5, 5, 5)
		SetObjectPosition(id, 5*grid_x, 0, 5*grid_y)
		SetObjectColor(id, random(0, 255), random(0, 255), random(0, 255), 255)
		
		txt = CreateText(str(grid_x) + " - " + str(grid_y))
		SetTextSize(txt, 20)
		x=GetScreenXFrom3D(5*grid_x, 0, 5*grid_y)
		y=GetScreenYFrom3D(5*grid_x, 0, 5*grid_y)
		SetTextPosition(txt, x-25, y-25)
	next
next

repeat
   
    Print( ScreenFPS() )
    Sync()
 
until GetRawKeyPressed(27)


maybe I am misunderstanding your issue? post some working code and/or a screenshot
Posted: 9th Dec 2021 3:52
Here is what I mean...

Notice 0, 0 is on the bottom left.
Posted: 9th Dec 2021 5:04
Notice 0, 0 is on the bottom left.


and see my examples, its the camera position that's throwing you off

here is some camera code that will help you find the correct location to place the camera

add the code to your project, find the right position, take a note of the position, angle, remove the code and set the right values in your camera setup.
+ Code Snippet
// Project: Camera 
// Created: 2021-12-09

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "Camera" )
BaseWidth = GetMaxDeviceWidth()
BaseHeight = GetMaxDeviceHeight()
SetWindowSize( BaseWidth, BaseHeight, 1 )
SetVirtualResolution( BaseWidth, BaseHeight)
SetWindowAllowResize( 1 ) 
 SetPrintSize(20)
UseNewDefaultFonts(1)
 
Camera_Init(0, 60, 100, 10, 1000)

 
// place a bigger object at 0-0 for bearings
CreateObjectBox(5, 10, 5)
 
// loop y first
for grid_y = 0 to 10
    // now loop the x
    for grid_x = 0 to 10
         
        id = CreateObjectBox(5, 5, 5)
        SetObjectPosition(id, 5*grid_x, 0, 5*grid_y)
        SetObjectColor(id, random(0, 255), random(0, 255), random(0, 255), 255)
         
    next
next
 
repeat
    Camera_Update(25, 0, 25) // set position to the center of your map
    
    Print("Mouse Left: Move")
    Print("Mouse Wheel: Zoom")
    
    Print("Camera Pos X: "+str(GetCameraX(1)))
    Print("Camera Pos Y: "+str(GetCameraY(1)))
    Print("Camera Pos Z: "+str(GetCameraZ(1)))
    
    Print("Camera Angle X: "+str(GetCameraAngleX(1)))
    Print("Camera Angle Y: "+str(GetCameraAngleY(1)))
    Print("Camera Angle Z: "+str(GetCameraAngleZ(1)))
    
    Print("Camera Angle: "+str(gCamera.angle))
    Print("Camera Elevation: "+str(gCamera.elevation))
    Print("Camera Distance: "+str(gCamera.distance))
    
    Print( ScreenFPS() )
    Sync()
  
until GetRawKeyPressed(27)


Type tCamera

	near as float
	far as float
	mmx as float
	mmy as float
	
	angle as float
	angle_min as float
	angle_max as float
	angle_speed as float
	
	elevation as float
	elevation_min as float
	elevation_max as float
	elevation_speed as float
	
	distance as float
	distance_min as float
	distance_max as float
	distance_step as float
EndType 
Global gCamera as tCamera 
 
Function Camera_Init(angle#, elevation#, distance#, near, far)
	
	gCamera.near=near
	gCamera.far=far
	SetCameraRange(1, gCamera.near, gCamera.far)
	
	gCamera.angle=angle#
	gCamera.angle_min=-1
	gCamera.angle_max=-1
	gCamera.angle_speed=0.5
	
	gCamera.distance=distance#
	gCamera.distance_min=50
	gCamera.distance_max=500
	gCamera.distance_step = 10
	
	gCamera.elevation=elevation#
	gCamera.elevation_speed=0.7
	gCamera.elevation_min=1.0
	gCamera.elevation_max=180.0
	
EndFunction

Function Camera_Update(origX#, origY#, origZ#)
 
	gCamera.mmx = GetPointerX() - gCamera.mmx
	gCamera.mmy = GetPointerY() - gCamera.mmy

	if GetPointerState() = 1
	gCamera.angle = gCamera.angle + gCamera.mmx * gCamera.angle_speed
	gCamera.elevation=ClampF(gCamera.elevation - gCamera.mmy * gCamera.elevation_speed, gCamera.elevation_min, gCamera.elevation_max)
	endif

	gCamera.distance = ClampF(gCamera.distance - GetRawMouseWheelDelta()*gCamera.distance_step, gCamera.distance_min, gCamera.distance_max)

	OrbitX = gCamera.distance * sin(gCamera.elevation) * sin(gCamera.angle) + origX#
	OrbitY = gCamera.distance * cos(gCamera.elevation) + origY#
	OrbitZ = gCamera.distance * sin(gCamera.elevation) * cos(gCamera.angle) + origZ#

	SetCameraPosition(1,OrbitX,OrbitY,OrbitZ)
	SetCameraLookAt(1,origX#,origY#,origZ#,0)

	gCamera.mmx = GetPointerX()
	gCamera.mmy = GetPointerY()
 
EndFunction
 
Function ClampF (value as float, min as float, max as float)
	if value>max
		value=max
	elseif value<min
		value=min
	endif
EndFunction value



Edit, the code will run stand alone if you want to see it working.