onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
popupText = "level.DOM.message.1"
end
)
end
I put this in at the end of ScriptPostLoad()
but I get an error:C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\DOM\DOMg_eli.lua:38: unexpected symbol near `)'
ERROR[scriptmunge scripts\DOM\DOMg_eli.lua]:Could not read input file.ERROR[scriptmunge scripts\DOM\DOMg_eli.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
And if i take the ) away it says it needs one to close so Im really confused
Last edited by ryukaji on Wed Apr 01, 2009 6:54 pm, edited 1 time in total.
Does it matter? If it does then I could easily change it to campaign and give the AI deathmatch objective... but I think my problem has to be the code I added is wrong
onfirstspawn = OnCharacterSpawn( function(character) if IsCharacterHuman(character) then
popupText = "level.DOM.message.1" end end )
But you can't do pop ups like that. That line is only storing the string 'level.DOM.message.1' into the new popupText variable.
Any game mode can do pop ups.
How do you get it to display then? The color helps me understand the code a bit better though, thanks I didnt know you needed an end for the if-then
EDIT: When I added this I got no errors this time, but all my other PostLoad script things like to disable the minimap and a teleporter stopped working Why would this code mess up those?
Thanks, that worked I wanted it like campaign popup. The only problem is that it displays every time you spawn and not just the first time. Why is that?
ryukaji wrote:Thanks, that worked I wanted it like campaign popup. The only problem is that it displays every time you spawn and not just the first time. Why is that?
Because that's what you're telling it to do. If you just want it to display once, you could do something like this:
firstspawned = 0
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) and firstspawned == 0 then
ShowObjectiveTextPopup("level.DOM.message.1", ATT)
firstspawned = 1
end
end
)
You've got to make sure that there's a condition it fulfills if you want something to happen at a specific time.
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) and firstspawned == 0 then
ShowObjectiveTextPopup("level.DOM.message.1", ATT)
ReleaseCharacterSpawn(onfirstspawn)
end
end
)
Ill put that one in tomorrow, maybe it will fix the problem where the minimap displays partially (the triangles show up but there is no circle around the map) I doubt it will fix it but its worth a shot