"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

Private Third Class
User avatar
Posts: 50
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]

Postby DaviidHL » Fri Jul 06, 2018 1:22 pm

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.

Resistance Leader
User avatar
Posts: 5176
Joined: Tue Feb 09, 2010 8:43 pm
Location: Edinburgh, UK
Projects :: EVERYWHERE + Zero Munge + TCW
Games I'm Playing :: Day of Defeat Source
xbox live or psn: Marth8880

Re: "Null" in text campaign

Postby Marth8880 » Fri Jul 06, 2018 4:54 pm

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

Return to SWBF2 Modding

Who is online

Users browsing this forum: No registered users and 1 guest