Author Topic: Scripts for C08302008  (Read 9825 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Scripts for C08302008


tex_test-sct.tbm
Swaps the textures for the target ship. Now, you too can turn anything into a Shivan (mediaVPs) or some kind of bizarre glowstick thing (retail data).
Code: [Select]
#Conditional Hooks
$Application: Freespace 2
$On Game Init: [
--Load the replacement texture
g_ReplaceTexture = gr.loadTexture("fighter2s-02-glow")

--Use interface texture for a backup, since these are usually around
if not g_ReplaceTexture then
g_ReplaceTexture = gr.loadTexture("2_BAB_050002")
end
]

$State: GS_STATE_GAME_PLAY
$Keypress: W
$On Key Released: [
--Signal that we want to do a texture switch
g_Switch = true
]

$State: GS_STATE_GAME_PLAY
$On Frame: [
local playerShip = hv.Player
local targetShip = nil

if playerShip and playerShip:isValid() then
targetShip = playerShip
local tgt = playerShip.Target
if tgt:isValid() then
targetShip = tgt
end
end

if targetShip and targetShip:isValid() then
local texs = targetShip.Textures

--Switch textures
if g_Switch then
texReplace = g_ReplaceTexture

--Textures were already replaced; reset them
if texs[1] ~= texReplace then
texReplace = nil
end

--Go through all the textures and replace them
for i=1,#texs do
texs[i] = texReplace
end

--Signal switch complete
g_Switch = false
end

--Show texture list
gr.setColor(255,255,255)
for i=1,#texs,1 do
local tx = texs[i]
if tx:isValid() then
gr.drawString("TEXTURE: " .. tx:getFilename())
else
gr.drawString("TEXTURE: <NONE>")
end
end
end
]
#End

shipviewer-sct.tbm
An updated version of the ship viewer in the wiki. Features keypresses, as well as visual help. You can now get to a specific ship much faster, as well.

Note that this script starts before anything else, so you can't get to the rest of the game when running the script.

Code: [Select]
#Conditional Hooks
$Application: Freespace 2
$On Game Init: [
g_Heading = 40
g_Pitch = 0
g_Bank = 0
g_ShipClassIndex = 1
g_Distance = 1.3

g_ShowHelp = true
g_ShowInfo = true

function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end

function string.ends(String,End)
   return End=='' or string.sub(String,-string.len(End))==End
end
]

$Application: Freespace 2
$State: GS_STATE_INITIAL_PLAYER_SELECT
$On Key Released: [
if hv.Key == "Esc" then
ba.postGameEvent(ba.GameEvents['GS_EVENT_QUIT_GAME'])
elseif hv.Key == "H" then
g_ShowHelp = (not g_ShowHelp)
elseif hv.Key == "I" then
g_ShowInfo = (not g_ShowInfo)
elseif hv.Key == "Pad +" or hv.Key == "Shift-=" then
g_Distance = g_Distance-0.1
elseif hv.Key == "Pad -" or hv.Key == "-" then
g_Distance = g_Distance+0.1
elseif hv.Key == "Left Arrow" then
g_ShipClassIndex = g_ShipClassIndex - 1
if g_ShipClassIndex < 1 then
g_ShipClassIndex = #tb.ShipClasses
end
elseif hv.Key == "Right Arrow" then
g_ShipClassIndex = g_ShipClassIndex + 1
if g_ShipClassIndex > #tb.ShipClasses then
g_ShipClassIndex = 1
end
elseif string.starts(hv.Key, "Alt-") then
num = tonumber(string.sub(hv.Key,-1))
if num >= 0 and num < 10 then
g_ShipClassIndex = math.floor(g_ShipClassIndex/100)*100+num*10
end
elseif string.starts(hv.Key, "Shift-") then
num = tonumber(string.sub(hv.Key,-1))
if num >= 0 and num < 10 then
g_ShipClassIndex = num*100
end
end

--Loop/sanity checking
if g_ShipClassIndex < 1 then
g_ShipClassIndex = 1
elseif g_ShipClassIndex > #tb.ShipClasses then
g_ShipClassIndex = #tb.ShipClasses
end
]
$On State Start: []
+Override: true
$On State End: []
+Override: true
$On Frame: [
if g_ShipClassIndex then
--If no triggers, do normal mouse stuff
--Left changes heading
--Middle changes g_Pitch
--Right changes g_Bank
if io.isMouseButtonDown(MOUSE_LEFT_BUTTON) then
g_Heading = (1-io.getMouseX()/gr.getScreenWidth())*100
end
if io.isMouseButtonDown(MOUSE_MIDDLE_BUTTON) then
g_Pitch = (1-io.getMouseY()/gr.getScreenHeight())*100
end
if io.isMouseButtonDown(MOUSE_RIGHT_BUTTON) then
g_Bank = io.getMouseX()/gr.getScreenWidth()*100
end

--Render setup
gr.setColor(255, 255, 255)

--Render help
if g_ShowHelp then
gr.drawString("h       - Toggle help", gr.getScreenWidth()-250, gr.getScreenHeight()-150)
gr.drawString("i       - Toggle info")
gr.drawString("+       - Zoom in")
gr.drawString("-       - Zoom out")
gr.drawString("-->     - Next ship")
gr.drawString("<--     - Previous ship")
gr.drawString("Alt-#   - Skip to x#0th ship")
gr.drawString("Shift-# - Skip to #00th ship")
gr.drawString("Esc     - Quit")
end

--Finally, render the ship
local renderShipClass = tb.ShipClasses[g_ShipClassIndex]
if renderShipClass:isValid() then
--Render info
if g_ShowInfo then
gr.drawString(renderShipClass.Name .. " (" .. g_ShipClassIndex .. "/" .. #tb.ShipClasses .. ")", 10, 10)
end
renderShipClass:renderTechModel(0, 0, gr.getScreenWidth()-1, gr.getScreenHeight()-1, g_Heading, g_Pitch, g_Bank, g_Distance)
end
end
]
+Override: true
#End

mainhall_test-sct.tbm
I saved the best for last...

This started out as a small test script of having a mission play in the main hall. Then I switched in "Endgame" instead of "Their Finest Hour" as the test mission and got an absolutely perfect mainhall. I used the buttons from chief's repost of the old main menu mission script. Play this with the MediaVPs and be amazed. Seriously, this looks absolutely incredible, especially considering this is just using the original :V: mission.

Did I mention that ships warp in and start fighting? The beam and flak fire? I guess I did now.

The downside: While the mission on the main menu works, the rest of the game behaves...unusually. Exiting a mission takes you out of the game. Much of the interface seems to work, though.

Code: [Select]
#Conditional Hooks
$Application: Freespace 2
$On Game Init: [
--Function to handle a section every frame
section = function(name, event, num)
--MENU COLOR
local xmargin = gr.getScreenWidth()/8
local ymargin = gr.getScreenHeight()/8

--Get corner coordinates for this box
local x1 = xmargin
local y1 = ymargin*num
local x2 = x1+159
local y2 = y1+35

--When the mouse is OVER this section...
if io.getMouseX() > x1 and io.getMouseX() < x2 and io.getMouseY() > y1 and io.getMouseY() < y2 then
--Draw the inside box
gr.setColor(0, 255, 0)
gr.drawRectangle(x1+5, y1+5, x2-5, y2-5, false, false)

--Draw the little target lines now
local x = x1+(x2-x1)/2
local y = y1-20

--Top target line
gr.drawLine(x, y, x, y+15)

--Bottom target line
y = y2+10
gr.drawLine(x, y, x, y+15)

--Left target line
x = x1-20
y = y1+17
gr.drawLine(x, y, x+15, y)

--Right target line
x = x2+5
gr.drawLine(x, y, x+15, y)

--Handle the button click
if io.isMouseButtonDown(MOUSE_LEFT_BUTTON) then
ba.postGameEvent(ba.GameEvents[event])
gr.drawRectangle(x1, y1, x2, y2, false, false)
end
end

--Draw the outline
gr.setColor(255, 255, 255)
gr.drawRectangle(x1, y1, x2, y2, false, false)

--Draw the name
gr.drawString(name, x1 + ( (x2-x1) - gr.getStringWidth(name) ) / 2, y1+15)
end
]
$On Mission Start: [
g_missionLoaded = nil
g_splashScreen = nil
]

$Application: Freespace 2
$State: GS_STATE_MAIN_MENU
$On State Start: []
+Override: true
$On State End: []
+Override: true
$On Frame: [
if not g_splashScreen then
--Don't need cursor
io.setCursorHidden(true)

--Draw splash image
local tex = gr.loadTexture("2_PreLoad.dds")
if tex:isValid() then
gr.drawImage(tex, 0, 0, gr.getScreenWidth(), gr.getScreenHeight())
end

--Draw "Loading..."
gr.setColor(255, 255, 255)
gr.CurrentFont = gr.Fonts['font02']
local loadString = "Loading..."
local x = (gr.getScreenWidth()-gr.getStringWidth(loadString))/2
local y = (gr.getScreenHeight()-gr.CurrentFont.Height)/2
gr.drawString(loadString, x, y)

--Done with splash
gr.CurrentFont = gr.Fonts['font01']
g_splashScreen = true
elseif not g_missionLoaded then
mn.loadMission("sm2-06.fs2")
io.setCursorHidden(false)
g_missionLoaded = true
end

if g_missionLoaded then
mn.simulateFrame()
mn.renderFrame()

section("Ready Room", "GS_EVENT_NEW_CAMPAIGN", 1)
section("Campaign Room", "GS_EVENT_CAMPAIGN_ROOM", 2)
section("Tech Room", "GS_EVENT_TECH_MENU", 3)
section("Barracks", "GS_EVENT_BARRACKS_MENU", 4)
section("Options", "GS_EVENT_OPTIONS_MENU", 5)
section("Exit", "GS_EVENT_QUIT_GAME", 6)
end
]
+Override: true
#End
-C

 

Offline shiv

  • Don't forget Poland!
  • 211
  • FRED me!
    • http://freespace.pl
Re: Scripts for C08302008
Awesome. I'm the most intrested in having mission based mainhall. What should I do if I want to put my own mission as mainhall?
http://www.sectorgame.com/vega
The Apocalypse Vega - Join the battle! A campaign for FreeSpace 2 Open

http://www.game-warden.com/earthdefence
Earth Defense project - Coming soon...

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Scripts for C08302008
Code: [Select]
mn.loadMission("sm2-06.fs2")
Change that line to refer to your mission instead of one from the campaign. It's near the bottom. :)
-C

 

Offline shiv

  • Don't forget Poland!
  • 211
  • FRED me!
    • http://freespace.pl
Re: Scripts for C08302008
Oh, I see. Thanks. There're also fields to change "loading" text string and it's colour, yeah? And are there any to change buttons/button highlight colour?
http://www.sectorgame.com/vega
The Apocalypse Vega - Join the battle! A campaign for FreeSpace 2 Open

http://www.game-warden.com/earthdefence
Earth Defense project - Coming soon...

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Scripts for C08302008
Code: [Select]
local loadString = "Loading..."
For the loading string. It'll auto-compensate to center itself.

For color, there's a few places where it happens. gr.setColor() sets the current text or shape/line color. The first number is red (out of 255), and the next two numbers are green and blue, respectively. There's also an optional alpha value.

Once setColor is called, all of the text or shapes after it will be that color, until another call to setColor is made.
-C

 

Offline shiv

  • Don't forget Poland!
  • 211
  • FRED me!
    • http://freespace.pl
Re: Scripts for C08302008
Oh. I have idea for mainhall. When you something's selected (green border appear) this border can flash. I mean one second is visible, then next one it dissapear and appear next second... I can't explain it better with my poor english ;)
http://www.sectorgame.com/vega
The Apocalypse Vega - Join the battle! A campaign for FreeSpace 2 Open

http://www.game-warden.com/earthdefence
Earth Defense project - Coming soon...

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Scripts for C08302008
how do you set the viewpoint for the mission? or does it just use player ship's viewpoint? yep, players ship spawn location is the viewpoint.

i'm gonna play with some stuff now :D

i've tested the scripts with the c08302008 build, no problems with either retail, mvp or our files (tap files)

didnt try to go into missions tho, just tested how it displays the missions...
« Last Edit: August 30, 2008, 09:22:44 am by pecenipicek »
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Solatar

  • 211
Re: Scripts for C08302008
Mainhall thing is awesome...I always liked that aspect of Command and Conquer Generals, and now MODs can have even MORE flexibility over their appearances.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Scripts for C08302008
Updated script:
Code: [Select]
#Conditional Hooks
$Application: Freespace 2
$On Game Init: [
--Function to handle a section every frame
section = function(name, event, num)
--MENU COLOR
local xmargin = gr.getScreenWidth()/8
local ymargin = gr.getScreenHeight()/8

--Get corner coordinates for this box
local x1 = xmargin
local y1 = ymargin*num
local x2 = x1+159
local y2 = y1+35

--When the mouse is OVER this section...
if io.getMouseX() > x1 and io.getMouseX() < x2 and io.getMouseY() > y1 and io.getMouseY() < y2 then
--Draw the inside box
gr.setColor(0, 255, 0)
gr.drawRectangle(x1+5, y1+5, x2-5, y2-5, false, false)

--Draw the little target lines now
local x = x1+(x2-x1)/2
local y = y1-20

--Top target line
gr.drawLine(x, y, x, y+15)

--Bottom target line
y = y2+10
gr.drawLine(x, y, x, y+15)

--Left target line
x = x1-20
y = y1+17
gr.drawLine(x, y, x+15, y)

--Right target line
x = x2+5
gr.drawLine(x, y, x+15, y)

--Handle the button click
if io.isMouseButtonDown(MOUSE_LEFT_BUTTON) then
gr.drawRectangle(x1, y1, x2, y2, false, false)
if event == "GS_EVENT_NEW_CAMPAIGN" then
mn.unloadMission()
g_missionLoaded = nil
g_splashScreen = nil
end
ba.postGameEvent(ba.GameEvents[event])
end
end

--Draw the outline
gr.setColor(255, 255, 255)
gr.drawRectangle(x1, y1, x2, y2, false, false)

--Draw the name
gr.drawString(name, x1 + ( (x2-x1) - gr.getStringWidth(name) ) / 2, y1+15)
end
]

$Application: Freespace 2
$State: GS_STATE_MAIN_MENU
$On State Start: []
+Override: true
$On State End: [
if g_missionLoaded then
mn.unloadMission()
g_missionLoaded = nil
g_splashScreen = nil
end
]
+Override: true
$On Frame: [
if not g_splashScreen then
--Don't need cursor
io.setCursorHidden(true)

--Draw splash image
local tex = gr.loadTexture("2_PreLoad.dds")
if tex:isValid() then
gr.drawImage(tex, 0, 0, gr.getScreenWidth(), gr.getScreenHeight())
end

--Draw "Loading..."
gr.setColor(255, 255, 255)
gr.CurrentFont = gr.Fonts['font02']
local loadString = "Loading..."
local x = (gr.getScreenWidth()-gr.getStringWidth(loadString))/2
local y = (gr.getScreenHeight()-gr.CurrentFont.Height)/2
gr.drawString(loadString, x, y)

--Done with splash
gr.CurrentFont = gr.Fonts['font01']
g_splashScreen = true
elseif not g_missionLoaded then
mn.loadMission("sm2-06.fs2")
io.setCursorHidden(false)
g_missionLoaded = true
end

if g_missionLoaded then
mn.simulateFrame()
mn.renderFrame()

section("Ready Room", "GS_EVENT_NEW_CAMPAIGN", 1)
section("Campaign Room", "GS_EVENT_CAMPAIGN_ROOM", 2)
section("Tech Room", "GS_EVENT_TECH_MENU", 3)
section("Barracks", "GS_EVENT_BARRACKS_MENU", 4)
section("Options", "GS_EVENT_OPTIONS_MENU", 5)
section("Exit", "GS_EVENT_QUIT_GAME", 6)
end
]
+Override: true
#End

This script seems to be much more reliable. It has two major changes:

One, it unloads the mission whenever you leave the main hall - this happens when you go to the barracks, campaign room, and techroom. Those rooms tend to access the campaign file (At least, the techroom and campaign room do, I didn't check the barracks). This reinitializes the SEXPs, which doesn't do good things for the main menu mission, which is already using them. By unloading the mission and then reloading it when you return to the mainhall, it gets around the SEXP issue.

The options screen works simply as an overlay over the mainhall and essentially pauses the mission underneath, so it doesn't have to reload the mission.

Two, the ready room requires something special. Since making the call to postGameEvent actually loads up the current mission name before it changes the state (switches out of the main hall), unloading the mission also clears that data. So instead I added a special condition to the section() function to handle that case, and unload the main menu mission before the call to postGameEvent. This also seems to fix the problem of exiting out of the game instead of to the main menu.

Result:
With the changes in the new script, the mission mainhall is at the point where I'd consider it a viable option for a release. The downside is that you need to watch what you put in the main menu mission, since it'll have to reload it often. Definitely include ibx files for any models used in it, and if you can remove weapons from ships that you don't care about, disable the support ship, and things like that, that would help too. It'll keep less media from being loaded. FS2 does seem to store things in memory properly with main hall missions, so once the main hall is loaded the first time, it'll take less time the next few times you load it.

Alternatives:
Moving the place that mission names are loaded would make the above script simpler but would require reloading the mission.

Rewriting the SEXP system to be more object-oriented and outside functions to take that into account, so you could have more than one SEXP system operational at the same time, would be one option. Another option would be to save the state of the SEXP system when loading a campaign, and then restore it after you're finished with the campaign SEXPs. Either way, you'd need to be pretty careful and I'm reluctant to do either one for 3.6.10 unless it's proven impossible to load main menu missions in a reasonable amount of time.
-C

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Scripts for C08302008
from what this basically tells me...

In short, to any mod team planning to use this, you should make a special mission for the main hall, especially with the camera code (read cutscene...), with the least possible different ships. (i'm not talking total, i'm talking less different classes of ships so it doesnt have to load all that usually goes in a normal mission.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Solatar

  • 211
Re: Scripts for C08302008
Enabling it and giving it a good test run.

EDIT: I've given it a bit of a run. It can be customized even further by changing the color of the "select" form of the buttons, easily done. I like it a lot, I really do.  :)
« Last Edit: August 30, 2008, 11:34:18 pm by Solatar »

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Scripts for C08302008
from what this basically tells me...

In short, to any mod team planning to use this, you should make a special mission for the main hall, especially with the camera code (read cutscene...), with the least possible different ships. (i'm not talking total, i'm talking less different classes of ships so it doesnt have to load all that usually goes in a normal mission.

Yeah. And if you aren't planning on having ships shooting at each other, strip them of their guns so the game doesn't try and load the media for those.
-C

 

Offline ShadowGorrath

  • Not funny or clever
  • 211
Re: Scripts for C08302008
The mainhall script is awesome. Though I have found some annoying bits. Like that you can't change the difficulty level in the options.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Fixed the options thing, along with making the ready room button work for multiplayer.  However, for some reason the mission doesn't start playing when you have a multiplayer pilot loaded.  The mission loads, you see the ships, but nothing happens.  But at least all the menus work as they should now, as far as I can tell.

Code: [Select]
#Conditional Hooks
$Application: Freespace 2
$On Game Init: [
--Function to handle a section every frame
section = function(name, event, num)
--MENU COLOR
local xmargin = gr.getScreenWidth()/8
local ymargin = gr.getScreenHeight()/8

--Get corner coordinates for this box
local x1 = xmargin
local y1 = ymargin*num
local x2 = x1+159
local y2 = y1+35

--When the mouse is OVER this section...
if io.getMouseX() > x1 and io.getMouseX() < x2 and io.getMouseY() > y1 and io.getMouseY() < y2 then
--Draw the inside box
gr.setColor(0, 255, 0)
gr.drawRectangle(x1+5, y1+5, x2-5, y2-5, false, false)

--Draw the little target lines now
local x = x1+(x2-x1)/2
local y = y1-20

--Top target line
gr.drawLine(x, y, x, y+15)

--Bottom target line
y = y2+10
gr.drawLine(x, y, x, y+15)

--Left target line
x = x1-20
y = y1+17
gr.drawLine(x, y, x+15, y)

--Right target line
x = x2+5
gr.drawLine(x, y, x+15, y)

--Handle the button click
if io.isMouseButtonDown(MOUSE_LEFT_BUTTON) then
gr.drawRectangle(x1, y1, x2, y2, false, false)
if event == "GS_EVENT_NEW_CAMPAIGN" or event == "GS_EVENT_OPTIONS_MENU" then
mn.unloadMission()
g_missionLoaded = nil
g_splashScreen = nil
end
ba.postGameEvent(ba.GameEvents[event])
end
end

--Draw the outline
gr.setColor(255, 255, 255)
gr.drawRectangle(x1, y1, x2, y2, false, false)

--Draw the name
gr.drawString(name, x1 + ( (x2-x1) - gr.getStringWidth(name) ) / 2, y1+15)
end
]

$Application: Freespace 2
$State: GS_STATE_MAIN_MENU
$On State Start: []
+Override: true
$On State End: [
if g_missionLoaded then
mn.unloadMission()
g_missionLoaded = nil
g_splashScreen = nil
end
]
+Override: true
$On Frame: [
if not g_splashScreen then
--Don't need cursor
io.setCursorHidden(true)

--Draw splash image
local tex = gr.loadTexture("2_PreLoad.dds")
if tex:isValid() then
gr.drawImage(tex, 0, 0, gr.getScreenWidth(), gr.getScreenHeight())
end

--Draw "Loading..."
gr.setColor(255, 255, 255)
gr.CurrentFont = gr.Fonts['font02']
local loadString = "Loading..."
local x = (gr.getScreenWidth()-gr.getStringWidth(loadString))/2
local y = (gr.getScreenHeight()-gr.CurrentFont.Height)/2
gr.drawString(loadString, x, y)

--Done with splash
gr.CurrentFont = gr.Fonts['font01']
g_splashScreen = true
elseif not g_missionLoaded then
mn.loadMission("sm2-06.fs2")
io.setCursorHidden(false)
g_missionLoaded = true
end

if g_missionLoaded then
mn.simulateFrame()
mn.renderFrame()

if ts.isCurrentPlayerMulti()==true then
if ts.isPXOEnabled()==true then
section("Multiplayer", "GS_EVENT_PXO", 1)
else
section("Multiplayer", "GS_EVENT_MULTI_JOIN_GAME", 1)
end
else
section("Ready Room", "GS_EVENT_NEW_CAMPAIGN", 1)
end
section("Campaign Room", "GS_EVENT_CAMPAIGN_ROOM", 2)
section("Tech Room", "GS_EVENT_TECH_MENU", 3)
section("Barracks", "GS_EVENT_BARRACKS_MENU", 4)
section("Options", "GS_EVENT_OPTIONS_MENU", 5)
section("Exit", "GS_EVENT_QUIT_GAME", 6)
end
]
+Override: true
#End
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline shiv

  • Don't forget Poland!
  • 211
  • FRED me!
    • http://freespace.pl
Is possible to change automatically mainhall mission with campaign progress?
http://www.sectorgame.com/vega
The Apocalypse Vega - Join the battle! A campaign for FreeSpace 2 Open

http://www.game-warden.com/earthdefence
Earth Defense project - Coming soon...

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
You'd have two options - one, have a SEXP variable that's campaign-persistent which defines campaign progress (or just which mainhall to use), and have a default mission loaded for when it's no longer defined.

Two, define a scripting function which writes a file, that's then checked by the mainhall script. I'd strongly discourage this option, though, as the first one is far more elegant and doesn't require writing the extra file.
-C

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
I know this is necro, but I've found an issue with this mainhall script and didn't feel a need to start a new thread for it since it directly relates to the changes I posted here.  Originally now, this did not function for multiplayer, and I added in the support to check for which button to show based on the results of a couple of Lua functions.  Ok, that all seems to work fine.  Except, when I get logged into PXO and go to look at the games, nothing shows up.  I disable this script and I see games.  I've also tried it with the older script that shows a tech model, it seems to not work with it too.  Either it's related to the presence of a scripting table at all, or something about how I set it to change the state to multiplayer (or the way I check if a pilot is multiplayer, that never did get much testing :/ ).  Anyone have any clues on this?  It's about the only problem I have with this menu at this point.  Oh and the usual mainhall hotkeys don't work anymore, not sure if there's any way to pass those through or whatnot, but it is a bit crippling.  That means no escape to quit, no F3 lab, probably no cheat code (isn't there one you have to type in the mainhall?).
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Scripts for C08302008
How did I miss those scripts? :(

The only problem is that they're not standard FSO builds-compatible. I wonder if one day all builds will be compatible with Scripting. ;7
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito
My interviews: [ 1 ] - [ 2 ] - [ 3 ]

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Scripts for C08302008
when will this stuff get merged anyhow?
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Scripts for C08302008
What are you talking about?  I've been using the latest version of this script with nightly builds and Wanderer branch builds (which have nothing to do with this script) for months.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays