hi, i have just started to write a level editor for my own projects, using the limb commands seemed the most efficient way but i cannot seem to get them in the position of my 3d cursor, here is the code:
Rem Project: my3deditor
Rem Created: Thursday, August 29, 2013
Rem ***** Main Source File *****
Autocam Off
Sync On: Sync Rate 60: Sync
set window off
global cursx#
global cursy#
global cursz#
global camx#
global camy#
global camz#
global addz#
global cursorobject = 1
global limbnum=1
global distance#=400.0
global height#=100.0
global smooth#=25.0
global angle#
global sizex#=25.0
global sizey#=25.0
global sizez#=25.0
global objectnum =1
global run=0
global parentobject=6000
type blocks
xlocation# as float
ylocation# as float
materialnumber as integer
objectnum as integer
endtype
dim block(5000) as blocks
angle#=0.0
startup()
DO
poop:
tim=tim+1
if tim>4
tim=0
endif
if tim=0
IF upkey()=1
cursz#=cursz#+sizez#
ENDIF
IF downkey()=1
cursz#=cursz#-sizez#
ENDIF
if leftkey()=1
cursx#=cursx#-sizex#
endif
if rightkey()=1
cursx#=cursx#+sizex#
endif
if spacekey()=1
r=object exist(parentobject)
select r
case 0
make object cube parentobject,25
scale object parentobject,100+addx#,100,100+ addz#
position object parentobject,cursx#,cursy#,cursz#
`texture object parentobject,1
goto poop
endcase
case 1
make mesh from object 1,cursorobject
add limb parentobject,limbnum,1
offset limb parentobject,limbnum,cursx#,cursy#,cursz#
`texture limb parentobject,limbnum,1
inc limbnum
delete mesh 1
endcase
endselect
endif
endif
r=scancode()
` print r
if r=30
cursy#=cursy#+sizey#
endif
if r=44
cursy#=cursy#-sizey#
endif
if r=72
addz#=addz#+100
scale object cursorobject,100+addx#,100,100+addz#
endif
if r=80 and addz#>=0
addz#=addz#-100
scale object cursorobject,100+addx#,100,100+addz#
endif
if r=77
addx#=addx#+100
scale object cursorobject,100+addx#,100,100+addz#
endif
camx#=cursx#
camy#=cursy#+5
camz#=cursz#-205
`position camera 0,camx#,camy#,camz#
` point camera 0,cursx#,cursy#,cursz#
position object cursorobject,cursx#,cursy#,cursz#
set camera to follow cursx#,cursy#,cursz#,angle#,distance#,height#,smooth#,1
sync
LOOP
function startup()
`load image "brick.png",1
make matrix 1,2000,2000,25,25
position matrix 1,0,0,0
make object cube cursorobject,25
ghost object on cursorobject
ENDFUNCTION
thanks for any help!
*** edit, sorry this is the correct code,i changed it back from something using wrong vars! ****
Hail to the king, baby!
http://davidjohnwheeler.blogspot.co.uk