Problems adding VIP mode

Discussion, progress updates, and downloads for the Dark Times and Rising Son mods.

Moderator: Moderators

Post Reply
Dreadnot9
Chief Warrant Officer
Chief Warrant Officer
Posts: 341
Joined: Wed Jun 06, 2012 2:05 pm
Projects :: Rising Conflict CW v2.0
Games I'm Playing :: Skyrim TF2 FTL
xbox live or psn: Steam is Dreadnot9

Problems adding VIP mode

Post by Dreadnot9 »

I've been attempting to integrate Mav's VIP mode from DTII using this tut on the stock Tantive IV map.
So far, I can't get either VIP unit to spawn.

My lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveVIP")

REP = 1
CIS = 2

ATT = 1
DEF = 2

function ScriptPostLoad()

AddDeathRegion("turbinedeath")

KillObject("blastdoor")
DisableBarriers("barracks")
DisableBarriers("liea")
SetMapNorthAngle(180)

-- Turbine Stuff --
BlockPlanningGraphArcs("turbine")
OnObjectKillName(destturbine, "turbineconsole")
OnObjectRespawnName(returbine, "turbineconsole")

--Setup Timer--

timeConsole = CreateTimer("timeConsole")

SetTimerValue(timeConsole, 0.3)

StartTimer(timeConsole)
OnTimerElapse(
function(timer)
SetProperty("turbineconsole", "CurHealth", GetObjectHealth("turbineconsole") + 1)
DestroyTimer(timer)
end,
timeConsole
)

KillObject("CP4CON")
KillObject("CP5CON")
SetProperty("CP6CON", "captureregion", " ")
SetProperty("CP7CON", "captureregion", " ")

ObjectiveVIPSetup(2, 3, 80)
ObjectiveVIPAddSpawnCP("CP6CON","cp6path")
ObjectiveVIPAddSpawnCP("CP7CON","CP7SPAWNPATH")
ObjectiveVIPStart()

EnableSPHeroRules()

end

function destturbine()
UnblockPlanningGraphArcs("turbine")
PauseAnimation("Turbine Animation")
RemoveRegion("turbinedeath")
-- SetProperty("woodr", "CurHealth", 15)
end

function returbine()
BlockPlanningGraphArcs("turbine")
PlayAnimation("Turbine Animation")
AddDeathRegion("turbinedeath")
-- SetProperty("woodr", "CurHealth", 15)
end




---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

function ScriptInit()
-- Designers, these two lines *MUST* be first!
StealArtistHeap(840000)
SetPS2ModelMemory(4990000)
ReadDataFile("ingame.lvl")
SetWorldExtents(1064.5)

ReadDataFile("sound\\tan.lvl;tan1cw")

ReadDataFile("dc:SIDE\\modrep.lvl",
"rep_inf_rifleman",
"rep_inf_sniper",
"rep_inf_engineer",
"rep_inf_medic",
"rep_inf_gunner",
"rep_inf_shadow",
"rep_inf_captain",
"rep_inf_commander")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_bdroid",
"cis_inf_sniper",
"cis_inf_engineer",
"cis_inf_sbd",
"cis_inf_merc",
"cis_inf_OOM-9",
"cis_inf_magnaguard",
"cis_inf_droideka")
ReadDataFile("SIDE\\cis.lvl",
"cis_hero_grievous")
ReadDataFile("SIDE\\rep.lvl",
"rep_hero_yoda")

defendingunits = 25

SetupTeams{

rep = {
team = REP,
units = defendingunits,
reinforcements = 150,
soldier = { "rep_inf_rifleman",7, 25},
assault = { "rep_inf_medic",1, 4},
engineer = { "rep_inf_engineer",1, 4},
sniper = { "rep_inf_sniper",1, 4},
officer = {"rep_inf_gunner",1, 4},
special = { "rep_inf_shadow",1, 4},
extra1 = { "rep_inf_captain",1, 2},
extra2 = { "rep_inf_commander",0, 1},

},
cis = {
team = CIS,
units = defendingunits,
reinforcements = 150,
soldier = { "cis_inf_bdroid",7, 25},
assault = { "cis_inf_engineer",1, 4},
engineer = { "cis_inf_sniper",1, 4},
sniper = { "cis_inf_sbd",1, 4},
officer = {"cis_inf_merc",1, 4},
special = { "cis_inf_droideka",1, 4},
extra1 = { "cis_inf_magnaguard",1, 2},
extra2 = { "cis_inf_OOM-9",0, 1},
}
}

-- Hero Setup Section --

VIPHeroREP = rep_hero_yoda
VIPHeroCIS = cis_hero_grievous

SetTeamName(3, "cis")
--AddUnitClass (4, ControlHeroCIS, 1, 1)
SetUnitCount (3, 1)
--first number is numteam, second is numunits
AddAIGoal(3, "Deathmatch", 100)

SetTeamAsNeutral(1,3)
SetTeamAsNeutral(3,1)
SetTeamAsNeutral(2,3)
SetTeamAsNeutral(3,2)

-- Level Stats
ClearWalkers()
AddWalkerType(0, 5) -- number of droidekas

local weaponCnt = 177
local guyCnt = 32
SetMemoryPoolSize ("Aimer", 17)
SetMemoryPoolSize ("AmmoCounter", weaponCnt)
SetMemoryPoolSize ("BaseHint", 250)
SetMemoryPoolSize ("EnergyBar", weaponCnt)
SetMemoryPoolSize ("EntityCloth", 18)
SetMemoryPoolSize ("EntitySoundStream", 14)
SetMemoryPoolSize ("EntitySoundStatic", 29)
SetMemoryPoolSize ("EntityFlyer", 6)
SetMemoryPoolSize ("MountedTurret", 2)
SetMemoryPoolSize ("Navigator", guyCnt)
SetMemoryPoolSize ("Obstacle", 250)
SetMemoryPoolSize ("PathFollower", guyCnt)
SetMemoryPoolSize ("PathNode", 384)
SetMemoryPoolSize ("SoundspaceRegion", 15)
SetMemoryPoolSize ("TentacleSimulator", 0)
SetMemoryPoolSize ("TreeGridStack", 150)
SetMemoryPoolSize ("UnitAgent", guyCnt)
SetMemoryPoolSize ("UnitController", guyCnt)
SetMemoryPoolSize ("Weapon", weaponCnt)


-- SetMemoryPoolSize("Obstacle", 182)
--
SetSpawnDelay(10.0, 0.25)
ReadDataFile("tan\\tan1.lvl", "tan1_conquest")
SetDenseEnvironment("false")
AISnipeSuitabilityDist(30)
--AddDeathRegion("Sarlac01")
-- SetMaxFlyHeight(90)
-- SetMaxPlayerFlyHeight(90)

-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
OpenAudioStream("sound\\tan.lvl", "tan1")
OpenAudioStream("sound\\tan.lvl", "tan1")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
-- OpenAudioStream("sound\\tan.lvl", "tan1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "Repleaving")
SetOutOfBoundsVoiceOver(2, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_tan_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_tan_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_tan_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_tan_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_tan_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_tan_amb_end", 2,1)

SetVictoryMusic(REP, "rep_tan_amb_victory")
SetDefeatMusic (REP, "rep_tan_amb_defeat")
SetVictoryMusic(CIS, "cis_tan_amb_victory")
SetDefeatMusic (CIS, "cis_tan_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


-- Camera Stats
AddCameraShot(0.233199, -0.019441, -0.968874, -0.080771, -240.755920, 11.457644, 105.944176);
AddCameraShot(-0.395561, 0.079428, -0.897092, -0.180135, -264.022278, 6.745873, 122.715752);
AddCameraShot(0.546703, -0.041547, -0.833891, -0.063371, -309.709900, 5.168304, 145.334381);

end
Errors from log of note:
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\CommandPost.cpp(493)
Command Post missing capture region " "

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\CommandPost.cpp(493)
Command Post missing capture region " "

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "50" not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "50" not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "50" not found

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #2 to `RetailAddUnitClass' (string expected, got nil)
stack traceback:
[C]: in function `RetailAddUnitClass'
(none): in function `AddUnitClass'
(none): in function `ObjectiveVIPSetup'
(none): in function `ScriptPostLoad'

ifs_sideselect_fnEnter(): Map does not support custom era teams
ifs_sideselect_fnEnter(): The award settings file exists
ifs_sideselect_fnEnter(): Starting to remove award effects...
ifs_sideselect_fnEnter(): Finished removing award effects.

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\ConnectivityGraphFollower.cpp(382)
No valid positions for type [SOLDIER] radius [0.70] in node [Hub36]

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\ConnectivityGraphFollower.cpp(382)
No valid positions for type [SOLDIER] radius [0.70] in node [Hub36]

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\ConnectivityGraphFollower.cpp(382)
No valid positions for type [SOLDIER] radius [0.70] in node [Hub36]
EDIT: It might be important to mention that the other units spawn just fine (both teams), and that the reinforcement counts are 80 and 30 for either team (randomly selected).
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Problems adding VIP mode

Post by Maveritchell »

Code: Select all

VIPHeroREP = rep_hero_yoda
VIPHeroCIS = cis_hero_grievous
If you don't enclose your strings in quotation marks, lua assumes you're calling variables and not strings.
Dreadnot9
Chief Warrant Officer
Chief Warrant Officer
Posts: 341
Joined: Wed Jun 06, 2012 2:05 pm
Projects :: Rising Conflict CW v2.0
Games I'm Playing :: Skyrim TF2 FTL
xbox live or psn: Steam is Dreadnot9

Re: Problems adding VIP mode

Post by Dreadnot9 »

Worked like a charm, thanks Mav.
Now I'm getting a green arrow (and marker on the map) present over the CP from which the VIP spawned, I'm wondering if this is how it's supposed to be, or if this arrow should follow the VIP?
User avatar
willinator
Major
Major
Posts: 517
Joined: Sun Mar 13, 2011 3:11 pm
Projects :: [Coming of the Sentinels]
Games I'm Playing :: SWBF2 Minecraft Halo
xbox live or psn: PC pwns all!
Location: The rings of Saturn...

Re: Problems adding VIP mode

Post by willinator »

It depends which team you are on. If you're trying to kill the VIP, the marker follows them. If you're defending them, the marker remains where they spawned.
Dreadnot9
Chief Warrant Officer
Chief Warrant Officer
Posts: 341
Joined: Wed Jun 06, 2012 2:05 pm
Projects :: Rising Conflict CW v2.0
Games I'm Playing :: Skyrim TF2 FTL
xbox live or psn: Steam is Dreadnot9

Re: Problems adding VIP mode

Post by Dreadnot9 »

willinator wrote:It depends which team you are on. If you're trying to kill the VIP, the marker follows them. If you're defending them, the marker remains where they spawned.
You're correct, thanks.
I just played through DT in VIP to check as well.
Post Reply