Fun with LUA functions (FAQ)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Fun with LUA functions

Post by [RDH]Zerted »

SetGroundFlyerMap() --Never used this one. The only code example is:

Code: Select all

SetGroundFlyerMap(1)
SetFlagGameplayType() --This is used in the old FakeConsole (commands starting with FlagGamePlayType). It changes the hud to the different modes. I've never done much with figuring out the hud. If the huds have different names/labels then you might be able to use this to swap between custom huds. This function only affects your screen. Examples:

Code: Select all

SetFlagGameplayType("1flag")
SetFlagGameplayType("2flag")
SetFlagGameplayType("campaign")
SetFlagGameplayType("none")
ForceHumansOntoTeam1() --I thought the campaign mode used this to keep you on team 1, but I couldn't find it when searching for it. I thought I saw it in use somewhere...
SnapMapCamera() --This is used in the old FakeConsole (command Snap Map Camera). I don't know what it does.
SetHistorical() --I haven't decided if I wanted to include this in the new FakeConsole. I haven't tested it yet, so I don't know what it does. The only code example is:

Code: Select all

SetHistorical()
However, there is:

Code: Select all

ScriptCB_SetHistoricalRulesOn(1)
ScriptCB_SetHistoricalRulesOn(nil)
SetHeroUnlockRule() --There are no code examples for this one. I assumed the same thing you did, thats its parameter would be the same as the command line argument value to change the hero unlock rules.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Fun with LUA functions

Post by Maveritchell »

[RDH]Zerted wrote:ForceHumansOntoTeam1() --I thought the campaign mode used this to keep you on team 1, but I couldn't find it when searching for it. I thought I saw it in use somewhere...
That can be used to do that; I've played around with it. However, I'm pretty sure it's redundant in campaign maps (and I think this applies for the stock campaigns as well) because setting the gametype rules to "campaign" forces the player onto team 1 and disallows another team from showing up on the spawn screen.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11079
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Fun with LUA functions

Post by Teancum »

[RDH]Zerted wrote:SetHeroUnlockRule() --There are no code examples for this one. I assumed the same thing you did, thats its parameter would be the same as the command line argument value to change the hero unlock rules.
I'll have to look at this. If I can disable MP heroes totally in Classic Conquest then that'd be awesome. And I assume that LUA would trump whatever the server settings are.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11079
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Fun with LUA functions

Post by Teancum »

Even more fun news I found on Fred's site, regarding vehicles and capturing CPs.

You can now specify whether a unit (or vehicle) can capture command posts:
CapturePosts = 1 (yes)
CapturePosts = 0 (no)

So VH TDM and VH Conquest would definitely work.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Fun with LUA functions

Post by [RDH]Zerted »

Yup, there are a lot of things you can do if you read all the docs.
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Fun with LUA functions

Post by Caleb1117 »

Teancum wrote:Even more fun news I found on Fred's site, regarding vehicles and capturing CPs.

You can now specify whether a unit (or vehicle) can capture command posts:
CapturePosts = 1 (yes)
CapturePosts = 0 (no)

So VH TDM and VH Conquest would definitely work.
Wow, I didn't know those codes applied to Vehicles as well.
I used it so my Mandalorians wouldn't be taking CP's on Dantooine.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11079
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Fun with LUA functions

Post by Teancum »

Here's a list of all the functions I extracted from the exe:

SetEffectActive
IsEffectActive
SetEffectMatrix
GetEffectMatrix
AttachEffectToMatrix
AttachEffectToObject
RemoveEffect
CreateEffect
DisableSmallMapMiniMap
Print3D
GetFlagCarrier
CanCharacterInteractWithFlag
ForceHumansOntoTeam1
SetMapNorthAngle
AddShieldStrength
TranslateAICommand
SetAIDamageThreshold
AICanCaptureCP
ForceAIOutOfVehicles
DisableBarriers
EnableBarriers
ToggleBarriers
UnblockPlanningGraphArcs
BlockPlanningGraphArcs
TogglePlanningGraphArcs
AddAIGoal
DeleteAIGoal
ClearAIGoals
SetMissionEndMovie
MissionDefeat
MissionVictory
GetCommandPostTeam
GetCommandPostBleedValue
GetCommandPostCaptureRegion
GetCharacterControllable
GetCharacterRemote
GetCharacterVehicle
GetCharacterUnit
SpawnCharacter
SelectCharacterClass
GetCharacterClass
AllowAISpawn
BatchChangeTeams
IsCharacterHuman
SelectCharacterTeam
GetCharacterTeam
GetTeamMember
GetTeamClassCount
GetTeamSize
SetAnimationStartPoint
PlayAnimationFromTo
RewindAnimation
PauseAnimation
PlayAnimation
GetScreenPosition
GetWorldPosition
CreateMatrix
GetNumTeamMembersAlive
GetPathPoint
EnableFlyerPath
ExitVehicle
EnterVehicle
EntityFlyerInitAsLanded
EntityFlyerInitAsFlying
EntityFlyerLand
EntityFlyerTakeOff
SetClassProperty
GetEntityClassPtr
DeleteEntity
CreateEntity
SetProperty
GetEntityMatrix
SetEntityMatrix
GetEntityClassName
GetEntityClass
GetEntityName
GetEntityPtr
RespawnObject
KillObject
GetObjectLastHitWeaponClass
GetObjectShield
GetObjectHealth
IsObjectAlive
GetObjectTeam
SetObjectTeam
DeactivateObject
ActivateObject
GetObjectPtr
SetVictoryTimer
SetMissionTimer
SetDefeatTimer
GetTimerName
GetTimerRate
SetTimerRate
GetTimerValue
SetTimerValue
StopTimer
StartTimer
DestroyTimer
CreateTimer
FindTimer
EnableBuildingLockOn
MapHideCommandPosts
MapRemoveClassMarker
MapAddClassMarker
MapRemoveEntityMarker
MapAddEntityMarker
MapRemoveRegionMarker
MapAddRegionMarker
SetParticleLODBias
SetMaxCollisionDistance
ScriptCB_PlayerSuicide
BroadcastVoiceOver
ShowSelectionTextPopup
ShowTimer
ShowObjectiveTextPopup
ShowPopup
ShowMessageText
GetWorldFilename
IsCampaign
SpaceAssaultGetScoreLimit
SpaceAssaultSetupBitmaps
SpaceAssaultSetupTeamNumbers
SpaceAssaultLinkCriticalSystems
SpaceAssaultAddCriticalSystem
SpaceAssaultEnable
SetFlagGameplayType AddMissionHint
CompleteObjective
ActivateObjective
AddMissionObjective
SetAIDifficulty
DisableAIAutoBalance
EnableAIAutoBalance
SetGroundFlyerMap
AISnipeSuitabilityDist
SetAIViewMultiplier
SetAIVehicleNotifyRadius
AddWalkerType
ClearWalkers
RemoveRegion
AddLandingRegion
AddDeathRegion
FillAsteroidPath
FillAsteroidRegion
SetFishType
SetNumFishTypes
SetBirdFlockMinHeight
SetBirdType
SetNumBirdTypes
SetMemoryPoolSize
SetStayInTurrets
SetDefenderSnipeRange
SetAttackerSnipeRange
SetDenseEnvironment
SetUrbanEnvironment
SetSpawnDelayTeam
SetSpawnDelay
SetCarrierClass
GetBleedRate
SetBleedRate
ActivateBonus
ShowTeamPoints
ShowAllUnitsOnMinimap
AcceptHero
UnlockHeroForTeam
EnableSPScriptedHeroes
SetHeroRespawnRule
SetHeroPlayerRule
SetHeroTeamRule
SetHeroUnlockRule
EnableSPHeroRules
SetHeroClass
AddUnitClass
GetTeamFactionId
AddSpaceAssaultDestroyPoints
AddAssaultDestroyPoints
AddFlagCapturePoints
AddTeamPoints
GetTeamPoints
SetTeamPoints
AddReinforcements
GetReinforcementCount
SetReinforcementCount
GetUnitCount
SetUnitCount
SetTeamAsFriend
SetTeamAsNeutral
SetTeamAsEnemy
SetTeamIcon
SetStationaryWaitTime
SetAllowBlindJetJumps
SetUberMode
SetMaxPlayerFlyHeight
SetMinPlayerFlyHeight
SetMaxFlyHeight
SetMinFlyHeight
SetTeamAggressiveness
SetTeamName
SetHistorical
SetState
SnapMapCamera
GetMapCameraZoom
SetMapCameraZoom
SetMapCameraPitch
SetMapCameraOffset
SetMapCameraPosition
GetMapCameraPosition
MoveCameraToEntity
SetCameraPosition
SetCameraRotation
AddCameraShot
ClearTempHeap
SetupTempHeap
ReadDataFileInGame
ReadDataFile
StealArtistHeap
SetWorldExtents
SetPS2ModelMemory
FindEntityClass


*CONTINUED BELOW*
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11079
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Fun with LUA functions

Post by Teancum »

IsCharacterInRegion
GetRegionName
DeactivateRegion
ActivateRegion
GetRegion
ActiveRegion
ScriptCB_SetPlayerAwardsEnabled
ScriptCB_GetPlayerAwardsEnabled
ScriptCB_SetBandwidth
ScriptCB_GetBandwidth
ScriptCB_SearchStatsRank
ScriptCB_CanClientLeaveStats
ScriptCB_GetVoiceTVGain
ScriptCB_GetVoiceCaptureConnected
ScriptCB_GetVoiceRenderConnected
ScriptCB_GetVoiceReceiveStatus
ScriptCB_SetVoiceReceiveEnable
ScriptCB_GetVoiceSendStatus
ScriptCB_SetVoiceSendEnable
ScriptCB_GetVoiceReceivePreset
ScriptCB_SetVoiceReceivePreset
ScriptCB_GetVoiceSendPreset
ScriptCB_SetVoiceSendPreset
ScriptCB_SetVoiceLocalEchoEnable
ScriptCB_GetVoiceEnable
ScriptCB_VoiceEnable
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_IsQuickmatchPassworded
ScriptCB_IsQuickmatchDone
ScriptCB_CancelQuickmatch
ScriptCB_LaunchQuickmatch
ScriptCB_UpdateQuickmatch
ScriptCB_BeginJoinSpecial
ScriptCB_BeginJoinIP
ScriptCB_BeginQuickmatch
ScriptCB_IsGamespyArcadePasswordReady
ScriptCB_GetCmdlineLogin
ScriptCB_IsCmdlineJoinPending
ScriptCB_IsSpecialJoinPending
ScriptCB_PreviousHost
ScriptCB_NextHost
ScriptCB_SetAsFavorite
ScriptCB_SetSessionSortMode
ScriptCB_GetSessionSortMode
ScriptCB_ApplyFilters
ScriptCB_SetFilters
ScriptCB_GetFilters
ScriptCB_GetExtraSessionInfo
ScriptCB_GetSessionListPercent
ScriptCB_IsSessionReady
ScriptCB_GetSessionList
ScriptCB_PauseSessionList
ScriptCB_CancelSessionList
ScriptCB_LaunchSessionList
ScriptCB_UpdateSessionList
ScriptCB_BeginSessionList
ScriptCB_ClearPrevSessionId
ScriptCB_CancelLobby
ScriptCB_LaunchLobby
ScriptCB_HasServerLaunched
ScriptCB_UpdateLobby
ScriptCB_BeginLobby
ScriptCB_IsGuest
ScriptCB_TrackLoginErrors
ScriptCB_CancelLogin
ScriptCB_StartLoginDedicatedServer
ScriptCB_StartLogin
ScriptCB_GetLoginName
ScriptCB_IsLoggedIn
ScriptCB_IsLoginDone
ScriptCB_SetGSProfileInfo
ScriptCB_GetGSProfileInfo
ScriptCB_ClearError
ScriptCB_GetError
ScriptCB_GetLatestError
ScriptCB_EnablePlayback
ScriptCB_EnableJournal
ScriptCB_GetConnectType
ScriptCB_SetConnectType
ScriptCB_GetAutoAssignTeams
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_GetWasHost
ScriptCB_GetAmHost
ScriptCB_SetAmHost
ScriptCB_SetNetLoginName
ScriptCB_GetOnlineService
ScriptCB_AutoNetJoin
ScriptCB_SetNetHeroDefaults
ScriptCB_GetNetHeroDefaults
ScriptCB_SetNetGameDefaults
ScriptCB_GetNetGameDefaults
ScriptCB_GetOnlineOpts
ScriptCB_SetOnlineOpts
ScriptCB_GetSideSelectButtonSetting
ScriptCB_GetSpectatorMode
ScriptCB_SetSpectatorMode
ScriptCB_SetAIDifficulty
ScriptCB_GetGameRules
ScriptCB_SetGameRules
ScriptCB_SetCanSwitchSides
ScriptCB_SetMetaAllMapsOn
ScriptCB_IsMetaAllMapsOn
ScriptCB_GetControlMode
ScriptCB_SetControlMode
ScriptCB_ResetToolTips
ScriptCB_SetToolTipState
ScriptCB_PrevToolTipState
ScriptCB_NextToolTipState
ScriptCB_GetHUDScale
ScriptCB_SetHUDScale
ScriptCB_SetHorizontalSplitScreen
ScriptCB_IsHorizontalSplitScreen
ScriptCB_SetGeneralOptions
ScriptCB_GetGeneralOptions
ScriptCB_ResetOnlineOptionsToDefault
ScriptCB_ResetSoundToDefault
ScriptCB_ResetGameOptionsToDefault
ScriptCB_ResetControlsToDefault
ScriptCB_SetControlScale
ScriptCB_GetControlScale
ScriptCB_SetMouseTurnAssist
ScriptCB_GetMouseTurnAssist
ScriptCB_SetYAxisFlip
ScriptCB_GetYAxisFlip
ScriptCB_SetFunctionIdForAnalogId
ScriptCB_GetFunctionIdForAnalogId
ScriptCB_SetFunctionIdForButtonId
ScriptCB_GetFunctionIdForButtonId
ScriptCB_GetASSNumBots
ScriptCB_GetCTFNumBots
ScriptCB_GetCONNumBots
ScriptCB_GetCONMaxTimeLimit
ScriptCB_GetCTFMaxTimeLimit
ScriptCB_SetUberScoreLimit
ScriptCB_GetUberScoreLimit
ScriptCB_GetAssaultScoreLimit
ScriptCB_ShowHuntScoreLimit
ScriptCB_GetHuntScoreLimit
ScriptCB_GetHuntMaxTimeLimit
ScriptCB_GetCTFCaptureLimit
ScriptCB_GetDifficulty
ScriptCB_SetDifficulty
ScriptCB_SetPlayerSide
ScriptCB_WasSplitscreen
ScriptCB_IsSplitscreen
ScriptCB_GetNumCameras
ScriptCB_SetSplitscreen
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11079
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Fun with LUA functions

Post by Teancum »

ScriptCB_GetKeyboardPCFlags
ScriptCB_CheckMouseMark
ScriptCB_ResetMouseMark
ScriptCB_SetMouseMark
GetMultisamplingModeDescription
GetNumMultisamplingQualityModes
GetMaxMultisamplingModeForScreenSize
GetMaxScreenSizeForMultisamplingMode
IsMultisamplingModeSupported
IsMultisamplingModeForcedFromDriver
IsVideoModeSupported
ScriptCB_ResetPCVideoOptionsToDefault
ScriptCB_SetProfileJoinIP
ScriptCB_GetProfileJoinIP
ScriptCB_IsPCVideoFixedFunction
ScriptCB_SetPCBrightnessContrast
ScriptCB_SetPCVideoOptions
ScriptCB_GetCustomVideoOptions
ScriptCB_GetAutodetectPCVideoOptions
ScriptCB_GetPCVideoOptions
ScriptCB_GetCustomResolution
ScriptCB_GetIdealResolution
ScriptCB_SetResolution
ScriptCB_FillMultisampleTable
ScriptCB_FillResolutionTable
ScriptCB_GetReticuleTransparency
ScriptCB_SetReticuleTransparency
ScriptCB_SetJoystickEnabled
ScriptCB_IsJoystickEnabled
ScriptCB_SetDeadZone
ScriptCB_SetJoySensitivity
ScriptCB_SetMouseSensitivity
ScriptCB_GetDeadZone
ScriptCB_GetJoySensitivity
ScriptCB_GetMouseSensitivity
ScriptCB_TriggerSoundRegionEnable
ScriptCB_EnableHeroVO
ScriptCB_EnableHeroMusic
ScriptCB_EnableCommandPostVO
ScriptCB_StopInGameMusic
ScriptCB_PlayInGameMusic
ScriptCB_SetDopplerFactor
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_SetMixConfig
ScriptCB_GetMixConfig
ScriptCB_SetOutputMode
ScriptCB_NextOutputMode
ScriptCB_PreviousOutputMode
ScriptCB_GetOutputMode
ScriptCB_HWSupport
ScriptCB_ToggleEffects
ScriptCB_EffectsEnabled
ScriptCB_SetVolumes
ScriptCB_GetVolumes
ScaleSoundParameter
SetOutOfBoundsVoiceOver
SetDefeatMusic
SetVictoryMusic
SetAttackingTeam
SetAmbientMusic
ScriptCB_SetSpawnDisplayGain
SetSoundEffect
SetLowReinforcementsVoiceOver
ScriptCB_SetBleedingRepeatTime
SetBleedingVoiceOver
SetReservesVO
SetPlanetaryBonusVoiceOver
AudioStreamAppendSegments
AudioStreamComplete
CloseAudioStream
OpenAudioStream
StopAudioStream
PlayAudioStreamUsingProperties
PlayAudioStream
ScriptCB_SndPlaySound
ScriptCB_SndBusFade


That's it!
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Fun with LUA functions

Post by Maveritchell »

Nice to see them all in one place! Now all we need to do is make a list of inputs for each of those. Nooo problem, yes? :P
MasterSaitek009
Black Sun Slicer
Posts: 619
Joined: Wed Aug 23, 2006 4:10 pm

Re: Fun with LUA functions

Post by MasterSaitek009 »

Yeah!! Three cheers for Tean!
Print3D
Any guesses on what this one does? :|
Syth
General
General
Posts: 784
Joined: Thu Apr 13, 2006 8:46 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: happy fun island

Re: Fun with LUA functions

Post by Syth »

I wonder how much of these actually work...
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Fun with LUA functions

Post by [RDH]Zerted »

I've seen all but around 15-25 of those functions. Some of those are never used and I've seen their actions done in a different way, so I'd assume they don't work. Keep in mind that some only work in the shell and others only work ingame. Not all of those are for the PC too.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11079
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Fun with LUA functions

Post by Teancum »

[RDH]Zerted wrote:SetGroundFlyerMap() --Never used this one. The only code example is:

Code: Select all

SetGroundFlyerMap(1)
Either it's an AI only function or it's been disabled in SWBF2. I saw no changes using this in-game just now.
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Fun with LUA functions

Post by Caleb1117 »

If only Freddie old boy was here.

you sure it didn't do anything? I thought it kept the AI from flying to low.

Edit: oh, that would be AI only, nevermind.
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Fun with LUA functions

Post by RepSharpshooter »

Teancum wrote:
[RDH]Zerted wrote:SetGroundFlyerMap() --Never used this one. The only code example is:

Code: Select all

SetGroundFlyerMap(1)
Either it's an AI only function or it's been disabled in SWBF2. I saw no changes using this in-game just now.
It could be AI I believe:

Code: Select all

hot1g_1flag.lua:--    SetGroundFlyerMap(1);
hot1g_c.lua:    SetGroundFlyerMap(1);
hot1g_con.lua:    SetGroundFlyerMap(1);
hot1g_conxl.lua:    SetGroundFlyerMap(1);
hot1g_hunt.lua:    SetGroundFlyerMap(1);
hot1g_uber.lua:    SetGroundFlyerMap(1);
hot1g_xl.lua:    SetGroundFlyerMap(1);

As it's only found in hoth luas, this may say to the ai or something that there's a ground to look out for.

I'm not really versed enough in all the lua functions to pick out the unknown ones, but I found some that looked cool:
Hidden/Spoiler:
[code]ifs_freeform_main.lua: AttachEffectToMatrix(CreateEffect(this.fleetExplosion[loser]), this.modelMatrix[planet][loser])

ifs_freeform_main.lua: AttachEffectToMatrix(CreateEffect(this.fleetExplosion[loser]), this.modelMatrix[planet][loser])

ifs_freeform_ai.lua: Print3D(matrix, math.ceil(value).."|"..math.ceil(value-reference))

hot1g_uber.lua: SetMemoryPoolSize("ActiveRegion", 32)

ifs_opt_general.lua: ScriptCB_SetReticuleTransparency(1 - element.selValue)

--Didn't know there were landing regions, I do now, lol
spa9g_cmn.lua: AddLandingRegion("all_hangar1")

ifs_campaign_battle.lua: SnapMapCamera()
ifs_campaign_end.lua: SnapMapCamera()
ifs_campaign_result.lua:-- SnapMapCamera()
ifs_freeform_fleet.lua: SnapMapCamera()
ifs_freeform_result.lua: SnapMapCamera()

--Dunno what this is all about:
ifs_opt_sound.lua: ReadDataFileInGame("sound\\shell.lvl")
--More shells?

[/code]
They're easy to find with Cygwin :P grep grep grep grep... (that's all I know how to do atm, lol)
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: Fun with LUA functions (FAQ)

Post by Frisbeetarian »

Forgive me for bumping this, but I recently ran across ScriptCB_Freecamera() in ifs_pausemenu.lua and noticed that it wasn't in your list, Tean. Double checking, I found that the words appeared in both BattlefrontII.exe and BF2_modtools.exe in same place in each. So my question is, how did you go about "extracting" the functions from the .exe, because I also noticed other functions in there that also don't appear in your list.

I also noticed in only the BF2_modtools.exe that the words appear "The camera must be in free mode in order to snap to an object!" This might indicate that SnapMapCamera only works from freecamera.
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3284
Joined: Mon Aug 21, 2006 6:23 am
Contact:

Re: Fun with LUA functions (FAQ)

Post by AceMastermind »

Frisbeetarian wrote:Forgive me for bumping this, but I recently ran across ScriptCB_Freecamera() in ifs_pausemenu.lua and noticed that it wasn't in your list, Tean. Double checking, I found that the words appeared in both BattlefrontII.exe and BF2_modtools.exe in same place in each. So my question is, how did you go about "extracting" the functions from the .exe, because I also noticed other functions in there that also don't appear in your list.
The original post in this topic is missing due to a data transfer glitch, it may or may not have been listed in that post. If you find any that aren't listed in this topic feel free to post them to complete the list.


SWBF2 dump
http://pastebin.com/BqAgk2jV
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Fun with LUA functions (FAQ)

Post by [RDH]Zerted »

ScriptCB_Freecamera() enables/disables free cam. I never tried using SnapMapCamera (or any other functions) when inside free cam (but I've also never saw that message before...)

Yeah, GT lost a lot of first posts a while back... If you want a complete list of all the scripting things you can do/change/have access to when in-game, run FakeConsole's Print Nested Globals command and look at your debug output. You can really mess with a lot of stuff.

I was thinking of writing up documentation for all the lua functions when I go on break in two weeks, but if I decide to do a minor in game development, I won't have the time to do that.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11079
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Fun with LUA functions (FAQ)

Post by Teancum »

*resurrecting topic due to discovery*
SetGroundFlyerMap()
This doesn't seem to have much of an effect on PC, but on consoles this reverts the flyer system back to SWBF1-style (aside from strafing, which still doesn't work). Rolling, boosting and tricks are disabled. I haven't tested this on PC with a gamepad.
SetHistorical()
Used in SWBF1 Historical campaign. I'm not sure what else it does, but it enables the ClassHisATK and ClassHisDEF properties in com_item_vehicle_spawn.odf. DOES NOT WORK IN SWBF2
SetHeroUnlockRule()
Values are POINTS, KILLS, and DEATHS. Untested.

Has anyone tried the command BatchChangeTeams()? I'm curious as to whether it swaps team 1 and team 2. If that's the case an Unreal Tournament Assault-style objective mode could be doable.
Post Reply