Nuke's code chunk shouldn't fit in FRED; there's a maximum of 32 characters for any string argument.
Your best bet is to define it as two functions like so in scripting.tbl:
$GameInit: [
drawSquadron = new function(n_texname, n_header, n_body)
tex = gr.loadTexture(n_texname)
header = n_header
body = n_body
gr.drawImage(tex,100, 600)
gr.setColor(150,150,255,200)
drawString(header, 500, 600)
gr.setColor(200,200,200,200)
drawString(body, 500, 600)
end
drawSquadronIndex = new function(n_index)
if n_index == 1 then
drawSquadron("Logo", "SQUADRON NAME", "193rd Heavy Support Squadron of the AP 2nd Battlegroup, Aldebaran, APD Gryphus ecc.")
elseif n_index == 2 then
drawSquadron("Logo 2", "SQUADRON NAME 2", "194th Joker Interception Squadron of the Volition Bravos Battlegroup, Vasuda Prime, GTVA Collosus 37 ecc.")
end
end
]
#End
What this does is define two functions: drawSquadron(), and drawSquadronIndex(). drawSquadron() contains the code to draw the image, text, and whatever else is wanted for each squadron.
drawSquadronIndex() calls drawSquadron() with the squadron logo, the squadron name, and the squadron descriptive text. Only these squadrons will be accessible by FRED; if you wanted to add another, you would insert another pair of lines before the "end" just after the second drawSquadron() call in drawSquadronIndex(). You would add:
elseif n_index == 3 then
drawSquadron("Logo 3", "SQUADRON NAME 3", "Kappa Wing, KIA in the nebula beyond Gamma Draconis")
to get:
if n_index == 1 then
drawSquadron("Logo", "SQUADRON NAME", "193rd Heavy Support Squadron of the AP 2nd Battlegroup, Aldebaran, APD Gryphus ecc.")
elseif n_index == 2 then
drawSquadron("Logo 2", "SQUADRON NAME 2", "194th Joker Interception Squadron of the Volition Bravos Battlegroup, Vasuda Prime, GTVA Collosus 37 ecc.")
elseif n_index == 3 then
drawSquadron("Logo 3", "SQUADRON NAME 3", "Kappa Wing, KIA in the nebula beyond Gamma Draconis")
end
FRED
This way, in FRED you can say:
script-eval
-- drawSquadronIndex(1)
And it will output the first squadron. To display other squadrons you simply change the number, and this gets around the 32-character limit.
(DISCLAIMER: This example code is based on Nuke's example, and I just wrote this while taking a break from Java coding. So there may be some minor problems, but the overall code chunk should be correct.)