ScriptCB_ Common LUA Code Testing Notes

Started by Phobos, February 29, 2012, 05:56:12 AM

Previous topic - Next topic
February 29, 2012, 05:56:12 AM Last Edit: March 04, 2012, 03:45:32 AM by Phobos
*Thread Under Development
Last updated 03-04-2012


This thread will be updated as more potential commands are tested in the game using ifs_pausemenu.lua and new scripts. Its main focus is to test the in-game functionality of the various ScriptCB_ command code scripts stored in the executable. Most of these have not been tested yet but this knowledge base will increase with further testing.


Confirmed/Tested Commands:
ScriptCB_CloseNetShell()
This will disconnect the player from a server even if they are the host. Can be used in conjunction with exit to windows for a proper shut down see this thread
http://www.swbfgamers.com/index.php?topic=4225.0

ScriptCB_PlayerSuicide(0)
- This is the command that triggers player suicide when clicking respawn, it is found in the ifs_pausemenu.lua

ScriptCB_DoFile("ifs_yourscriptnamehere")
- This calls upon an lua script and makes the game load it.

ScriptCB_QuitToShell()
- This exits the map being played and takes the player to the game shell, which in multiplayer happens to be the server lobby.

ScriptCB_QuitToWindows()
- In single player this will instantly close the battlefront executable. In multi-player, the application freezes and must be process terminated with task manager. No fix has been discovered yet.
* EDIT A fix has just been discovered see the link posted above
I recently tested a script mod which enabled the exit to windows option in multiplayer pause menu, and made it so it ran QuitToShell THEN QuitToWindows. However this didn't work and the game still froze.

ScriptCB_Freecamera()
- This puts the game into freecam mode which lets the camera move freely around the map whether spawned or unspawned. The default controls for freecam have yet to be modified.

This is from sleepkiller

Quote-- The first number must be the team you want the player on the second one must be left alone.
ScriptCB_SetPlayerSide(1,0)
-- Same thing applys to this one.
ScriptCB_SetPlayerSide(1,1)
-- Stop them from changing once we have them
ScriptCB_SetCanSwitchSides(nil)



Commands that appear to do nothing from testing:
ScriptCB_OpenNetShell()
- This does nothing at all in multiplayer or single player

ScriptCB_Unpause()
- I tried removing this command from the respawn section in ifs_pausemenu.lua and tested the mod in a root server but nothing happened except a wierd leg animation glitch. Also does nothing in single player. It appears that calling on a Script_CB is always client-sided and there are no server overrides. This may not in fact be true but so far I think it probably is.


Unknown/Untested commands that seem important or interesting:
ScriptCB_AreMetagameRulesOn()
- It appears that MetagameRules are a set of code parameters which tell the game how to differentiate between multiplayer servers and single player games. For example, I suspect it may contain code that tells the game run a script that enables public/team chat in multiplayer games, and disable it in single player. Or it may control other variables such as framerate, password/cd-key verification, or how landmines are thrown. I have no idea really only conjecture at this point.

ScriptCB_IFText_GetDisplayRect(nil); 
ScriptCB_IFText_GetTextExtent
- Not sure what these do but I suspect something to do with in game font or chat display.

ScriptCB_SetQuitPlayer(2)
- I think this has something to do with the confirmation window that appears when you chose to quit game from pause menu. I removed this and the other confirmation codes for quit game with success so it may not be that relevant.

ScriptCB_RestartMission()
- This tells the game to restart the server from the current map being played and should load any updated LVL files. I have an idea I will be testing soon which would possibly allow a nondedicated PC server host to restart their server directly through the pause menu. I will post the results here after testing.

ScriptCB_ResetSkipToPlayerList()
- Appears it might have something to do with the ScriptCB_Unpause(). It's function is currently unknown though.

ScriptCB_InNetGame
- This appears a lot in the ifs_pausemenu and although I do not know exactly what it does it seems similar to the MetagameRules commands in that I suspect it also controls settings for multiplayer script functionality.

ScriptCB_IsDedicated
- Something that controls in game dedicated hosting maybe?



Stuff such as "ScriptCB_IsSplitscreen" can be ignored as it applies to console only and is unused in game for PC.

Extracted list of all the LUA commands and Script_CB names stored in the executable (thanks ggctuk)

SetDefeatMovie 
SetVictoryMovie
ScriptCB_SetHistoricalRulesOn   
ScriptCB_AreHistoricalRulesOn   
ScriptCB_SetAIDifficulty   
ScriptCB_SetCanSwitchSides 
ScriptCB_SetMetagameRulesOn
ScriptCB_AreMetagameRulesOn
ScriptCB_MetagameSetBonus   
ScriptCB_DeleteSavedMetagameState   
ScriptCB_SetLastBattleVictoryValid 
ScriptCB_GetLastBattleVictory   
ScriptCB_DoesMetagameExistOnCardSplitScreen
ScriptCB_GetSavedMetagameListSplitScreen   
ScriptCB_DoesMetagameExistOnCard   
ScriptCB_StartNewMetagame   
ScriptCB_GetSavedMetagameList   
ScriptCB_SetMetagameTeams   
ScriptCB_SetSPProgress 
ScriptCB_GetSPProgress 
ScriptCB_SaveSPState 
ScriptCB_IsSPStateSaved
ScriptCB_IsMetagameStateSaved   
ScriptCB_LoadMetagameState 
ScriptCB_SaveMetagameState
ScriptCB_UnlockUnlockable   
ScriptCB_UnlockableState   
GetMultisamplingModeDescription
GetNumMultisamplingQualityModes
GetMaxMultisamplingModeForScreenSize   
GetMaxScreenSizeForMultisamplingMode   
IsMultisamplingModeSupported   
IsMultisamplingModeForcedFromDriver
IsVideoModeSupported   
ScriptCB_SetProfileJoinIP   
ScriptCB_GetProfileJoinIP   
ScriptCB_IsPCVideoFixedFunction
ScriptCB_SetPCBrightnessContrast   
ScriptCB_SetPCVideoOptions 
ScriptCB_GetAutodetectPCVideoOptions   
ScriptCB_GetPCVideoOptions 
ScriptCB_GetIdealResolution
ScriptCB_SetResolution 
ScriptCB_FillMultisampleTable   
ScriptCB_FillResolutionTable   
ScriptCB_SetJoystickEnabled
ScriptCB_IsJoystickEnabled 
ScriptCB_SetMouseSensitivity   
ScriptCB_GetJoySensitivity 
ScriptCB_GetMouseSensitivity   
ScriptCB_SetMetaAllMapsOn   
ScriptCB_IsMetaAllMapsOn   
ScriptCB_GetControlMode
ScriptCB_SetControlMode
ScriptCB_ResetToolTips 
ScriptCB_PrevToolTipState   
ScriptCB_NextToolTipState   
ScriptCB_IsToolTipAuto 
ScriptCB_IsToolTipOn   
ScriptCB_SetHeroesOn   
ScriptCB_AreHeroesOn   
ScriptCB_SetFriendlyFire   
ScriptCB_GetFriendlyFire   
ScriptCB_SetAutoAimOn   
ScriptCB_IsAutoAimOn   
ScriptCB_SetRumbleOn   
ScriptCB_IsRumbleOn
ScriptCB_SetHorizontalSplitScreen   
ScriptCB_IsHorizontalSplitScreen   
ScriptCB_SetFirstPersonView
ScriptCB_IsFirstPersonView 
ScriptCB_ResetSoundToDefault   
ScriptCB_ResetGameOptionsToDefault 
ScriptCB_ResetControlsToDefault
ScriptCB_SetControlScale   
ScriptCB_GetControlScale   
ScriptCB_SetYAxisFlip   
ScriptCB_GetYAxisFlip   
ScriptCB_SetFunctionIdForAnalogId   
ScriptCB_GetFunctionIdForAnalogId   
ScriptCB_SetFunctionIdForButtonId   
ScriptCB_GetFunctionIdForButtonId   
ScriptCB_UpdateScreen   
ScriptCB_GetBuildStr   
ScriptCB_GetTeamName   
ScriptCB_PersonalStatsSetTitles
ScriptCB_TeamStatsSetTitles
ScriptCB_TeamStatsGetTeamColor 
ScriptCB_TeamStatsGetTeam1 
ScriptCB_TeamStatsValidatePos   
ScriptCB_GetAwardStats 
ScriptCB_GetPersonalStats   
ScriptCB_SetTeamStatsSortMode   
ScriptCB_GetTeamstats   
ScriptCB_ClientGotStats
ScriptCB_Freecamera
ScriptCB_GetMissionTime
ScriptCB_CheckPlayerListDone   
ScriptCB_ResetSkipToPlayerList 
ScriptCB_SkipToPlayerList   
ScriptCB_Unpause   
ScriptCB_QuitFromStats 
ScriptCB_QuitToWindows 
ScriptCB_QuitToShell   
ScriptCB_Reboot
ScriptCB_GetPausingViewport
ScriptCB_RestartMission
ScriptCB_LaunchDemo
ScriptCB_EnterMission   
ScriptCB_CheckMouseMark
ScriptCB_ResetMouseMark
ScriptCB_SetMouseMark   
ScriptCB_HideDownloadableContent   
ScriptCB_SetDCMap   
ScriptCB_GetDifficulty 
ScriptCB_SetDifficulty 
ScriptCB_SetPlayerSide 
ScriptCB_IsUniqueLoginName 
ScriptCB_GetUniqueLoginName
ScriptCB_TrimLoginName 
ScriptCB_Logout
ScriptCB_GetProfileName
ScriptCB_GetCurrentProfileName 
ScriptCB_GetCurrentProfileNetName   
ScriptCB_IsPlayerLoggedIn
ScriptCB_SwapActiveProfileSlots
ScriptCB_AddProfile
ScriptCB_GetLoginList   
ScriptCB_CheckIfOkToExitMemoryMode 
ScriptCB_SetMemoryProfileMode   
ScriptCB_InMemoryProfileMode   
ScriptCB_DoesProfileExistOnCard
ScriptCB_StartDeleteMetagameSplitScreen
ScriptCB_StartSaveMetagameSplitScreen   
ScriptCB_StartLoadMetagameSplitScreen   
ScriptCB_CheckMemoryCardMark   
ScriptCB_MarkMemoryCard
ScriptCB_StartDeleteMetagame   
ScriptCB_IsCurrentMetagame 
ScriptCB_StartSaveMetagame 
ScriptCB_StartLoadMetagame 
ScriptCB_StartSaveProfile   
ScriptCB_StartDeleteProfile
ScriptCB_ReloadMarkedProfile   
ScriptCB_MarkCurrentProfile
ScriptCB_StartLoadProfile   
ScriptCB_StartPreOp
ScriptCB_StartInitialMemcardCheck   
ScriptCB_DoInitialMemcardCheck 
ScriptCB_ShowMultipageText 
ScriptCB_IndexMultipageText
ScriptCB_DoneCheckPatch
ScriptCB_ShouldCheckPatch   
ScriptCB_SetHasSeenDNASEULA
ScriptCB_HasSeenDNASEULA   
ScriptCB_DoneCheckDNAS 
ScriptCB_ShouldCheckDNAS   
ScriptCB_LoadSavePopupResult   
ScriptCB_SetProfileNotDirty
ScriptCB_IsProfileDirty
ScriptCB_IsCurProfileDirty 
ScriptCB_ShouldShowDemoPostscreen   
ScriptCB_ShouldShowLegal   
ScriptCB_GetQuitPlayer 
ScriptCB_SetQuitPlayer 
ScriptCB_WasSplitscreen
ScriptCB_IsSplitscreen 
ScriptCB_SetSplitscreen
ScriptCB_GetAutoNetScript   
ScriptCB_SetupAutoNetIsLan 
ScriptCB_SetupAutoNetMissions   
ScriptCB_GetAutoGetPlayerCount 
ScriptCB_GetAutoNetGameName
ScriptCB_GetAutoNetIsDedicated 
ScriptCB_ReadLeftstick 
ScriptCB_GetNumControllers 
ScriptCB_SetIgnoreControllerRemoval
ScriptCB_UnbindController   
ScriptCB_ReadAllControllers
ScriptCB_SetAutoAcquireControllers 
ScriptCB_GetShellActive
ScriptCB_GetDateStr
ScriptCB_random
ScriptCB_srand 
ScriptCB_ustrupper 
ScriptCB_usprintf   
ScriptCB_getlocalizestr
ScriptCB_UnicodeStrCat 
ScriptCB_ununicode 
ScriptCB_tounicode 
ScriptCB_GetMaxMissionQueue
ScriptCB_SetMissionNames   
ScriptCB_SetTeamNames   
ScriptCB_IsLegalGamespyString   
ScriptCB_GetVKeyboardCharacter 
ScriptCB_FormatTimeString   
ScriptCB_GetLanguage   
ScriptCB_GetPlatform   
ScriptCB_DoFile Team2
Team1   
Side
Map
Attract
mode
fs_opt_pcvideo_reslistbox_contents
ifs_opt_pcvideo_fsaalistbox_contents
memslot
showstr
ifs_saveop_InitialMemcardCheckDone 
ifs_saveop_PreOpDone   
ifs_saveop_LoadProfileDone 
ifs_saveop_DeleteProfileDone   
ifs_saveop_SaveProfileDone 
ifs_saveop_LoadMetagameDone
ifs_saveop_SaveMetagameDone
ifs_saveop_DeleteMetagameDone   
isCurrent   
datestr
filename   
namestr contentsstr
labelustr   
contentsustr
ColorB 
ColorG 
ColorR 
val3str
val2str
val1str
fix MP stats   
teamstats_listbox_contentsR
teamstats_listbox_contentsL
com_icon_CIS   
com_icon_imperial   
com_icon_alliance   
com_icon_republic   
ifs_teamstats.RightModel 
ifs_teamstats.LeftModel
ifs_teamstats.RightList.Title   
ifs_teamstats.LeftList.Title
ifs_personalstats.IconModel
stats_listbox_contents   
ifs_awardstats_seticonstartside
ifs_awardstats.IconModels.%d.model
ScriptCB_EnableCursor   
ScriptCB_ResetControl   
ScriptCB_SetBinding
ScriptCB_GetKeyBoardCmds   
ScriptCB_DoConsoleCmd
ScriptCB_GetConsoleCmds
ScriptCB_IFModel_SetLighting   
ScriptCB_SetSunlight   
ScriptCB_ResetLeaderBoardPlayerData
ScriptCB_CancelLeaderBoardPlayerData   
ScriptCB_DownloadLeaderBoardData   
ScriptCB_LeaderBoardDownloadDone   
ScriptCB_GetLeaderBoardPlayerData   
ScriptCB_GetSafeScreenInfo 
ScriptCB_GetScreenInfo 
ScriptCB_GetErrorLevel 
ScriptCB_CloseErrorBox 
ScriptCB_OpenErrorBox
ScriptCB_IsPropertyPlayingNow   
ScriptCB_SetMovieAudioBus   
ScriptCB_StopMovie 
ScriptCB_AreMoviePropertiesPlaying 
ScriptCB_IsMoviePlaying
ScriptCB_PlayMovie 
ScriptCB_CloseMovie
ScriptCB_OpenMovie 
ScriptCB_SetIgnoreInputs   
ScriptCB_IsPopupOpen   
ScriptCB_IsErrorBoxOpen
ScriptCB_ClosePopup
ScriptCB_OpenPopup 
ScriptCB_PopScreen 
ScriptCB_PushScreen
ScriptCB_SetIFScreen   
ScriptCB_IFObj_SetUseSafezone   
ScriptCB_IFObj_SetScreenPosition   
ScriptCB_IFModel_SetOmegaY 
ScriptCB_IFModel_GetDepth   
ScriptCB_IFModel_SetDepth   
ScriptCB_IFModel_GetTranslation
ScriptCB_IFModel_SetTranslation
ScriptCB_IFModel_GetRotation   
ScriptCB_IFModel_SetRotation   
ScriptCB_IFModel_GetScale   
ScriptCB_IFModel_SetScale   
ScriptCB_IFModel_SetAnimation   
ScriptCB_IFModel_SetModel   
ScriptCB_IFMaskImage_GetMaskTexCoords   
ScriptCB_IFMaskImage_SetMaskTexCoords   
ScriptCB_IFMaskImage_SetMaskTexture
ScriptCB_IFImage_SetTexCoords   
ScriptCB_IFImage_GetTexCoords   
ScriptCB_IFImage_SetRect   
ScriptCB_IFImage_GetRect   
ScriptCB_IFImage_SetTexture
ScriptCB_IFFlashyText_StartFlashiness   
ScriptCB_IFFlashyText_SetBackgroundRightJustify
ScriptCB_IFFlashyText_SetBackgroundSize
ScriptCB_IFFlashyText_SetBackground
ScriptCB_IFFlashyText_SetTextColor 
ScriptCB_IFFlashyText_Setup
ScriptCB_IFText_GetLeading 
ScriptCB_IFText_SetLeading 
ScriptCB_IFText_SetTextStyle   
ScriptCB_IFText_GetDisplayRect 
ScriptCB_IFText_GetTextExtent   
ScriptCB_IFText_GetTextScaleY   
ScriptCB_IFText_GetTextScaleX
ScriptCB_IFText_SetTextScale   
ScriptCB_IFText_SetTextBreak   
ScriptCB_IFText_SetJustify 
ScriptCB_IFText_GetTextBox 
ScriptCB_IFText_SetTextBox 
ScriptCB_IFText_GetIntercharacterSpacing   
ScriptCB_IFText_SetIntercharacterSpacing   
ScriptCB_IFText_SetFont
ScriptCB_IFText_SetTextPosition
ScriptCB_IFText_SetUString 
ScriptCB_IFText_SetString   
ScriptCB_GetFontHeight 
ScriptCB_IFObj_RemoveHotSpot   
ScriptCB_IFObj_CreateHotSpot   
ScriptCB_IFObj_TestHotSpot 
ScriptCB_IFObj_MouseOver   
ScriptCB_IFObj_IsGroup 
ScriptCB_IFObj_IsEnabled   
ScriptCB_IFObj_Enable   
ScriptCB_IFObj_SendToBack
ScriptCB_IFObj_BringToFront
ScriptCB_IFObj_GetPosition 
ScriptCB_IFObj_GetWidthHeight   
ScriptCB_IFObj_GetVis   
ScriptCB_IFObj_GetZOrder   
ScriptCB_IFObj_GetColor
ScriptCB_IFObj_GetAlpha
ScriptCB_IFObj_GetPos   
ScriptCB_IFObj_SetRotation 
ScriptCB_IFObj_SetRelativeRotation 
ScriptCB_IFObj_SetBasicRotation
ScriptCB_IFObj_SetPosition 
ScriptCB_IFObj_SetWidthHeight   
ScriptCB_IFObj_SetVis   
ScriptCB_IFObj_SetZOrder   
ScriptCB_IFObj_SetColor
ScriptCB_IFObj_SetAlpha
ScriptCB_IFObj_SetPos   
ScriptCB_IFObj_GetCPointer 
ScriptCB_IsFileExist   
ScriptCB_IsPAL 
ScriptCB_EndIFScreen   
ScriptCB_SetIFScreenViewport   
ScriptCB_AddIFScreen   
ScriptCB_EndIFObj   
ScriptCB_AddIFContainer
ScriptCB_AddIFModel
ScriptCB_AddIFMaskImage
ScriptCB_AddIFImage
ScriptCB_AddIFFlashyText   
ScriptCB_AddIFText
ScriptCB_PlayerSuicide 
AddMissionObjective
SetAIVehicleNotifyRadius   
SetAIFormationRadius   
AddWalkerType   
ClearWalkers   
AddDeathRegion 
SetFishType
SetNumFishTypes
SetBirdFlockMinHeight   
SetBirdType
SetNumBirdTypes
SetMemoryPoolSize   
SetLevelModelMem   
SetEnemyTeamDifficultyHard 
SetEnemyTeamDifficultyMedium   
SetEnemyTeamDifficultyEasy 
SetEnemyTeamDifficulty 
SetPlayerTeamDifficultyHard
SetPlayerTeamDifficultyMedium   
SetPlayerTeamDifficultyEasy
SetPlayerTeamDifficulty
SetStayInTurrets   
SetDefenderSnipeRange   
SetAttackerSnipeRange   
SetDenseEnvironment
SetUrbanEnvironment
SetSpawnDelay   
SetCarrierClass
AddBleedThreshold   
ActivateBonus   
SetHeroClass   
AddUnitClass   
SetReinforcementCount   
SetUnitCount   
SetTeamAsFriend
SetTeamAsNeutral   
SetTeamAsEnemy 
SetTeamIcon
SetStationaryWaitTime   
SetAllowBlindJetJumps 
SetMaxPlayerFlyHeight   
SetMinPlayerFlyHeight   
SetMaxFlyHeight
SetMinFlyHeight
SetTeamAggressiveness   
SetTeamName
SetHistorical   
SetState   
SetCameraPosition   
SetCameraRotation   
AddCameraShot   
SetModelMemory
ReadDataFileInGame 
ReadDataFile
false   
true   
EntityLight
EntityDroideka 
WalkerBlendUnit
WalkerBlend
WalkerLegPair   
EntityWalker   
ScriptCB_CanClientLeaveStats   
ScriptCB_SetVoiceLocalEchoEnable   
ScriptCB_GetLobbyPlayerCount   
ScriptCB_ResetSkipToNTGUI   
ScriptCB_GetSkipToNTGUIProfileName 
ScriptCB_SkipToNTGUI   
ScriptCB_GetFriendListIcon 
ScriptCB_DoFriendAction
ScriptCB_GetFriendActions   
ScriptCB_GetFriendStateStr 
ScriptCB_UpdateFriends 
ScriptCB_CancelFriends 
ScriptCB_BeginFriends   
ScriptCB_CheckForPatch 
ScriptCB_AllowSkipDNAS 
ScriptCB_GetIPAddr 
ScriptCB_SetNoticeNoCable   
ScriptCB_IsNetCableIn   
ScriptCB_IsNetHWPresent
ScriptCB_IsLeaveDone   
ScriptCB_CancelLeave   
ScriptCB_LaunchLeave   
ScriptCB_UpdateLeave   
ScriptCB_BeginLeave
ScriptCB_IsJoinDone
ScriptCB_CancelJoin
ScriptCB_LaunchJoin
ScriptCB_UpdateJoin
ScriptCB_BeginJoin 
ScriptCB_CanSupportMaxPlayers   
ScriptCB_IsBadNetworkConnection
ScriptCB_IsQuickmatchDone 
ScriptCB_CancelQuickmatch   
ScriptCB_LaunchQuickmatch   
ScriptCB_UpdateQuickmatch   
ScriptCB_BeginJoinSpecial
ScriptCB_BeginJoinIP   
ScriptCB_BeginQuickmatch   
ScriptCB_GetCmdlineLogin   
ScriptCB_IsCmdlineJoinPending   
ScriptCB_IsSpecialJoinPending   
ScriptCB_GetDSSessionList   
ScriptCB_CancelDSSessionList   
ScriptCB_LaunchDSSessionList   
ScriptCB_UpdateDSSessionList   
ScriptCB_BeginDSSessionList
ScriptCB_PreviousHost   
ScriptCB_NextHost   
ScriptCB_SetSortOrder   
ScriptCB_GetSortOrder   
ScriptCB_SetSessionSortMode
ScriptCB_GetSessionSortMode
ScriptCB_ApplyFilters   
ScriptCB_GetExtraSessionInfo   
ScriptCB_GetSessionListPercent 
ScriptCB_IsSessionReady
ScriptCB_GetSessionList
ScriptCB_PauseSessionList   
ScriptCB_CancelSessionList 
ScriptCB_LaunchSessionList 
ScriptCB_UpdateSessionList 
ScriptCB_BeginSessionList   
ScriptCB_ClearPrevSessionId
ScriptCB_VoteOrNominate
ScriptCB_VoteKick   
ScriptCB_LobbyAction   
ScriptCB_CancelLobby   
ScriptCB_LaunchLobby   
ScriptCB_HasServerLaunched 
ScriptCB_UpdateLobby   
ScriptCB_BeginLobby
ScriptCB_TrackLoginErrors   
ScriptCB_CancelLogin   
ScriptCB_StartLoginDedicatedServer 
ScriptCB_StartLogin
ScriptCB_IsLoginDone   
ScriptCB_SetGSProfileInfo   
ScriptCB_GetGSProfileInfo   
ScriptCB_UpdateMPMetagame   
ScriptCB_BeginMPMetagame   
ScriptCB_ClearError
ScriptCB_GetError   
ScriptCB_GetLatestError
ScriptCB_DownloadJournals   
ScriptCB_EnablePlayback
ScriptCB_UploadJournals
ScriptCB_EnableJournal 
ScriptCB_GetConnectType
ScriptCB_SetConnectType
ScriptCB_GetOnlineOpts 
ScriptCB_SetOnlineOpts 
ScriptCB_GetAutoAssignTeams
ScriptCB_SetNetGameDefaults
ScriptCB_GetNetGameDefaults
ScriptCB_IsBootInvitePending   
ScriptCB_CloseNetShell
ScriptCB_IsNetworkOn   
ScriptCB_OpenNetShell   
ScriptCB_GetAutoNetMode
ScriptCB_EndAutoNet
ScriptCB_IsAutoNet 
ScriptCB_IsInShell 
ScriptCB_IsDedicated   
ScriptCB_SetDedicated   
ScriptCB_NetWasClient 
ScriptCB_NetWasDedicatedQuit   
ScriptCB_NetWasDedicated   
ScriptCB_NetWasHost
ScriptCB_InNetSession   
ScriptCB_InMultiplayer 
ScriptCB_SetInNetGame   
ScriptCB_InNetGame 
ScriptCB_GetLobbyPlayerFlags   
ScriptCB_GetLobbyPlayerlist
ScriptCB_GetGameName   
ScriptCB_SetNumBots
ScriptCB_SetGameName   
ScriptCB_SetHostLimit   
ScriptCB_GetAmHost 
ScriptCB_SetAmHost 
ScriptCB_SetNetLoginName   
ScriptCB_GetOnlineService   
ScriptCB_AutoNetJoin   
friends_listbox_contents
ClearListbox   
mp_joinds_listbox_contents 
indexstr     
–Cgsfriends_listbox_layout   
StateIcon   
VoiceIcon 
launchflag 
fnFindReady
ListManager_fnMoveCursor(ifs_mp_sessionlist.listbox,mpsessionlist_listbox_layout)   
FirstShownIdx   
ifs_mp_joinds   
ScriptCB_GetVoiceEnable
ScriptCB_VoiceEnable   
ScriptCB_SoundDisable   
ScriptCB_SoundEnable   
ScriptCB_ShellPlayDelayedStream
ScriptCB_IsShellMusicPlaying   
ScriptCB_SetShellMusicInterval 
ScriptCB_SetShellMusic 
ScriptCB_PlayAuditionEffect
ScriptCB_GetBassManagement 
ScriptCB_SetBassManagement 
ScriptCB_GetMixConfigChanged   
ScriptCB_GetEAXVersion 
ScriptCB_NextMixConfig 
ScriptCB_PreviousMixConfig 
ScriptCB_GetMixConfig   
ScriptCB_NextOutputMode
ScriptCB_PreviousOutputMode
ScriptCB_GetOutputMode 
ScriptCB_HWSupport 
ScriptCB_ToggleEffects 
ScriptCB_EffectsEnabled
ScriptCB_SetVolumes
ScriptCB_GetVolumes
ScaleSoundParameter
SetOutOfBoundsVoiceOver
SetDefeatMusic 
SetVictoryMusic
SetAttackingTeam   
SetAmbientMusic
SetSoundEffect
SetLowReinforcementsVoiceOver   
ScriptCB_SetBleedingRepeatTime 
SetBleedingVoiceOver   
SetReservesVO   
SetPlanetaryBonusVoiceOver 
AudioStreamAppendSegments   
AudioStreamComplete
CloseAudioStream   
OpenAudioStream
StopAudioStream
PlayAudioStreamUsingProperties 
PlayAudioStream
ScriptCB_SndPlaySound   
ScriptCB_SndBusFadeAAdvancedTraining   
Regeneration   
Reinforcements 
SensorJam   
SneakAttack
Hero   
Sabotage   
endor   
hoth   
kamino 
geonosis   
naboo   
kashyyyk   
rhenvar
yavin   
tatooine   
bespin
bSetsBlockade   
aicontrol   
lastattack 
char   
icon   
shortname   
teamname2   
teamname   
Bonus2Votes
Bonus1Votes
SecretBaseVotes
AttackVotes
bBlockaded 
activatedthisturn   
destroyed   
pickorder   
charge 
owner2 
owner1 
mJoystickTeams 
mIsSplitscreen 
metagame_state_local   
mWonMaps3   
mWonMaps2   
mWonMaps1   
mWonMaps0   
teamsAreBackwards   
team2_charged   
team1_charged   
applyingbonus   
charge_meter_team2 
charge_meter_team1 
TimePerTurn
bSneakAttack   
pickplanet 
pickteam   
era
MaxTime
MaxTurn
CurTime
ShowedTurn1Intro   
ShowedTurn0Intro 
planets
team2   
team1   
metagame_state 
gBonus2
gBonus1
gBonusPlanet   
gAttackPlanet   
metagame_host_state
gBonus2Vote
gBonus1Vote
gBonusPlanetVote   
gAttackPlanetVote   
metagame_vote_state mEra   
classic new cw
ifs_meta_opts




For reference here is the stock Ifs_Pausemenu.LUA:

-- Ingame pause menu

ifspausemenu_vbutton_layout = {
ySpacing = 5,
width = 260,
font = "gamefont_medium",
buttonlist = {
{ tag = "resume", string = "common.resume", },
{ tag = "freecam", string = "game.pause.freecam", },
{ tag = "lobby", string = "game.pause.playerlist", },
{ tag = "opts", string = "ifs.main.options", },
{ tag = "console", string = "Fake Console", },
{ tag = "suicide", string = "game.pause.suicide", },
{ tag = "friends", string = "ifs.onlinelobby.friendslist", },
{ tag = "recent", string = "common.mp.recent", },
{ tag = "restart", string = "common.restart", },
{ tag = "quit", string = "common.quit", },
{ tag = "exit", string = "common.quit2windows", },
},
title = "game.pause.title",
}

ifspausemenu_split_vbutton_layout = {
ySpacing = 5,
width = 220,
font = "gamefont_small",
buttonlist = {
{ tag = "resume", string = "common.resume", },
{ tag = "freecam", string = "game.pause.freecam", },
{ tag = "lobby", string = "game.pause.playerlist", },
{ tag = "opts", string = "ifs.main.options", },
{ tag = "console", string = "Fake Console", },
{ tag = "suicide", string = "game.pause.suicide", },
{ tag = "friends", string = "ifs.onlinelobby.friendslist", },
{ tag = "restart", string = "common.restart", },
{ tag = "quit", string = "common.quit", },
{ tag = "exit", string = "common.quit2windows", },
},
title = "game.pause.title",
}

-- Turns pieces on/off as requested
function ifs_pausemenu_fnSetPieceVis(this, bVis)
-- print("ifs_pausemenu_fnSetPieceVis, before title. this = ", this)
--IFObj_fnSetVis(this.title,bVis)
-- print("ifs_pausemenu_fnSetPieceVis, before buttons")
IFObj_fnSetVis(this.buttons,bVis)
-- print("ifs_pausemenu_fnSetPieceVis done")
end

-- Sets text for the camera entry to the right settings
function ifs_pausemenu_fnUpdateFreecamText(this)
if(this.buttons.freecam) then
if(this.bChaseCam) then
RoundIFButtonLabel_fnSetString(this.buttons.freecam,"game.pause.followcam")
else
RoundIFButtonLabel_fnSetString(this.buttons.freecam,"game.pause.freecam")
end
end
end

-- Callback for when the "really quit?" popup is over.  If bResult is
-- true, user wanted to quit
function ifs_pausemenu_fnQuitPopupDone(bResult)
local this = ifs_pausemenu

if(bResult) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
ScriptCB_QuitToShell()
else
ifelm_shellscreen_fnPlaySound(this.cancelSound)
ifs_pausemenu_fnSetPieceVis(this, 1)
end
Popup_YesNo.fnDone = nil
end

function ifs_pausemenu2_fnQuitPopupDone(bResult)
local this = ifs_pausemenu2

if(bResult) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
ScriptCB_QuitToShell()
else
ifelm_shellscreen_fnPlaySound(this.cancelSound)
ifs_pausemenu_fnSetPieceVis(this,1) -- restore screen on 'no' only
end
Popup_YesNo.fnDone = nil
end

-- Callback for when the "really quit?" popup is over.  If bResult is
-- true, user wanted to quit
function ifs_pausemenu_fnExitPopupDone(bResult)
local this = ifs_pausemenu

if(bResult) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
ScriptCB_QuitToWindows()
else
ifelm_shellscreen_fnPlaySound(this.cancelSound)
ifs_pausemenu_fnSetPieceVis(this,1) -- restore screen on 'no' only
end
Popup_YesNo.fnDone = nil
end

-- Callback for when the "really quit?" popup is over.  If bResult is
-- true, user wanted to quit
function ifs_pausemenu_fnSuicidePopupDone(bResult)
local this = ifs_pausemenu
ifs_pausemenu_fnSetPieceVis(this,1) -- always restore screen

if(bResult) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
ScriptCB_PlayerSuicide(0) -- top player
ScriptCB_Unpause()
else
ifelm_shellscreen_fnPlaySound(this.cancelSound)
end

Popup_YesNo.fnDone = nil
end

-- Callback for when the "really quit?" popup is over.  If bResult is
-- true, user wanted to quit
function ifs_pausemenu2_fnSuicidePopupDone(bResult)
local this = ifs_pausemenu2
ifs_pausemenu_fnSetPieceVis(this,1) -- always restore screen

if(bResult) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
ScriptCB_PlayerSuicide(1) -- bottom player
ScriptCB_Unpause()
else
ifelm_shellscreen_fnPlaySound(this.cancelSound)
end

Popup_YesNo.fnDone = nil
end

-- Callback for when the "really restart?" popup is over.  If bResult is
-- true, user wanted to restart
function ifs_pausemenu_fnRestartPopupDone(bResult)
local this = ifs_pausemenu

if(bResult) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
ScriptCB_RestartMission()
else
ifelm_shellscreen_fnPlaySound(this.cancelSound)
ifs_pausemenu_fnSetPieceVis(this,1) -- restore screen on 'no' only
end

Popup_YesNo.fnDone = nil
end

function ifs_pausemenu2_fnRestartPopupDone(bResult)
local this = ifs_pausemenu2

if(bResult) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
ScriptCB_RestartMission()
else
ifelm_shellscreen_fnPlaySound(this.cancelSound)
ifs_pausemenu_fnSetPieceVis(this,1) -- restore screen on 'no' only
end

Popup_YesNo.fnDone = nil
end

ifs_pausemenu = NewIFShellScreen {
nologo = 1,
movieIntro      = nil, -- played before the screen is displayed
movieBackground = nil, -- played while the screen is displayed
bFriendsIcon = 1,

-- title = NewIFText {
-- string = "game.pause.title",
-- font = "gamefont_large",
-- textw = 460,
-- y = 10,
-- ScreenRelativeX = 0.5, -- center
-- ScreenRelativeY = 0, -- top
-- },

buttons = NewIFContainer {
ScreenRelativeX = 0.6, -- center
ScreenRelativeY = 0.5, -- center
y = 20, -- a little down from center
rotY = 25,
},

Enter = function(this, bFwd)
gIFShellScreenTemplate_fnEnter(this, bFwd)

-- if we're returning from the below, bail right back to the game
if((not bFwd) and this.PopAfterPlayerList) then
this.PopAfterPlayerList = nil
ScriptCB_ResetSkipToPlayerList()
ScriptCB_Unpause()
return
end
-- if we're in a net game and the user hits 'tab', jump right to the player list
if(bFwd and ScriptCB_SkipToPlayerList() and ScriptCB_InNetGame()) then
this.PopAfterPlayerList = 1
ifs_movietrans_PushScreen(ifs_mp_lobby)
return
end
this.PopAfterPlayerList = nil
ScriptCB_ResetSkipToPlayerList()

ifs_pausemenu_fnUpdateFreecamText(this)
IFButton_fnSelect(this.buttons[this.CurButton],nil) -- Deactivate old button

-- Refresh which buttons are shown
this.buttons.lobby.hidden = gDemoBuild or (not ScriptCB_InNetGame())

if(ScriptCB_AreMetagameRulesOn()) then
this.buttons.restart.hidden = 1
else
this.buttons.restart.hidden = ScriptCB_InNetGame()
end

this.buttons.exit.hidden = (gPlatformStr ~= "PC" or ScriptCB_InNetGame())
this.buttons.freecam.hidden = gDemoBuild or gFinalBuild

local bShowFriends = ((gPlatformStr == "XBox") and (ScriptCB_XL_IsLoggedIn(1))) -- only visible if successfully signed in

this.buttons.friends.hidden = not bShowFriends
if(this.buttons.recent) then
this.buttons.recent.hidden = not ((ScriptCB_InNetGame()) and (gOnlineServiceStr == "XLive"))
end
this.buttons.console.hidden = gDemoBuild or gFinalBuild

if(ScriptCB_IsDedicated()) then
this.buttons.freecam.hidden = 1
-- this.buttons.lobby.hidden = 1 -- Disabled NM 7/22/04 - I think we need to show this
this.buttons.opts.hidden = 1
this.buttons.suicide.hidden = 1
this.CurButton = ShowHideVerticalButtons(this.buttons,ifspausemenu_vbutton_layout)
elseif(not ScriptCB_IsSplitscreen()) then
this.CurButton = ShowHideVerticalButtons(this.buttons,ifspausemenu_vbutton_layout)
else
this.buttons.lobby.hidden    = 1
this.buttons.exit.hidden     = 1
this.CurButton = ShowHideVerticalButtons(this.buttons,ifspausemenu_split_vbutton_layout)
end

if (bFwd) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
end

SetCurButton(this.CurButton)

-- Move friends icon if appropriate
if(bShowFriends) then
local XPos = ScriptCB_IFText_GetTextExtent(this.buttons.friends.label.cpointer) + 30
local YPos = this.buttons.friends.y - 15
IFObj_fnSetPos(this.buttons.FriendIcon,XPos,YPos)
else
IFObj_fnSetVis(this.buttons.FriendIcon, nil) -- just hide it.
end
end,

Input_Accept = function(this)
-- If base class handled this work, then we're done
if(gShellScreen_fnDefaultInputAccept(this)) then
return
end

ifelm_shellscreen_fnPlaySound(this.acceptSound)

if(this.CurButton == "resume") then
ScriptCB_Unpause()
elseif ((this.CurButton == "quit") and (not Popup_YesNo.fnDone)) then
-- this hack
ScriptCB_SetQuitPlayer(1)

Popup_YesNo.CurButton = "no" -- default
Popup_YesNo.fnDone = ifs_pausemenu_fnQuitPopupDone
if(ScriptCB_GetAmHost()) then
if (ScriptCB_AreMetagameRulesOn()) then
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_quit_meta")
else
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_host_quit")
end
elseif (ScriptCB_AreMetagameRulesOn()) then
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_quit_meta")
else
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_quit")
end
ifs_pausemenu_fnSetPieceVis(this, nil)
Popup_YesNo:fnActivate(1)
elseif (this.CurButton == "freecam") then
this.bChaseCam = not this.bChaseCam
ScriptCB_Freecamera()
ifs_pausemenu_fnUpdateFreecamText(this)
elseif (this.CurButton == "exit") then
Popup_YesNo.CurButton = "no" -- default
Popup_YesNo.fnDone = ifs_pausemenu_fnExitPopupDone
IFText_fnSetString(Popup_YesNo.title,"ifs.main.askquit")
ifs_pausemenu_fnSetPieceVis(this, nil)
Popup_YesNo:fnActivate(1)
elseif (this.CurButton == "lobby") then
ifs_movietrans_PushScreen(ifs_mp_lobby)
elseif (this.CurButton == "opts") then
ifs_movietrans_PushScreen(ifs_opt_contmain)
elseif (this.CurButton == "friends") then
if(gPlatformStr == "XBox") then
ifs_mpxl_friends.bRecentMode = nil
ifs_movietrans_PushScreen(ifs_mpxl_friends)
end
elseif (this.CurButton == "recent") then
ifelm_shellscreen_fnPlaySound("shell_menu_accept")   
ifs_mpxl_friends.bRecentMode = 1
ifs_movietrans_PushScreen(ifs_mpxl_friends)
elseif (this.CurButton == "stats") then
ifs_movietrans_PushScreen(ifs_teamstats)
elseif (this.CurButton == "console") then
ifs_movietrans_PushScreen(ifs_fakeconsole)
elseif ((this.CurButton == "restart") and (not Popup_YesNo.fnDone)) then
Popup_YesNo.CurButton = "no" -- default
Popup_YesNo.fnDone = ifs_pausemenu_fnRestartPopupDone
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_restart")
ifs_pausemenu_fnSetPieceVis(this, nil)
Popup_YesNo:fnActivate(1)
elseif ((this.CurButton == "suicide")  and (not Popup_YesNo.fnDone)) then
Popup_YesNo.CurButton = "no" -- default
Popup_YesNo.fnDone = ifs_pausemenu_fnSuicidePopupDone
IFText_fnSetString(Popup_YesNo.title,"game.pause.suicide_prompt")
ifs_pausemenu_fnSetPieceVis(this, nil)
Popup_YesNo:fnActivate(1)
end
end,

-- Override default behavior
Input_Back = function(this)
ifelm_shellscreen_fnPlaySound(this.exitSound)
ScriptCB_Unpause()
end,
}

ifs_pausemenu2 = NewIFShellScreen2 {
nologo = 1,
bFriendsIcon = 1,

-- title = NewIFText {
-- string = "game.pause.title",
-- font = "gamefont_medium",
-- textw = 460,
-- y = 0,
-- ScreenRelativeX = 0.5, -- center
-- ScreenRelativeY = 0, -- top
-- },

buttons = NewIFContainer {
ScreenRelativeX = 0.6, -- center
ScreenRelativeY = 0.5, -- center
y = 20, -- a little down from center
rotY = 25,
},

Enter = function(this, bFwd)
gIFShellScreenTemplate_fnEnter(this, bFwd)

IFButton_fnSelect(this.buttons[this.CurButton],nil) -- Deactivate old button

local bShowFriends = ((gPlatformStr == "XBox") and (ScriptCB_XL_IsLoggedIn(1))) -- only visible if successfully signed in

this.buttons.freecam.hidden  = 1
this.buttons.lobby.hidden    = 1
this.buttons.friends.hidden = not bShowFriends
this.buttons.console.hidden  = 1
this.buttons.lobby.hidden = 1
this.buttons.restart.hidden  = ScriptCB_AreMetagameRulesOn()
this.buttons.exit.hidden = 1
this.CurButton = ShowHideVerticalButtons(this.buttons,ifspausemenu_split_vbutton_layout)
local EntryHilight = gCurHiliteButton
SetCurButton(this.CurButton)
gCurHiliteButton2 = gCurHiliteButton
gCurHiliteButton = EntryHilight

if (bFwd) then
ifelm_shellscreen_fnPlaySound(this.acceptSound)
end

-- Move friends icon if appropriate
if(bShowFriends) then
local XPos = ScriptCB_IFText_GetTextExtent(this.buttons.friends.label.cpointer) + 30
local YPos = this.buttons.friends.y - 15
IFObj_fnSetPos(this.buttons.FriendIcon,XPos,YPos)
else
IFObj_fnSetVis(this.buttons.FriendIcon, nil) -- just hide it.
end

end,

Input_Accept = function(this)
-- If base class handled this work, then we're done
if(gShellScreen_fnDefaultInputAccept(this)) then
return
end

ifelm_shellscreen_fnPlaySound(this.acceptSound)

if(this.CurButton == "resume") then
ScriptCB_Unpause(1)
elseif ((this.CurButton == "quit") and (not Popup_YesNo.fnDone)) then
-- this hack
ScriptCB_SetQuitPlayer(2)

Popup_YesNo.CurButton = "no" -- default
Popup_YesNo.fnDone = ifs_pausemenu2_fnQuitPopupDone
if(ScriptCB_AreMetagameRulesOn()) then
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_quit_meta")
else
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_quit")
end
ifs_pausemenu_fnSetPieceVis(this, nil)
Popup_YesNo:fnActivate(1)
elseif (this.CurButton == "exit") then
ScriptCB_QuitToWindows()
elseif (this.CurButton == "friends") then
if(gPlatformStr == "XBox") then
ifs_mpxl_friends.bRecentMode = nil
ifs_movietrans_PushScreen(ifs_mpxl_friends)
end
elseif (this.CurButton == "freecam") then
this.bChaseCam = not this.bChaseCam
ScriptCB_Freecamera()
ifs_pausemenu_fnUpdateFreecamText(this)
elseif (this.CurButton == "lobby") then
ifs_movietrans_PushScreen(ifs_pause_lobby)
elseif (this.CurButton == "opts") then
ifs_movietrans_PushScreen(ifs_opt_contmain)
elseif ((this.CurButton == "restart")  and (not Popup_YesNo.fnDone)) then
Popup_YesNo.CurButton = "no" -- default
Popup_YesNo.fnDone = ifs_pausemenu2_fnRestartPopupDone
IFText_fnSetString(Popup_YesNo.title,"ifs.pause.warn_restart")
ifs_pausemenu_fnSetPieceVis(this, nil)
Popup_YesNo:fnActivate(1)
elseif ((this.CurButton == "suicide")  and (not Popup_YesNo.fnDone)) then
Popup_YesNo.CurButton = "no" -- default
Popup_YesNo.fnDone = ifs_pausemenu2_fnSuicidePopupDone
IFText_fnSetString(Popup_YesNo.title,"game.pause.suicide_prompt")
ifs_pausemenu_fnSetPieceVis(this, nil)
Popup_YesNo:fnActivate(1)
end
end,

-- Override default behavior
Input_Back = function(this)
ifelm_shellscreen_fnPlaySound(this.exitSound)
ScriptCB_Unpause(1)
end,
}

if(not ScriptCB_IsSplitscreen()) then
ifs_pausemenu.CurButton = AddVerticalButtons(ifs_pausemenu.buttons,ifspausemenu_vbutton_layout)
AddIFScreen(ifs_pausemenu,"ifs_pausemenu", 1)

ifs_pausemenu2 = nil -- flush from memory
else
-- is splitscreen. Rearrange things
-- ifs_pausemenu.title.y = 0
-- ifs_pausemenu.title.font = "gamefont_medium"

ifs_pausemenu.CurButton = AddVerticalButtons(ifs_pausemenu.buttons,ifspausemenu_split_vbutton_layout)
ifs_pausemenu.Viewport = 0
AddIFScreen(ifs_pausemenu,"ifs_pausemenu")

ifs_pausemenu2.CurButton = AddVerticalButtons(ifs_pausemenu2.buttons,ifspausemenu_split_vbutton_layout)
ifs_pausemenu2.Viewport = 1
AddIFScreen(ifs_pausemenu2,"ifs_pausemenu2")
end


Remember that double minus symbols -- are nulls which cancel out a command. So if you want to enable freecam just go to line 233 and add -- in front of this line:
this.buttons.freecam.hidden = gDemoBuild or gFinalBuild

October 09, 2013, 03:55:55 AM #1 Last Edit: March 02, 2014, 03:54:19 PM by tirpider
Some notes:
Code (lua) Select

ScriptCB_SetMetagameRulesOn()   -- (1) or (nil)
ScriptCB_SetHistoricalRulesOn() -- (1) or (nil)
ScriptCB_SetCanSwitchSides()    -- (1) or (nil)

Part of Input_Accept in the ifs_sp screen at the moment a button selecting Campaign, Galactic Conquest, or Instant Action is pressed.

Still not sure what they affect, but that's the proper place to set them. In the shell, before any maps are selected and after sp/mp has been decided.

Have not tested using them via fake console or pausemenu. I believe they set up stuff for map initialization, so using them in-game would (should) have no effect.




Found the dates for timestamping:
Code (lua) Select
TheDate = gsub(ScriptCB_GetDateStr(),"%z","")
ScriptCB_GetDateStr() does in-fact return a string, but every other character is a null (0x00), so they won't be displayed in most text editors.

To get a proper date out of it, use gsub to replace the nulls with an empty string "".
(gsub uses the pattern %z to recognize nulls. yeah, we should have been able to guess that.. silly us...)
The above will return a string similar to:
Code (lua) Select
2013-10-09 0656
format() could be used to process it further.

As-is, it's only good for min to min timming, but experimenting with passing parameters to ScriptCB_GetDateStr() may expose seconds or miliseconds. Probably something like the C printf formatting strings stuff. Not sure.




ScriptCB_FormatTimeString() does format a time string, but you have to feed it a number (in seconds). Otherwise it fails.
Code (lua) Select
SomeTime = gsub(ScriptCB_FormatTimeString(903),"%z","")
-- will return:
-- 15:03

Again, the string it returns is peppered with nulls, so they must be stripped before using.

The only instance I found of it was in metagame_util.lua, where it gets it's number from a property called .CurTime which gets it's values from a metagame structure I haven't explored yet. I'm betting C is feeding a var in Lua space the seconds. We may not have access to it anyplace else.




Testing for nulls, I (redundantly) confirm that the Lua System commands, date() and clock() return a nil value, and cannot be compared, printed or used for producing anything other than a nil.




ScriptCB_GetMissionTime() returns the mission time as a string formatted as min:sec:mil as min:sec. Pretty handy, but still no milliseconds.
I tested it from the pause menu in a single player game. It returns 0 when called from the shell.

(Lua re-casts the var type as needed, so it may be returning a number or string, but it will still be able to be compared because of the same auto-casting behavior.)




--[dificulty stuff]--

Code (lua) Select
--ScriptCB_GetDifficulty()
-- returns: number representing the current difficulty.
--          retrieved from the current profile.
--          [1, 2, or 3](easy, medium, hard)
-- found in: [line numbers in brackets]
--           ifs_difficulty.lua [35]
--           ifs_difficulty_demo.lua [40]
--           ifs_instant_top.lua [19]
--           ifs_opt_general.lua [58][60][187][218][249]
--           ifs_sp_briefing.lua [765]



Code (lua) Select
--ScriptCB_SetAIDifficulty(n1, n2)
-- parameters: n1 and n2 should be numbers.
--             they have something to do with the number of availiable maps in
--             galactic conquest.
-- found in: [line numbers in brackets]
--           ifs_meta_battle.lua [32][34][131][133]
-- notes: I believe it sets some metric for the GC AI and has nothing to do with
--        the in-game AI.



Code (lua) Select
--ScriptCB_SetDifficulty(n)
-- parameters: n should be a number
--          [1, 2, or 3](easy, medium, hard)
-- found in: [line numbers in brackets]
--           ifs_difficulty.lua [60]
--           ifs_difficulty_demo.lua [48]
--           ifs_instant_top.lua [19]
--           ifs_opt_general.lua [187][218][249]
--           ifs_sp_briefing.lua [765]
-- notes: Pretty sure it sets the difficulty in the profile, so if a map is
--        already initialized, this won't have an effect on the current map.



Code (lua) Select
--SetEnemyTeamDifficulty(n)
--SetPlayerTeamDifficulty(n)
-- parameters: n should be a number
-- notes: the only example is commented out in kam1c.lua with 11 as it's number. Most likely a depreciated feature.


Code (lua) Select
--SetEnemyTeamDifficultyEasy(n)
--SetEnemyTeamDifficultyMedium(n)
--SetEnemyTeamDifficultyHard(n)
--SetPlayerTeamDifficultyEasy(n)
--SetPlayerTeamDifficultyMedium(n)
--SetPlayerTeamDifficultyHard(n)
-- parameters: n should be a number
-- found in: all the hustorical mission luas.
-- notes: they seem to accept a wider range of values than SetDifficulty.
          And all appear in the same files. Don't know how to use them.