IIRC Zerted used it for something, I think maybe 3 playable teams?
Also, what does CreateMatrix do? I wonder if you can enter 6 values for a world position. I've always wondered if you could edit matrices stored in a 'word' (programming linguo down the brain tubes...) by having LUA serve up the component numbers to be edited mathematically...
Fun with LUA functions (FAQ)
Moderator: Moderators
-
- Jedi
- Posts: 1119
- Joined: Sat Apr 23, 2005 8:52 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Frisbeetarian
- Jedi
- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Fun with LUA functions (FAQ)
I couldn't find it in in his 4-team code.Ace_Azzameen_5 wrote:IIRC Zerted used it for something, I think maybe 3 playable teams?
http://www.gametoast.com/forums/viewtop ... 89#p297189Ace_Azzameen_5 wrote:Also, what does CreateMatrix do?
- DarthD.U.C.K.
- Master of the Force
- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Fun with LUA functions (FAQ)
this is a rather large bump, so ill hope this will be usefull to some people..
since it came up in the fun with luacommands thread that it would be nice to have the inputs for the commands and i had a bit time, i took the "LUA_Callback_Reference.txt" from psych0fred's site and filled in as many parameters as i could, most are from the campaign and objective luas. some are guesses and i might have mixed entity/object sometime.
here is what i got so far
if you can add anything or correct something, you can post the updated list and ill remove theone in my post.
i hope this is usefull to someone.....
since it came up in the fun with luacommands thread that it would be nice to have the inputs for the commands and i had a bit time, i took the "LUA_Callback_Reference.txt" from psych0fred's site and filled in as many parameters as i could, most are from the campaign and objective luas. some are guesses and i might have mixed entity/object sometime.
here is what i got so far
Hidden/Spoiler:
i hope this is usefull to someone.....
-
- 2nd Lieutenant
- Posts: 365
- Joined: Sun Jan 16, 2011 12:42 am
- Location: Princeton, NJ
A small discovery for MP
Hi, I don't know how relevant this is to most modders, but I need players to be able to switch sides sometimes, so the default MP option "Auto-Assign" really messes me up, and most people do not adjust this setting. Anyway I found out that the command ScriptCB_SetCanSwitchSides(1) will override auto-assign and allow player switches. Sorry if someone had posted this before, but I hadn't seen it, and it will be very useful for my Gun Game mode. Thanks!
-
- Droid Pilot Assassin
- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Re: A small discovery for MP
Oh wow this is really awesome! Great find!
-
- Master Sergeant
- Posts: 163
- Joined: Sun Feb 02, 2014 6:13 pm
- Projects :: Battlefront II Hunger Games
- Contact:
Re: Fun with LUA functions (FAQ)
While this topic's been bumped, I might as well contribute my findings:
GetWorldPosition(unit) is quite a useful function. It outputs the x, y, and z coordinates of the given unit, and these can be used and manipulated however you want, unlike GetEntityMatrix. GetEntityMatrix outputs a UserData type, which can only be used by very specific LUA functions, and you can't access the individual coordinates. GetWorldPosition can be used very creatively for things like the Camper Killer function I made for the Hunger Games mod (thanks again Zerted for helping me with this ). Noobasaurus also used it in a pretty cool way here: http://www.gametoast.com/viewtopic.php? ... 6&start=20
Camper Killer:
You can also redefine functions that are already in the game (more thanks for Zerted's help here). Here's what I did in Hunger Games to keep people from cheating with Freecam:
This makes the player kill themself and shows them a message whenever they click the freecam button in the pause menu.
A bit off topic: If you're wondering, that "if not check_map then" is there because I wanted to be able to use freecam when I was checking the map itself, for taking screenshots and what not. This is something I'd recommend to anyone who's doing lots of scripting in their maps because it allows you to bypass the scripting and check the map layout, etc. by simply changing check_map from false to true.
GetWorldPosition(unit) is quite a useful function. It outputs the x, y, and z coordinates of the given unit, and these can be used and manipulated however you want, unlike GetEntityMatrix. GetEntityMatrix outputs a UserData type, which can only be used by very specific LUA functions, and you can't access the individual coordinates. GetWorldPosition can be used very creatively for things like the Camper Killer function I made for the Hunger Games mod (thanks again Zerted for helping me with this ). Noobasaurus also used it in a pretty cool way here: http://www.gametoast.com/viewtopic.php? ... 6&start=20
Camper Killer:
Hidden/Spoiler:
You can also redefine functions that are already in the game (more thanks for Zerted's help here). Here's what I did in Hunger Games to keep people from cheating with Freecam:
Hidden/Spoiler:
A bit off topic: If you're wondering, that "if not check_map then" is there because I wanted to be able to use freecam when I was checking the map itself, for taking screenshots and what not. This is something I'd recommend to anyone who's doing lots of scripting in their maps because it allows you to bypass the scripting and check the map layout, etc. by simply changing check_map from false to true.
-
- Corporal
- Posts: 151
- Joined: Thu Jan 24, 2019 11:02 pm
- Projects :: No Mod project currently
- xbox live or psn: No gamertag set
Re: Fun with LUA functions (FAQ)
All the ScriptCB commands in interface_util.lua because I've noticed they don't appear on here. There may be more in other interface files.
ScriptCB_AddIFBorder
ScriptCB_AddIFContainer
ScriptCB_AddIFFlashyText
ScriptCB_AddIFImage
ScriptCB_AddIFMaskImage
ScriptCB_AddIFModel
ScriptCB_AddIFScreen
ScriptCB_AddIFText
ScriptCB_EndIFObj
ScriptCB_EndIFScreen
ScriptCB_IFBorder_SetRect
ScriptCB_IFBorder_SetTexCoords
ScriptCB_IFBorder_SetTexture
ScriptCB_IFFlashyText_SetBackground
ScriptCB_IFFlashyText_SetBackgroundRightJustify
ScriptCB_IFFlashyText_SetBackgroundSize
ScriptCB_IFFlashyText_SetTextColor
ScriptCB_IFFlashyText_Setup
ScriptCB_IFFlashyText_StartFlashiness
ScriptCB_IFImage_SetRect
ScriptCB_IFImage_SetTexCoords
ScriptCB_IFImage_SetTexture
ScriptCB_IFMaskImage_SetMaskTexture
ScriptCB_IFModel_AttachModel
ScriptCB_IFModel_SetAnimation
ScriptCB_IFModel_SetAnimationBanks
ScriptCB_IFModel_SetDepth
ScriptCB_IFModel_SetLighting
ScriptCB_IFModel_SetModel
ScriptCB_IFModel_SetOmegaY
ScriptCB_IFModel_SetRotation
ScriptCB_IFModel_SetScale
ScriptCB_IFModel_SetTranslation
ScriptCB_IFObj_CreateHotSpot
ScriptCB_IFObj_GetCPointer
ScriptCB_IFObj_GetVis
ScriptCB_IFObj_MouseOver
ScriptCB_IFObj_SetAlpha
ScriptCB_IFObj_SetColor
ScriptCB_IFObj_SetEnabled
ScriptCB_IFObj_SetPos
ScriptCB_IFObj_SetRotation
ScriptCB_IFObj_SetScreenPosition
ScriptCB_IFObj_SetUseSafezone
ScriptCB_IFObj_SetVis
ScriptCB_IFObj_SetZOrder
ScriptCB_IFObj_TestHotSpot
ScriptCB_IFText_GetDisplayRect
ScriptCB_IFText_GetTextExtent
ScriptCB_IFText_SetFont
ScriptCB_IFText_SetJustify
ScriptCB_IFText_SetLeading
ScriptCB_IFText_SetString
ScriptCB_IFText_SetTextBox
ScriptCB_IFText_SetTextBreak
ScriptCB_IFText_SetTextScale
ScriptCB_IFText_SetTextStyle
ScriptCB_IFText_SetUString
ScriptCB_SetIFScreenViewport
ScriptCB_AddIFBorder
ScriptCB_AddIFContainer
ScriptCB_AddIFFlashyText
ScriptCB_AddIFImage
ScriptCB_AddIFMaskImage
ScriptCB_AddIFModel
ScriptCB_AddIFScreen
ScriptCB_AddIFText
ScriptCB_EndIFObj
ScriptCB_EndIFScreen
ScriptCB_IFBorder_SetRect
ScriptCB_IFBorder_SetTexCoords
ScriptCB_IFBorder_SetTexture
ScriptCB_IFFlashyText_SetBackground
ScriptCB_IFFlashyText_SetBackgroundRightJustify
ScriptCB_IFFlashyText_SetBackgroundSize
ScriptCB_IFFlashyText_SetTextColor
ScriptCB_IFFlashyText_Setup
ScriptCB_IFFlashyText_StartFlashiness
ScriptCB_IFImage_SetRect
ScriptCB_IFImage_SetTexCoords
ScriptCB_IFImage_SetTexture
ScriptCB_IFMaskImage_SetMaskTexture
ScriptCB_IFModel_AttachModel
ScriptCB_IFModel_SetAnimation
ScriptCB_IFModel_SetAnimationBanks
ScriptCB_IFModel_SetDepth
ScriptCB_IFModel_SetLighting
ScriptCB_IFModel_SetModel
ScriptCB_IFModel_SetOmegaY
ScriptCB_IFModel_SetRotation
ScriptCB_IFModel_SetScale
ScriptCB_IFModel_SetTranslation
ScriptCB_IFObj_CreateHotSpot
ScriptCB_IFObj_GetCPointer
ScriptCB_IFObj_GetVis
ScriptCB_IFObj_MouseOver
ScriptCB_IFObj_SetAlpha
ScriptCB_IFObj_SetColor
ScriptCB_IFObj_SetEnabled
ScriptCB_IFObj_SetPos
ScriptCB_IFObj_SetRotation
ScriptCB_IFObj_SetScreenPosition
ScriptCB_IFObj_SetUseSafezone
ScriptCB_IFObj_SetVis
ScriptCB_IFObj_SetZOrder
ScriptCB_IFObj_TestHotSpot
ScriptCB_IFText_GetDisplayRect
ScriptCB_IFText_GetTextExtent
ScriptCB_IFText_SetFont
ScriptCB_IFText_SetJustify
ScriptCB_IFText_SetLeading
ScriptCB_IFText_SetString
ScriptCB_IFText_SetTextBox
ScriptCB_IFText_SetTextBreak
ScriptCB_IFText_SetTextScale
ScriptCB_IFText_SetTextStyle
ScriptCB_IFText_SetUString
ScriptCB_SetIFScreenViewport
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: Fun with LUA functions (FAQ)
I have a rundown of all of the ScriptCB_ functions (by platform) here too:
https://github.com/BAD-AL/SWBF2_Xbox_mo ... tFunctions
All found by looking through the executable files.
https://github.com/BAD-AL/SWBF2_Xbox_mo ... tFunctions
All found by looking through the executable files.