yeh I use these to/ move the 3D cursor around so it can snap together,but how do i get the radius value with these?
I wanna place objects and have that value stored rather than just using a fixed value
the way i do now is:
function casterplayer(ObjID,oldx#,oldy#,oldz#,rad#,cm)
newx#=getobjectx(ObjID)
newy#=getobjecty(ObjID)
newz#=getobjectz(ObjID)
select cm
case 0
pobj= Objectspherecast(0,oldx#,oldy#,oldz#,newx#,newy#,newz#,rad#)
if pobj>0
//SetCameraPosition(1,newx#,newy#+45.0,newz#)
//setobjectposition(player,newx#,newy#,newz#)
objd=GetObjectRayCastHitID(0)
for n=1 to objectcounter
if object[n].id=objd
if object[n].group=collectablegroup and GetObjectVisible(object[n].id)=1
setobjectvisible(object[n].id,0)
setobjectposition(object[n].id,-100000000,-100000000,-1000000)
setobjectcolor(object[n].id,255,0,255,255)
endif
if object[n].slave>0
print("slave id# "+str(object[n].slave) +"hit master id "+str(object[n].master) )
endif
if object[n].value1=666
print("DEAD!!!")
endif
if object[n].group=enemygroup
print("Ouch!!!")
exit
endif
exit
endif
next n
endif
endcase
case 1
pobj= Objectraycast(0,oldx#,oldy#-40,oldz#,newx#,newy#,newz#)
if pobj>0
newx#=GetObjectRayCastX(0)
newy#=GetObjectRayCastY(0)
newz#=GetObjectRayCastZ(0)
//SetCameraPosition(1,newx#,newy#+45.0,newz#)
//setobjectposition(player,newx#,newy#,newz#)
objc=GetObjectRayCastHitID(0)
for n=1 to objectcounter
if object[n].id=objc
if object[n].value1=1
setobjectcolor(object[n].id,255,0,0,255)
endif
if object[n].value1=666
print("DEAD!!!")
endif
exit
endif
if object[n].group=enemygroup
print("Ouch!!!")
exit
endif
next n
endif
endcase
endselect
endfunction objc
calling the function like so:
casterplayer(player[playerpointer].id,oldx#,oldy#,oldz#,30,0)
the 30 value is the radius,the 0 value after that is the mode as the function has a couple,mode 0 for sphere cast, and mode 1 for raycast,mode 1 obviously doesnt need a radius!but in mode 0 of course this fixed value is no good as i want it to be worked out based on the objects size, which could be anything!
Hail to the king, baby!