' ********************************************** ' Created on (DD/MM/YYYY) 16/05/2006 at 15:21:35 ' ' SET TABS AT 8 ' ********************************************** ' ************************************************************ ' Version, layout limits and simulator angle ' ************************************************************ #Version, 3 #Limits,-8, 1,-8, 0 #SimAngle, 0 #MinDelay, 0 #MaxDelay, 0 ' ************************************************************ ' Fonts, messages, colours, background ' ************************************************************ font "Arial","SEB" as 1 'Define Arial as font 1 font "Times New Roman","REB" as 2 'Define Times as font 2 font 1 'Default font - Arial Ad1$="BERETTA": Ad1Font=2 'First ad text and font Ad2$="Lyalvale Express": Ad2Font=1 'Second ad text and font rgb 128, 128, 128 as 0 '0 Grey - for fog rgb 255, 0, 0 as 1 '1 Red rgb 29, 207, 33 as 2 '2 Green rgb 0, 0, 255 as 3 '3 Blue rgb 228, 253, 60 as 4 '4 Yellow rgb 128, 128, 128 as 5 '5 Grey rgb 128, 64, 0 as 6 '6 Brown rgb 255, 102, 51 as 7 '7 Orange rgb 228, 253, 60 as 8 '8 Sun rgb 0, 128, 0 as 9 '9 Grass rgb 255,255,255 as 10 '10 White for textured sky rgb 60,60,60 as 11 '11 Dark grey for shadows rgb 0,0,0 as 12 '12 Black texture "SKY128" as 1 'Texture file used for sky texture "BROWN" as 2 'Texture used for shot string texture "GRASS" as 3 'Grass texture 1 'Select sky texture shadow 11 'Grey shadows north 0 'North is set at 0 degrees - straight ahead clip 0.1,1000, 0.01,10**7 light 180,20,10**5, 0.5,1,0.5,1, 0.1,0.1 ;Draw sky Push : Texture 1 : Colour 10 : View 2 Set Effects off, Background on, Texture on, Ambient on Scale 10**5 : Sphere 0,0,1 : Pop ;Draw sun Push : Set Effects off, Background on, Ambient on : Colour 8 Scale 3000 : Move Light : Sphere -1,0,3 : Pop ;Draw ground Push : Set Effects off, Background on, Ambient on : Colour 9 Scale 1000 : Polygon 5 : Scale 1000 : Polygon 5 : Pop '******************************************** ' Objects used by the Course Designer program '******************************************** #Object, "Trap","Kastare",1,1,0,0,1,20,0,10,20,20,20,0,20,0,"Standard",0,0,0,0,8,100,20,90,"DryFire","Arial","Large",5,5,0 #Object, "Stand","Stand 2",2,1,-1,0,0,20,0,10,20,20,20,0,25,0,"Standard",0,0,0,0,8,100,20,90,"DryFire","Arial","Large",5,5,0 #Object, "Wall","Wall 4",4,-8,-8,0,-8,42,0,10,20,20,20,0,25,0,"Standard",0,0,0,0,2,15,.5,0,"Jägarexamens provduva","Arial","Small",5,5,0 '******* ' Stands '******* #Stand, "Stand 2", 1,-1, 0, 90 reset: rotz 90: move 1,-1, 0 : DrawStand 2, 0, 0 '***************************** ' Traps (including Starshoots) '****************************** trap 1 , "Kastare", 1, 0, 0, 1, 20, 0, 0, 20, 20, 20, 0, 20, 0 reset: colour 5: rotz 90: move 1, 0, 0: DrawTrap 3, 0 reset: colour 1: line 1, 0, 0, 1, 20, 0 #Trap , 1 , 99 , Standard '************* ' Target order '************* #Target, "Target 1",1,1,0,0,90 '****** ' Trees '****** '****** ' Hills '****** '******* ' Fences '******* '****** ' Walls '****** reset: wall -8,-8,15,.5,2,0,1,1,"Jägarexamens provduva" ' ************************************************************ ' Standard routines and functions - DO NOT EDIT ' ************************************************************ Function AddShooter x, y, z, a, p, h ' Only one shooter on one stand to be displayed { Object 98 ' To allow current shooter to be deleted { enter push scale h,h,h: rotz a+90: move x, y, z: model 1,"shooter",p ' Scale, rotate, locate & draw shooter pop exit } } Function StandLabel Label$ ' Draw label for the stand { enter push: colour 5: scale 1,.4,.02: rotx -30: cube: font 1: pop push: colour 1: scale .3,.3,.1: rotx -30: move .5,.1,0: textcentre Label$: pop exit } Function Aim1 m ' To aim position { enter push: pause m,.5: animate m,4: pause m,.5: animate m,6: pop exit } Function Aim2 m ' Down from aim position { enter push: pause m,1: animate m,7: pause m,.5: animate m,5: pop exit } Function Grid s, e, i ' Only one grid displayed at one time { Object 99 ' To allow grid to be deleted { enter x=s While x<(e+i) { colour 11 if x=s or x=e { colour 7 } if x=0 ' Origin { push: colour 4: scale .5,.5,.5: move 0,0,0: sphere 0,0,3: pop ' Yellow hemisphere push: colour 3: scale .1, .1, 2: move 0,0,0: cylinder 12,1,1,1: pop ' Pillar colour 10 } line x,s,0, x,e,0: line s,x,0, e,x,0 x=x+i } exit } } Function Fence Length ' Draw fence { enter Length=Length-2.4: t=0.06: np=10: lp=(Length/2)/np ' 10 posts colour 4: DrawGate ' Gate colour 6 push ' Left side scale -Length/2 ,.2,.2: rotz 0 : move -1.4 , 0 ,0: cube: movez 1: cube: movez 1: cube ' Rails pop push scale 2.2,.2,.2: roty 90: : rotz 0 : move -1.4 , 0 ,2.2 x=-1: while x< np { cube: move -lp , 0 ,0: x=x+1 } ' Posts pop push ' Right side scale Length/2 ,.2,.2: rotz 0 : move 1.2 , 0 ,0: cube: movez 1: cube: movez 1: cube ' Rails pop push scale 2.2,.2,.2: roty 90: : rotz 0 : move 1.2 , 0 ,2.2 x=-1: while x< np { cube: move lp , 0 ,0: x=x+1 } ' Posts pop exit } Function DrawShot ObjectNumber, ClayX, ClayY, ClayZ, ShotX, ShotY, ShotZ, Radius, ClayRotX, ClayRotZ, ShotRotX, ShotRotZ { Object ObjectNumber { push rad=0.2: thick=0.03 rotx ClayRotX: rotz ClayRotZ: move ClayX, ClayY, ClayZ: colour 7 enter view 2 scale rad,rad,thick: push: movez -thick: cylinder 20,1,0,1: pop view 1 scale 0.8,0.8,1: cylinder 20,1,0,1 scale 0.8,0.8,1: movez thick: cylinder 20,1,0,1 exit pop texture 2: set texture on: set translucent on: translucent .6 rotx ShotRotX : rotz ShotRotZ: scale Radius move ShotX, ShotY, ShotZ: colour 10: sphere -0.9, 1, 3, 2 } } Function DrawStand Size, Height, ShooterFlag ' Size is the safety fence size ' Height is height off ground ' ShooterFlag no longer used { enter if Height > 0 { Platform Size*1.5, Height ' Platform } movez Height if Size > 0 { SafetyFence 1, Size, .1 ' Safety fence } exit } Function DrawTrap Size, Height ' Size is platform size (square) ' Height must be a multiple of Size (or zero) { enter push: colour 2: scale Size,Size,.2: move 0-Size/2,0-Size/2,Height: cube: pop ' Platform push: colour 1: scale 1,1,1: move -.5,-.5,Height+.2: cube: pop ' Trap on platform if Height > 0 { push: colour 4: scale .5,.5,.5: sphere 0,0,3: pop ' Find me 1 push: colour 3: scale .2,.2,.2: sphere -1,0,3: pop ' Find me 2 t=.04: q=0 while q < Height/Size { push: fz=q*Size: scale Size: Layer fz,Size: pop: q=q+1 ' Layers } colour 6 ' Brown ladder push scale .03,.1,Height+Size/4: move 0,-Size/2-.2,0: cube: movex .3: cube ' Ladder sides pop q=Size*q/.25+2 while q>0 { push: scale .3,.1,.03: move 0,-Size/2-.2,q*.25: cube: pop: q=q-1 ' Ladder rungs } } exit } Function Layer z,s ' Each layer of a tower { push: move 0,0,z: OpenPanel: pop ' Front push: move 0,s-s*t,z: OpenPanel: pop ' Back push: rotz 90: move 0,0,z: OpenPanel: pop ' Left push: rotz 90: move -Size+s*t,0,z: OpenPanel: pop ' Right } Function OpenPanel ' Panel with diagonals { enter push: scale 1,t,t: move -.5,-.5,0: cube: movez 1-t: cube: pop ' Bottom/top push: scale t,t,1: move -.5,-.5,0: cube: movex 1-t: cube: pop ' Sides push: scale 1.414-t-t,t,t: roty -45: move -.5+t,-.5,0: cube: pop ' Diagonal push: scale 1.414-t-t,t,t: roty 45: move -.5,-.5,1-t: cube: pop ' Diagnonal exit } Function Platform Size, Height ' Draw platform for shooter to stand on { enter push: colour 2: scale Size,Size,Height: move -Size/2,-Size/2,0: cube: pop ' Platform push colour 6: x=Height/.5-1 ' Number of steps move -Size/2,-Size/2,0 while x>0 { movex -.5 enter: scale .5, Size, x*.5: cube: exit ' Draw steps x=x-1 } pop exit } Function SafetyFence MatWidth, FenceSize, BarThickness ' Draw safety fence round shooter { enter push: colour 2: scale MatWidth*.7071, MatWidth*.7071, 0: polygon 4: pop ' Shooting mat move -FenceSize/2, FenceSize/2, 0 enter colour 5: scale BarThickness, BarThickness, FenceSize x=0 while x<2 ' Sides { push movey -FenceSize*x: cube ' Left vertical edge movex FenceSize-BarThickness: cube ' Right vertical edge roty 90: movez FenceSize: cube ' Bottom bar movez FenceSize/4: cube ' Lower bar movez FenceSize/4: cube ' Middle bar movez FenceSize/4: cube ' Higher bar movez FenceSize/4: cube ' Top bar x=x+1 pop } rotx 90 ' Front bars movex FenceSize-BarThickness cube ' Bottom bar movez FenceSize/4: cube ' Middle bar colour 1: movez FenceSize/4: cube ' Top bar exit exit } Function DrawGate ' Gate with four panels and side posts { enter push: move -.5,.5,0: OpenPanel: movex 1: OpenPanel: movez 1: OpenPanel: movex -1: OpenPanel: pop p=.2 push: scale p,p,2.2: move -1-p,-p/2,0: cube: movex 2+p: cube: pop exit } Function Wall x, y, l, w, h, a, f, s, t$ ' Wall: x-centre, y-centre, length, width, height, angle, font, size, text { enter b=Atan(w/l): d=(w/Sin(b))/2: x1=x-d*Cos(a+b): y1=y-d*Sin(a+b) w1=w/2+s/10: x2=x+w1*sin(a): y2=y-w1*cos(a) push: colour 4: scale l,w,h: rotz a: move x1, y1, 0: cube: pop push: colour 1: scale s,s,s/10: rotx 90: rotz a: move x2,y2, (h-s)/2: font f: textcentre t$: pop exit } Function Tree TrunkWidth,TrunkHeight,TrunkTaper ' Tree drawing function { enter push scale TrunkWidth/2,TrunkWidth/2,TrunkHeight : colour 6 cylinder 10,TrunkTaper,1,0 pop scale 0.5,0.5,1-TrunkHeight : movez TrunkHeight : colour 2 cone 16,1 exit }