Objective Mode question

Ask questions, discuss ideas, get answers
Post Reply
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Objective Mode question

Post by fo0k »

DC weapons bunkers was an objective map? Maybe another good map to take a look at to see how its done.
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Objective Mode question

Post by Coroner47 »

I found a tutorial for this somewhere. I will try & find again. There are two ways i know of making an objective style map. The BoB way which ties spawn points to destroyable objects & then there's the "Objective" gamemode which uses lots of coding.

This is how i made my objective style map Firebase Tango. Attacking team would have to destroy the arty pieces which held the spawnpoints for the defending team. Once all arty was destroyed... the round would end in victory for the attacking team. You just need to have all spawnpoints attached to destroyable objects.

Code: Select all

ObjectTemplate.active MLRSComplex
ObjectTemplate.addTemplate ArtySoldierSpawn
ObjectTemplate.setPosition 20/0/5
ObjectTemplate.setRotation 90/0/0

ObjectTemplate.create SpawnPoint ArtySoldierSpawn
ObjectTemplate.setSpawnId 0
ObjectTemplate.setGroup 65
ObjectTemplate.setEnterOnSpawn 0
ObjectTemplate.setAIEnterOnSpawn 0
ObjectTemplate.setSpawnAsParaTroper 0
edit. translated from japanese. this is "Objective" gamemode code. i tried this method once, but found a flaw in it with attaching objectives to moving objects like vehicles.

Code: Select all

*Objectivemode.con  *Directly under the folder GameTypes Under the same contents
- As for fumbling by yourself about the number -
As for contents from here ↓

rem defender tickets are set to 100 (Defensive side ticket)
Game.setNumberOfTickets 2 140 (Appointment and ticket of attack camp)
Game.setTicketLostPerMin 1 0 (However the ticket decrease ratio [po] of team 1 it is and * passes even with 0…)
Game.setTicketLostPerMin 2 0 (Decrease ratio of team 2, here 0 is)
run ObjectiveMode/SpawnpointManagerSettings
run ObjectiveMode/SoldierSpawnTemplates
run ObjectiveMode/SoldierSpawns
run ObjectiveMode/ObjectSpawnTemplates
run ObjectiveMode/ControlPointTemplates
run ObjectiveMode/ObjectiveSpawnerTemplates v_arg1
if v_arg1 == host
rem ----- Host
rem ----------------------------------------------------------------------------
run ObjectiveMode/ObjectSpawns
run ObjectiveMode/ControlPoints v_arg1
run ObjectiveMode/ObjectiveSpawners v_arg1
rem ----------------------------------------------------------------------------
rem endIf
run ObjectiveMode/ObjectiveCommon v_arg1
rem *** EndOfFile ***
To here ↑

*ObjectiveCommon.con
As for contents from here ↓

rem =========== Objective Manager Stuff===============================
objectiveManager.setDefender 1 (Defense side setting)
objectiveManager.registerObjectSpawner ObjectiveSpawner01(The number of destructive objects, here 1-4, unless it registers here, the red circle is not attached)
objectiveManager.registerObjectSpawner ObjectiveSpawner02
objectiveManager.registerObjectSpawner ObjectiveSpawner03
objectiveManager.registerObjectSpawner ObjectiveSpawner04
objectiveManager.registerObjectSpawner ALLIED
objectiveManager.registerObjectSpawner AXIS
objectiveManager.setRootObjectSpawner 1 AXIS
objectiveManager.setRootObjectSpawner 2 ALLIED
To here ↑

*ObjectiveSpawners.con
As for contents from here ↓

if v_arg1 == host
rem ============================= OBJECTS to destroy ================
rem -----------------------------------------
rem --- AA ---(Position and name etc of destructive object AA )
rem -----------------------------------------
Object.create AA_Spawner
Object.absolutePosition 501.49/95.50/388.99
Object.rotation 0.00/0.00/0.00
Object.setName AA1
Object.setTeam 1
rem -----------------------------------------
rem --- AA ---
rem -----------------------------------------
Object.create AA_Spawner
Object.absolutePosition 355.74/95.50/439.93
Object.rotation 0.00/0.00/0.00
Object.setName AA2
Object.setTeam 1
rem -----------------------------------------
rem --- AA ---
rem -----------------------------------------
Object.create AA_Spawner
Object.absolutePosition 447.47/95.50/583.77
Object.rotation 0.00/0.00/0.00
Object.setName AA3
Object.setTeam 1
rem -----------------------------------------
rem --- AA ---
rem -----------------------------------------
Object.create AA_Spawner
Object.absolutePosition 574.11/95.50/452.54
Object.rotation 0.00/0.00/0.00
Object.setName AA4
Object.setTeam 1
rem -----------------------------------------
rem --- signal ---
rem -----------------------------------------
Object.create signal_Spawner
Object.absolutePosition 451.04/96.58/475.60
Object.rotation 0.00/-88.57/0.00
Object.setName signal1
Object.setTeam 1
endrem
rem // Axis = 1 , Allied = 2
rem ============================= ATTACKERS ========================================
Object.create DestroyAA_Objective_Spawner1(Destruction object setting)
object.setName ObjectiveSpawner01
Object.create DestroyAA_Objective_Spawner2
object.setName ObjectiveSpawner02
Object.create DestroyAA_Objective_Spawner3
object.setName ObjectiveSpawner03
Object.create DestroyAA_Objective_Spawner4
object.setName ObjectiveSpawner04
Object.create Destroysignal_Objective_Spawner1
object.setName ObjectiveSpawner05
object.create ANDCompositeObjectiveSpawner(1-5 target " Target " It handles as)
object.setName ALLIED
object.create TimerObjectiveSpawner(The timer and others the [i] which is done)
object.setName AXIS
endIf
To here ↑ 

*ObjectiveSpawnerTemplates.con
As for contents from here ↓

rem ======== Networkable ============================
NetworkableInfo.createNewInfo ObjectiveInfo
NetworkableInfo.setPredictionMode PMNone
NetworkableInfo.setBasePriority c_NIGhostAlways
rem ================ ObjectiveTemplates =====================
rem // Axis = 1 , Allied = 2
ObjectTemplate.create DestroyTargetObjective DestroyAA1
ObjectTemplate.setNetworkableInfo ObjectiveInfo
ObjectTemplate.setTargetName AA1(The name which is set inside ObjectiveSpawners)
ObjectTemplate.ObjectiveName SouthAA(The name which is indicated in BF)
ObjectTemplate.setObjectiveDelay 1.0
ObjectTemplate.setTeam 2
ObjectTemplate.create DestroyTargetObjective DestroyAA2
ObjectTemplate.setNetworkableInfo ObjectiveInfo
ObjectTemplate.setTargetName AA2
ObjectTemplate.ObjectiveName WestAA
ObjectTemplate.setObjectiveDelay 1.0
ObjectTemplate.setTeam 2
ObjectTemplate.create DestroyTargetObjective DestroyAA3
ObjectTemplate.setNetworkableInfo ObjectiveInfo
ObjectTemplate.setTargetName AA3
ObjectTemplate.ObjectiveName NorthAA
ObjectTemplate.setObjectiveDelay 1.0
ObjectTemplate.setTeam 2
ObjectTemplate.create DestroyTargetObjective DestroyAA4
ObjectTemplate.setNetworkableInfo ObjectiveInfo
ObjectTemplate.setTargetName AA4
ObjectTemplate.ObjectiveName EastAA
ObjectTemplate.setObjectiveDelay 1.0
ObjectTemplate.setTeam 2
ObjectTemplate.create DestroyTargetObjective Destroysignal1
ObjectTemplate.setNetworkableInfo ObjectiveInfo
ObjectTemplate.setTargetName signal1
ObjectTemplate.ObjectiveName Radio
ObjectTemplate.setObjectiveDelay 1.0
ObjectTemplate.setTeam 2
ObjectTemplate.create ANDCompositeObjective Composite
ObjectTemplate.setNetworkableInfo ObjectiveInfo
ObjectTemplate.addObjectiveSpawnerToComposite ObjectiveSpawner01
ObjectTemplate.addObjectiveSpawnerToComposite ObjectiveSpawner02
ObjectTemplate.addObjectiveSpawnerToComposite ObjectiveSpawner03
ObjectTemplate.addObjectiveSpawnerToComposite ObjectiveSpawner04
ObjectTemplate.addObjectiveSpawnerToComposite ObjectiveSpawner05
ObjectTemplate.setObjectiveDelay 3.0
ObjectTemplate.setTeam 2
ObjectTemplate.create TimerObjective Timer
ObjectTemplate.setNetworkableInfo ObjectiveInfo
ObjectTemplate.TimeLimit 900.0
ObjectTemplate.setObjectiveDelay 3.0
ObjectTemplate.setTeam 1
rem ============== ObjectTemplate for the objects to be destoryed ================
rem if v_arg1 == host
rem -----------------------------------------
rem --- AA ---
rem -----------------------------------------
ObjectTemplate.create ObjectSpawner AA_Spawner(The thing setting which it destroys)
ObjectTemplate.setObjectTemplate 1 flak38
ObjectTemplate.setObjectTemplate 2 flak38
ObjectTemplate.SpawnDelay 9999
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 200
ObjectTemplate.teamOnVehicle 2
rem -----------------------------------------
rem --- signal ---
rem -----------------------------------------
ObjectTemplate.create ObjectSpawner signal_Spawner
ObjectTemplate.setObjectTemplate 1 signalpanel_m1
ObjectTemplate.setObjectTemplate 2 signalpanel_m1
ObjectTemplate.SpawnDelay 9999
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 200
ObjectTemplate.teamOnVehicle 2
rem ================= OjectiveSpawnerTemplates =======================================
ObjectTemplate.create ObjectSpawner DestroyAA_Objective_Spawner1
ObjectTemplate.setObjectTemplate 1 DestroyAA1
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.setTeam 1
ObjectTemplate.create ObjectSpawner DestroyAA_Objective_Spawner2
ObjectTemplate.setObjectTemplate 1 DestroyAA2
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.setTeam 1
ObjectTemplate.create ObjectSpawner DestroyAA_Objective_Spawner3
ObjectTemplate.setObjectTemplate 1 DestroyAA3
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.setTeam 1
ObjectTemplate.create ObjectSpawner DestroyAA_Objective_Spawner4
ObjectTemplate.setObjectTemplate 1 DestroyAA4
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.setTeam 1
ObjectTemplate.create ObjectSpawner Destroysignal_Objective_Spawner1
ObjectTemplate.setObjectTemplate 1 Destroysignal1
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.setTeam 1
ObjectTemplate.create ObjectSpawner ANDCompositeObjectiveSpawner
ObjectTemplate.setObjectTemplate 1 Composite
ObjectTemplate.setTeam 1
ObjectTemplate.create ObjectSpawner TimerObjectiveSpawner
ObjectTemplate.setObjectTemplate 1 Timer
ObjectTemplate.setSpawnDelay 1
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.setTeam 1
rem endIf
To here ↑

* General note. Because the definition is repeated, way you do not make a mistake in the thing name which is created. In addition, making a mistake in the team which is set it is useless.
Image
Pray hard, die fast
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Objective Mode question

Post by Coroner47 »

Yes the 1st method would work for this. As soon as the object is destroyed the enemies tickets will bleed out ending the round. You just need to tie all enemy spawns to that specific object.
Image
Pray hard, die fast
Post Reply