That's what I figured, since that's what I always did before.
Scriptname GlobalFunctionTestScript extends ObjectReference ObjectReference placedItemFunction testFunction(Message testMessage, ObjectReference spawnPoint, Static itemToPlace) Globalint buttonPressed = TestMessage.Show()if buttonPressed == 0 placedItem = spawnPoint.PlaceAtMe(itemToPlace)ElseIf buttonPressed == 1 placedItem = spawnPoint.PlaceAtMe(itemToPlace)ElseEndIfEndFunction
Does that look right?
Because when I try and compile, it says:
d:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\GlobalFunctionTestScript.psc(10,1): variable placedItem is undefined
d:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\GlobalFunctionTestScript.psc(10,1): type mismatch while assigning to a none (cast missing or types unrelated)
d:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\GlobalFunctionTestScript.psc(12,1): variable placedItem is undefined
Which would work if it wasn't a "Global" function. Is there a different method for global functions?
And I can't put it in the function's variables without a default value, but if I did that it would just set it back to the default value every time the function ran, wouldn't it? Thus not being able to actually do anything with it.