I thought I could use the sysGetLevel function to control this but haven't figured out how to make it work. The condition I've tried to setup for the "switch" function gets ignored and all the higher level items are being stocked, even in low level systems. I've also tried coding this using the "if" function instead and had the same problem.
Please take a look at my code and tell me what I'm doing wrong.
Code: Select all
<Items>
;; All Tinker stations should get these items
<RandomItem count="3d6"
criteria= "aswd -Illegal; -Military; -NotForSale;"
level= "3"
levelCurve= "2"
damaged= "100"
/>
(Block (syslevel)
(setq syslevel (sysGetLevel))
;; Only tinker stations spawned in level 4 and higher systems should get these items
(switch (gr syslevel 3)
(Block Nil
<RandomItem count="2d6"
criteria= "aswd -NotForSale;"
level= "5"
levelCurve= "2"
damaged= "100"
/>
<RandomItem count="3d6"
criteria= "aswd -NotForSale;"
level= "7"
levelCurve= "2"
damaged= "100"
/>
<RandomItem count="1d4+2"
criteria= "aswd +Military; -NotForSale;"
level= "7"
levelCurve= "2"
damaged= "100"
/>
<RandomItem count="1d4+2"
criteria= "aswd +Specialty; -NotForSale;"
level= "7"
levelCurve= "2"
damaged= "100"
/>
)
)
)
</Items>