"Null" in text campaign [Solved]

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

Post Reply
DaviidHL
Private Third Class
Posts: 52
Joined: Thu Apr 05, 2018 11:48 am
Projects :: Kashyyyk Droid Invasion
Games I'm Playing :: SWBF2
xbox live or psn: DaviidHL_

"Null" in text campaign [Solved]

Post 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
Last edited by DaviidHL on Tue Aug 28, 2018 5:05 pm, edited 1 time in total.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: "Null" in text campaign

Post 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'.
Post Reply