Both Bases Capped to Spawn a Vehicle?

Ask questions, discuss ideas, get answers
Post Reply
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Both Bases Capped to Spawn a Vehicle?

Post by Swaffy »

Just curious, how can I go about making a vehicle spawner that only spawns when a team captures two bases? I have an idea for my map Kursk to add a "comeback" spawner, where if one team has the other team in a losing position (both bases captured) the two bases will cause a strong vehicle to spawn for the losing team so they have a chance to fight back.

For example, Germans are holding both center cap points at full force and Russians are struggling to even leave their base. A T95 spawns for the Russians to help fight off the Germans. If Russians neutralize any of the points then the T95 will stop respawning.

How can I do this?
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Both Bases Capped to Spawn a Vehicle?

Post by freddy »

A bit late answer :)

But the way you can do this is that you tie a spawner from one vehicle to another vehicle.

Im guessing this isnt ssm modding, but i will use random vanilla bf42 as examples.

rip a spawner from a boat, (remove template) (also the soldierspawners, you can use them on other places or just let them be) then put the spawner on a jeep, now for this spawner to work, both the boat and the jeep has to be spawned in the map, so you tie them to each of the enemys flags. when both flags is captured the "ripped" spawner will start to work and all that is left is to set the right positions so the right team gets the vehicle from the spawner.

Usually when using boats or subs or such one put them really high up in the air so no one can see them, but if its your own mod you can use what ever dummy object you want.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Both Bases Capped to Spawn a Vehicle?

Post by Swaffy »

This is client only ... sorry, what you typed confuses me.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Both Bases Capped to Spawn a Vehicle?

Post by freddy »

Okay think of it like this then, you can to make two dummy objects, in the first object you put the code for the spawner

example code, in dummy1, create the spawner
ObjectTemplate.create ObjectSpawner boxspawner
ObjectTemplate.setObjectTemplate 1 T95
ObjectTemplate.team 1

Then in the other dummy object you addtemplate the "boxspawner"
ObjectTemplate.addTemplate boxspawner
ObjectTemplate.setPosition -18.6/12.5/-44.999

Now this two dummy objects works together, so at flag 1 you spawn dummy1 and at flag two you spawn dummy2, as soon as both flags are taken the "boxspawner" will start to work and put out a T95
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Both Bases Capped to Spawn a Vehicle?

Post by Swaffy »

freddy wrote:example code, in dummy1, create the spawner
ObjectTemplate.create ObjectSpawner boxspawner
ObjectTemplate.setObjectTemplate 1 T95
ObjectTemplate.team 1
If the base in uncapped then wouldn't this spawner still exist?
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Both Bases Capped to Spawn a Vehicle?

Post by freddy »

Yes, you have to make it live for a limited time, as long as the flag is taken it should be set to respawn without delay, but if the flag is greyed out it will dissapear by your time settings.

easiest way i found to make this "timer" is to spawn the object as destroyed, and the set the timeToLiveAfterDeath to about the same time it takes to cap the flag.

viewtopic.php?f=43&t=1598
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Both Bases Capped to Spawn a Vehicle?

Post by Swaffy »

freddy wrote:Yes, you have to make it live for a limited time, as long as the flag is taken it should be set to respawn without delay, but if the flag is greyed out it will dissapear by your time settings.
Is this what you are talking about?

ObjectTemplate.create ObjectSpawner balance_spawner
ObjectTemplate.setObjectTemplate 1 T95
ObjectTemplate.holdObject 0
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.team 1
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.damageWhenLost 10
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Both Bases Capped to Spawn a Vehicle?

Post by freddy »

ObjectTemplate.Active dummy1
ObjectTemplate.timeToLiveAfterDeath 6
ObjectTemplate.destroyed 1

ObjectTemplate.Active dummy2
ObjectTemplate.timeToLiveAfterDeath 6
ObjectTemplate.destroyed 1

As you dont mod ssm, you can just put these lines in your dummy object code

Code: Select all

ObjectTemplate.timeToLiveAfterDeath 6  <---- seconds before it dissapears
ObjectTemplate.destroyed 1
Post Reply