I thought about that after posting. Here it is.
#Conditional Hooks
$State: GS_STATE_MAIN_MENU
$On Frame: [
if init == nil then
randomChoice = {"BTL-A4 Y-Wing","T-65c X-Wing","T.I.E. Fighter","TIE/In Interceptor"} --Put your ship classes in quotes here
-- getShipClass seems to be replaced with ShipClass[]
numChoices = table.getn(randomChoice)
-- randomShip = tb.getShipClass(randomChoice[math.random(1,numChoices)])
randomShip = tb.ShipClasses[randomChoice[math.random(1,numChoices)]]
shipName = randomShip.Name
init = 42
end
logo = "fotg" --This is the name of the logo you want. No extension needed
imgWidth = gr.getImageWidth(logo)
imgHeight = gr.getImageHeight(logo)
screenWidth = gr.getScreenWidth()
screenHeight = gr.getScreenHeight()
renderX1 = screenWidth * 0.01
renderX2 = screenWidth * 0.8
renderY1 = screenHeight * 0.1
renderY2 = screenHeight * 0.9
rendermidX = (renderX1+renderX2)/2
imageX = (screenWidth*0.5)-imgWidth/2
imageY = 0
rotConst = 7 --Modify this to make it turn faster to slower
if rotate_pct then
rotate_pct = rotate_pct + rotConst*ba.getFrametime()
if rotate_pct > 100 then
rotate_pct = rotate_pct - 100
end
else
rotate_pct = 40
end
randomShip:renderTechModel(renderX1, renderY1, renderX2, renderY2, rotate_pct)
gr.setColor(255,255,255)
gr.drawString(shipName,rendermidX-gr.getStringWidth(shipName)/2,renderY2)
--Handle using the middle mouse to force random ship selection
--Because we can only tell whether the button was down, we have to check for it last frame
--by setting the variable middle_was_down
--ms.isButtonDown became io.isMouseButtonDown, and takes an enumeration now
if not middle_was_down then
-- middle_was_down = ms.isButtonDown("Middle")
middle_was_down = io.isMouseButtonDown(MOUSE_MIDDLE_BUTTON)
force_random = middle_was_down
-- elseif ms.isButtonDown("Middle")==true then
elseif io.isMouseButtonDown(MOUSE_MIDDLE_BUTTON)==true then
middle_was_down = true
force_random = false
else
middle_was_down = false
force_Random = false
end
--Function to handle a section every frame
section = function(name, event, num)
--MENU COLOR
margin = gr.getScreenHeight()/6
gr.setColor(255, 255, 255)
--Get corner coordinates for this box
x1 = gr.getScreenWidth()-180
y1 = margin*num+20
x2 = gr.getScreenWidth()-21
y2 = margin*num+55
--When the mouse is OVER this section...
-- ms.getX and getY are now in io, as io.getMouseX and getMouseY
-- if ms.getX() > x1 and ms.getX() < x2 and ms.getY() > y1 and ms.getY() < y2 then
if io.getMouseX() > x1 and io.getMouseX() < x2 and io.getMouseY() > y1 and io.getMouseY() < y2 then
--Draw the dark green insides
gr.setColor(96, 96, 96)
gr.drawRectangle(x1, y1, x2, y2, true, false)
--Draw the little target lines now
gr.setColor(255, 255, 255)
x = x1+(x2-x1)/2
y = margin*num
--Top target line
gr.drawLine(x, y, x, y+15)
--Bottom target line
y = margin*num+65
gr.drawLine(x, y, x, y+15)
--Left target line
x = gr.getScreenWidth()-200
y = margin*num+40
gr.drawLine(x, y, x+15, y)
--Right target line
x = gr.getScreenWidth()-16
gr.drawLine(x, y, x+15, y)
--Handle the button click
-- if ms.isButtonDown("Left") then
if io.isMouseButtonDown(MOUSE_LEFT_BUTTON) then
ba.setEvent(event)
gr.drawRectangle(x1, y1, x2, y2, false, false)
end
end
--Draw the outline
gr.drawRectangle(x1, y1, x2, y2, false, false)
--Color should always be pure green, so I'll skip setting the color for the name
gr.drawString(name, x1 + ( (x2-x1) - gr.getStringWidth(name) ) / 2, margin*num+35)
end
if ts.isCurrentPlayerMulti()==true then
section("Multiplayer", "GS_EVENT_MULTI_JOIN_GAME", 0)
else
section("Ready Room", "GS_EVENT_NEW_CAMPAIGN", 0)
end
section("Campaign Room", "GS_EVENT_CAMPAIGN_ROOM", 1)
section("Tech Room", "GS_EVENT_TECH_MENU", 2)
section("Barracks", "GS_EVENT_BARRACKS_MENU", 3)
section("Options", "GS_EVENT_OPTIONS_MENU", 4)
section("Exit", "GS_EVENT_QUIT_GAME", 5)
gr.drawImage(logo, imageX, imageY)
]
#End
Also attached for ease of downloading.
I wondered about where it would come from, since it only seemed to happen when multi didn't seem to be working. When it was working I saw no such error in the log. It also spits them out rather fast, the log grows about 20 kb a second while that window is open.
[attachment deleted by ninja]