Page 1 of 1

"Null" in text campaign [Solved]

Posted: Fri Jul 06, 2018 1:22 pm
by DaviidHL
I created a goto mission and when you pass trough region the text says "NULL".
How I solucionate that?

My .lua:

Code: Select all

SetAIDifficulty(2, -8, "medium")
        AllowAISpawn(ATT, false)
        AllowAISpawn(DEF, true)
        ScriptCB_SetGameRules("campaign")

		onfirstspawn = OnCharacterSpawn(
	        function(character)
	            if character == 0 then
	            	ShowPopup("level.geo1.hints.hints")
	                ReleaseCharacterSpawn(onfirstspawn)
	                onfirstspawn = nil
	                BeginObjectivesTimer()
	                ScriptCB_EnableCommandPostVO(0)
            ShowMessageText("Text test", ATT)
 
        end
    end)
 
 
--objective :goto (mision I)
    Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF, 
								   text = "Go to region", popupText = "Well done",
								   regionName = "goto", mapIcon = "hud_objective_icon_circle",  AIGoalWeight = 0}
 
    Objective1:AddHint("level.geo1.hints.movement")
    Objective1:AddHint("level.geo1.hints.obj_markers")
    Objective1:AddHint("level.geo1.hints.review_objectives")
    Objective1:AddHint("level.geo1.hints.sprint")
 
 
    Objective1.OnStart = function(self)
        att_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
        def_obj1_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
        MapAddEntityMarker("hud_objective_icon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)
 
    end
 
    Objective1.OnComplete = function(self)
        DeleteAIGoal(att_obj1_aigoal)
        DeleteAIGoal(def_obj1_aigoal)
        ShowMessageText("game.objectives.complete", ATT)
        MapRemoveEntityMarker("hud_objective_icon")
 
    end
end


function BeginObjectivesTimer()
	beginobjectivestimer = CreateTimer("beginobjectivestimer")
	OnTimerElapse(BeginObjectives, beginobjectivestimer)
	SetTimerValue(beginobjectivestimer, 4)
	StartTimer(beginobjectivestimer)
end

function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4} 
objectiveSequence:AddObjectiveSet(Objective1)
 
objectiveSequence:Start()
 
end

Re: "Null" in text campaign

Posted: Fri Jul 06, 2018 4:54 pm
by Marth8880

Code: Select all

    Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF, 
                           text = "Go to region", popupText = "Well done",
                           regionName = "goto", mapIcon = "hud_objective_icon_circle",  AIGoalWeight = 0}
The values of 'text' and 'popupText' must be paths to localized keys (like game.objectives.complete). See here: http://www.gametoast.com/viewtopic.php?t=971

Note: This also applies to 'ShowMessageText'.