// this example should work with AGK V1 and V2
// create an object with a randomly generate id number between 1 and 10
CreateObjectCylinder(random(1,10),30,20,16)
// create a directional light
CreateLightDirectional(1,-1,-1,0.5,255,255,255)
// position and orientate camera
SetCameraPosition(1,0,40,-70)
SetCameraLookAt(1,0,0,0,0)
// main loop
do
// determine if object exits
// scan through all possible object id (i.e. 1 to 10)
for i = 1 to 10
// if the object exists then print its id to the screen
if GetObjectExists(i) = 1
Print("the object's id number is : " + str(i))
endif
next i
sync()
loop
Help make AGK better by submitting an example for this command! (All examples are subject to approval)