I am still trying to delete unwanted limbs from a model to be replaced by an object, my code is abit messy now as i took out the functions to test, but anyhow here is what i have so far:
Function make_objects()
`load object "leveltest2.dbo",2001
load object "roomtest.x",2001
position object 2001,0,0,0
load image "stripes.png",1
load image "rust.bmp",2
perform checklist for object limbs 2001
v=checklist quantity()
for c=v to 1 step -1
`print checklist string$(c)
if limb exist(2001, c)=1
name$(c)=limb texture name(2001,c)
if name$(c)="brick2.png" or name$(c)="brick3.png" or name$(c)="brick4.png"
`v2$="YEH!!"
rem get the x,y,z coords of the limb we are gunna delete
limbx#= LIMB POSITION X(2001, c)
limby#= LIMB POSITION y(2001, c)
limbz#=LIMB POSITION z(2001, c)
rem place a baddy where the limb we dont want is
load object "baddy.x",baddiecount
texture object baddiecount,2
position object baddiecount,limbx#,limby#,limbz#
inc baddiecount
rem now remove the limb we dont want
tt$=tt$+str$(c)+" " + str$(limbx#) + " " +str$(limby#) + " " + str$(limbz#) + " " + name$(c) + " "
remove limb 2001,c
endif
endif
next
phy make rigid body static mesh 2001
make light 1
color light 1,255,255,255
position light 1,0,120,0
endfunction
the code above kinda works,the limbs get deleted... but it is placing the 'baddie' at 0,0,0 which is not the limbs origin, I can see that by printing tt$ in the main loop!
** edit **
I made all vars global also
Hail to the king, baby!