Page 1 of 1

Both Bases Capped to Spawn a Vehicle?

PostPosted: Tue Mar 07, 2017 11:53 pm
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?

Re: Both Bases Capped to Spawn a Vehicle?

PostPosted: Thu Nov 16, 2017 4:47 am
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.

Re: Both Bases Capped to Spawn a Vehicle?

PostPosted: Wed Dec 06, 2017 1:26 am
by Swaffy
This is client only ... sorry, what you typed confuses me.

Re: Both Bases Capped to Spawn a Vehicle?

PostPosted: Tue Jan 02, 2018 8:57 am
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

Re: Both Bases Capped to Spawn a Vehicle?

PostPosted: Tue Jan 02, 2018 3:30 pm
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?

Re: Both Bases Capped to Spawn a Vehicle?

PostPosted: Sat Jan 06, 2018 1:09 am
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

Re: Both Bases Capped to Spawn a Vehicle?

PostPosted: Sat Jan 06, 2018 2:36 am
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

Re: Both Bases Capped to Spawn a Vehicle?

PostPosted: Mon Jan 08, 2018 1:02 am
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