Hunt/conquest(literally mixed together) not recognizing cps

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
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Hunt/conquest(literally mixed together) not recognizing cps

Post by jedimaster745 »

this may sound like a completely crazy thing to do, but in order to get hunt mode into one of my maps, i copied the lua contents for naboo hunt into my clone wars conquest lua. i changed the ReadDataFile thingy to recognize my map, too. it was like editing a shipped map, but without the actual shipped map-just the lua. but when i played the map, everything worked perfectly, there was no crash or problems, except...there were no cps :faint: i renamed the cps to be like the ones in the shipped naboo hunt map(Team1CP is the name) but they still werent recognized. i know this was a completely insane idea but if anyone has any advice or knowledge about making the cps recgonizable please tell me. thank you :thumbs:
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by MercuryNoodles »

Hunt mode isn't made to handle capturing CPs, simply put. Did you want a hybrid mode? That would require blending the objective scripts, I believe, using the capturable CP objects, and you'd have to add the CP stuff to your mission's lua. Don't quote me on that, but that's the only way I can think of doing so at the moment.
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by bobfinkl »

Can you post your lua? To setup hunt mode requires much more lua work than just changing the ReadDataFile.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by jedimaster745 »

i made a few changes to see if it would help recognize the cps. my changes didnt cause any crashes, but the cps still wont show. hopefully you can find the changes i made. i mainly just replaced the hunt scriptpostload with the conquest one. there was one other change but i cant find it. if you can compare the naboo hunt lua with my lua u may find it. here it is:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("dc:ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- Empire Attacking (attacker is always #1)
CIS = 1
REP = 2
-- These variables do not change
ATT = 1
DEF = 2

---------------------------------------------------------------------------
-- 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 ScriptPostLoad()
DisableBarriers("cambar1")
DisableBarriers("cambar2")
DisableBarriers("cambar3")
DisableBarriers("turbar1")
DisableBarriers("turbar2")
DisableBarriers("turbar3")
DisableBarriers("camveh")
SetMapNorthAngle(180, 1)
AddAIGoal (GAR, "Deathmatch", 100)

AICanCaptureCP("CP1", GAR, false)
AICanCaptureCP("CP2", GAR, false)
AICanCaptureCP("CP3", GAR, false)
AICanCaptureCP("CP4", GAR, false)

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "CP1"}
cp2 = CommandPost:New{name = "CP2"}
cp3 = CommandPost:New{name = "CP3"}
cp4 = CommandPost:New{name = "CP4"}

--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)



conquest:Start()
EnableSPHeroRules()
end

function ScriptInit()
StealArtistHeap(1200*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(3000000)
ReadDataFile("ingame.lvl")



ReadDataFile("sound\\nab.lvl;nab2cw")

ReadDataFile("SIDE\\gun.lvl",
"gun_inf_defender",
"gun_inf_soldier")

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")



SetupTeams{

gungan = {
team = REP,
units = 32,
reinforcements = -1,
soldier = { "gun_inf_defender",13},
assault = { "gun_inf_soldier",12},

},
cis = {
team = CIS,
units = 32,
reinforcements = -1,
soldier = { "cis_inf_rifleman",8},

}
}


-- Level Stats
ClearWalkers()
AddWalkerType(0, 3) -- 8 droidekas with 0 leg pairs each
AddWalkerType(1, 4) -- ATSTs
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("BaseHint", 128)
SetMemoryPoolSize("EntitySoundStream", 1)
SetMemoryPoolSize("EntitySoundStatic", 44)
SetMemoryPoolSize("MountedTurret", 10)
SetMemoryPoolSize("Navigator", 32)
SetMemoryPoolSize("Obstacle", 450)
SetMemoryPoolSize("PathNode", 200)
SetMemoryPoolSize("TreeGridStack", 400)
SetMemoryPoolSize("UnitAgent", 32)
SetMemoryPoolSize("UnitController", 32)
SetMemoryPoolSize("Weapon", 144)
SetMemoryPoolSize("EntityFlyer", 6)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:GUN\\nab2.lvl","naboo2_hunt")
SetDenseEnvironment("true")
--AddDeathRegion("Water")
AddDeathRegion("Waterfall")
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)



-- Sound

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

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

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\nab.lvl", "nab2")
OpenAudioStream("sound\\nab.lvl", "nab2")
OpenAudioStream("sound\\nab.lvl", "nab2_emt")

-- SetBleedingVoiceOver(REP, REP, "all_off_com_report_us_overwhelmed", 1)
-- SetBleedingVoiceOver(REP, CIS, "all_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, "all_off_defeat_im", .1, 1)
-- SetLowReinforcementsVoiceOver(REP, CIS, "all_off_victory_im", .1, 1)
-- SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
-- SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "allleaving")
SetOutOfBoundsVoiceOver(1, "cisleaving")

SetAmbientMusic(REP, 1.0, "rep_nab_amb_hunt", 0,1)
-- SetAmbientMusic(REP, 0.9, "rep_nab_amb_middle", 1,1)
-- SetAmbientMusic(REP, 0.1, "rep_nab_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_nab_amb_hunt", 0,1)
-- SetAmbientMusic(CIS, 0.9, "cis_nab_amb_middle", 1,1)
-- SetAmbientMusic(CIS, 0.1, "cis_nab_amb_end", 2,1)

SetVictoryMusic(REP, "rep_nab_amb_victory")
SetDefeatMusic (REP, "rep_nab_amb_defeat")
SetVictoryMusic(CIS, "cis_nab_amb_victory")
SetDefeatMusic (CIS, "cis_nab_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
--Nab2 Theed
--Palace
AddCameraShot(0.038177, -0.005598, -0.988683, -0.144973, -0.985535, 18.617458, -123.316505);
AddCameraShot(0.993106, -0.109389, 0.041873, 0.004612, 6.576932, 24.040697, -25.576218);
AddCameraShot(0.851509, -0.170480, 0.486202, 0.097342, 158.767715, 22.913860, -0.438658);
AddCameraShot(0.957371, -0.129655, -0.255793, -0.034641, 136.933548, 20.207420, 99.608246);
AddCameraShot(0.930364, -0.206197, 0.295979, 0.065598, 102.191856, 22.665434, 92.389435);
AddCameraShot(0.997665, -0.068271, 0.002086, 0.000143, 88.042351, 13.869274, 93.643898);
AddCameraShot(0.968900, -0.100622, 0.224862, 0.023352, 4.245263, 13.869274, 97.208542);
AddCameraShot(0.007091, -0.000363, -0.998669, -0.051089, -1.309990, 16.247049, 15.925866);
AddCameraShot(-0.274816, 0.042768, -0.949121, -0.147705, -55.505108, 25.990822, 86.987534);
AddCameraShot(0.859651, -0.229225, 0.441156, 0.117634, -62.493008, 31.040747, 117.995369);
AddCameraShot(0.703838, -0.055939, 0.705928, 0.056106, -120.401054, 23.573559, -15.484946);
AddCameraShot(0.835474, -0.181318, -0.506954, -0.110021, -166.314774, 27.687098, -6.715797);
AddCameraShot(0.327573, -0.024828, -0.941798, -0.071382, -109.700180, 15.415476, -84.413605);
AddCameraShot(-0.400505, 0.030208, -0.913203, -0.068878, 82.372711, 15.415476, -42.439548);
end
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by bobfinkl »

Your lua is set up a bit odd but for a quick glance at it the only thing I can see wrong is the dc:, I don't think it's necessary for ScriptPostLoads. What are you trying to accomplish? Capturable cps in hunt? All you have to do is add capture regions to the cps and setup hunt mode in the lua, if that's what your trying to do.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by [RDH]Zerted »

jedimaster745 wrote:this may sound like a completely crazy thing to do, but in order to get hunt mode into one of my maps, i copied the lua contents for naboo hunt into my clone wars conquest lua...
Yes, you need to say what you are trying to make. Do you want your map to have a normal Hunt mode? Do you want your map to have a Hunt mode where the CPs can be captured?
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by jedimaster745 »

i want the command posts to show up so i may spawn my gungans/droids. when i play the map, neither command post even shows up, which i need fixed if possible. when i put in the command post part of the lua instead of the hunt thingy, all it did was get rid of the hunt timer.
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by bobfinkl »

Can you show your bfront2.log, it looks like you have something that you did wrong setting up everything as the conquest/hunt modes do absolutely nothing to cps.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by jedimaster745 »

bobfinkl wrote:Can you show your bfront2.log, it looks like you have something that you did wrong setting up everything as the conquest/hunt modes do absolutely nothing to cps.
id love to. could you please tell me where its located? im not too good with finding files.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by Fiodis »

If all you want to do is make a Hunt mode with capturable cps, wouldn't it be relatively easy to just add the gungans as units in CW Conquest?

Make a new side, and put the gungans in as its only units. Then, in your LUA, make the REP team setup only include the Gungans. In the CIS part, delete every unit except the rifleman (rifledroid?). Then munge everything, and vóila, you get a Hunt mode posing as a conquest.

Not sure how to change the name to "Hunt", though......could you possibly use the edit localize tool?
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by MercuryNoodles »

On the missing CP issue, try checking your layers in ZE and verifying the CPs are present in the layer you're loading via the mission's lua. From what your posts describe now, this is more than likely where the problem lay, unless the map didn't munge properly.

As for the stuff I said earlier, you don't need all of that for a normal hunt mode, just for the sake of clarity. It reads like you want hunt mode to work the same as the stock version. That said, the stock hunt mode uses uncapturable CPs which need not be referenced in the lua. The CP-related lua coding (in the mission lua) only affects whether CPs count toward the conquest timer (as I recall..), and can't force an object to show up that may or may not be there.

Also, I don't believe ScriptCB_DoFile accepts the dc: tag. I can't explain it clearly, but there's never a need to use it there that I can think of.


Come to think of it: when you first tried adding hunt mode, did you add this mode to the addme script? You shouldn't need to set it up under the preexisting conquest mode.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by jedimaster745 »

MercuryNoodles wrote:Come to think of it: when you first tried adding hunt mode, did you add this mode to the addme script? You shouldn't need to set it up under the preexisting conquest mode.
i didnt put it in the addme script, because ive never had a successful created hunt mode before(most likely my fault or my computers fault for not being very....good with these things), but instead put the lua in conquest. i figured i could make a hunquest, or conhunt, or something, by putting hte hunt lua into the conquest one, then once it works, take out the timer(maybe) and add capturable command posts. i might try the new layer idea and see if that works.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by [RDH]Zerted »

So you just want Hunt mode with capturable CPs correct? Do you want the AI to go after the CPs like in Conquest or just go after other units like in Hunt (and they may capture CPs as a side effect)? Do you want the map to end when the reinforcement counts goes to zero (like Conquest) or when a team reaches a certain point limit (like Hunt) or just when a timer ends?

You need to answer these questions before I know the best way for you to setup your map script.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by jedimaster745 »

sorry to all that were hoping to help me, but ive resolved my lua problem, and my gungans may now spawn like they were supposed to. thank you everyone for the help, and if an admin wants to lock this topic or something, they may do so if they please. i wont mind. :music:
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by Fiodis »

Before it's locked, could you post your solution? It'd be useful for any future reference, might be added to the FAQ thread.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by jedimaster745 »

well, i would hate to take too much credit for this, mostly because it involves tactics already in the FAQ thread. but anyways, this will sound pretty crazy, just like my original ideas for this concept. so, were all familiar with the "how to edit a shipped map" thread in the FAQ, right? ok, so first, we must follow those guidelines. we work our way through the steps until the point where we switch our original lua with the one from the shipped map. lets say were making hunquest like i was. and for further information's sake, lets just say were using the naboo shipped map. so, when we switch the luas, instead of putting the conquest lua in, put the one for hunt. it will still work, trust me. then follow all the other steps for editing shipped maps. finally when our masterpiece is finished and zeroeditor is running and all, we do the dirty work. so, when we open the naboo world file, we get, of course, the shipped naboo map. if were feeling especially lazy we can just delete a few things, and build up from there(lets say were making some crazy naboo metropolis never before seen in the movies but it looks relatively like the original naboo). another technique, which is far more dangerous, in my opinion, is to delete everything and start from scratch. by everything, however, i mean everything that is irrelavant to hunt, like the CTF layer, or the CONQUEST layer. if you want to delete your base layer thats fine with me, but do NOT delete the hunt layer, if we do then the whole project is ruined(unless we have far better layering skills than i ever will). so, we have a blank map. no objects, no terrain, no unneeded modes. all we have is our hunt layer, our base layer, and any other layer(such as lighting or something) that we might have wanted to keep. and congrats, weve just basically made a brand new map that we usually get after we munge, except we have....CUSTOM SIDES. well, not exactly custom, but close enough. be warned, however, that if you munge without any other lua changes, the hunt settings will be in control of how our map works(such as timer, points, etc). after a few lua tweaks, we may have a more developed hunquest. at this point, lets let the modder decide those sorts. a few other tweaks and we may have stumbled upon real custom sides.

im not sure if this is FAQ material, but its as much of an explanation as i can give. i will not, however, take full credit for this, as i was mainly building from the work of others(that sounded way too ugly but im just being modest)

have fun with your hunquest map! if i forgot anything, ill edit this post later.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: hunt/conquest(literally mixed together) not recognizing cps

Post by [RDH]Zerted »

jedimaster745 wrote:im not sure if this is FAQ material...
Its not. The game modes were designed to be mixed together. Thats how the Campaign maps work. Depending on what exactly you were trying to do (that was never clear, at least to me), you only needed to add a Conquest objective to a Hunt map script or add a Hunt objective to a Conquest map script.

ScriptCB_DoFile does not use dc: because dc: helps tell the game which folder the file being read is in. ScriptCB_DoFile is loading Lua scripts already read into memory (you read them in with the ReadDataFile lines).
Post Reply