Ive been reading Phaelaxs RTS tutorial and trying to make a RTS but making UDTs wont work. DBP says there is some sort of syntax error but it doesnt highlight anything. Heres the code:
type basicUnitProperties
name as string
maxLife as integer
range as integer
speed as integer
damage as integer
morale as integer
class as integer
effect as integer
endtype
type basicUnitActions
isMoving as boolean
isAttacking as boolean
isSelected as boolean
isFleeing as boolean
endtype
dim characterType(7) as basicUnitProperties
#constant SOLDIER = 1
#constant WORKER = 2
#constant TANK = 3
#constant PLANE = 4
#constant DRONE = 5
#constant SPY = 6
#constant SNIPER = 7
characterType(SOLDIER).name = "Marine"
characterType(SOLDIER).maxLife = 80
characterType(SOLDIER).damage = 40
characterType(SOLDIER).range = 160
characterType(SOLDIER).speed = 10
characterType(SOLDIER).morale = 100
characterType(SOLDIER).class = 1
characterType(SOLDIER).effect = 1
characterType(WORKER).name = "MechBot"
characterType(WORKER).maxLife = 120
characterType(WORKER).damage = 60
characterType(WORKER).range = 0
characterType(WORKER).speed = 15
characterType(WORKER).morale = 100
characterType(WORKER).class = 1
characterType(WORKER).effect = 1
characterType(TANK).name = "Ceasar Tank"
characterType(TANK).maxLife = 300
characterType(TANK).damage = 80
characterType(TANK).range = 140
characterType(TANK).speed = 10
characterType(TANK).morale = 100
characterType(TANK).class = 2
characterType(TANK).effect = 1
characterType(PLANE).name = "Phenomenon II"
characterType(PLANE).maxLife = 200
characterType(PLANE).damage = 80
characterType(PLANE).range = 100
characterType(PLANE).speed = 30
characterType(PLANE).morale = 100
characterType(PLANE).class = 3
characterType(PLANE).effect = 1
characterType(DRONE).name = "Transport"
characterType(DRONE).maxLife = 150
characterType(DRONE).damage = 0
characterType(DRONE).range = 0
characterType(DRONE).speed = 50
characterType(DRONE).morale = 100
characterType(DRONE).class = 3
characterType(DRONE).effect = 1
characterType(SPY).name = "Assasin"
characterType(SPY).maxLife = 40
characterType(SPY).damage = 1000
characterType(SPY).range = 0
characterType(SPY).speed = 10
characterType(SPY).morale = 100
characterType(SPY).class = 9
characterType(SPY).effect = 1
characterType(SNIPER).name = "Sniper"
characterType(SNIPER).maxLife = 70
characterType(SNIPER).damage = 80
characterType(SNIPER).range = 200
characterType(SNIPER).speed = 15
characterType(SNIPER).morale = 100
characterType(SNIPER).class = 6
characterType(SNIPER).effect = 1