[CSM] Both Bases Capped to Spawn a Vehicle?

Ask questions, discuss ideas, get answers

Both Bases Capped to Spawn a Vehicle?

Postby Swaffy » Tue Mar 07, 2017 11:53 pm

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™
Image
User avatar
Swaffy
 
Posts: 1705
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Both Bases Capped to Spawn a Vehicle?

Postby freddy » Thu Nov 16, 2017 4:47 am

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
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: Both Bases Capped to Spawn a Vehicle?

Postby Swaffy » Wed Dec 06, 2017 1:26 am

This is client only ... sorry, what you typed confuses me.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Image
User avatar
Swaffy
 
Posts: 1705
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Both Bases Capped to Spawn a Vehicle?

Postby freddy » Tue Jan 02, 2018 8:57 am

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
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: Both Bases Capped to Spawn a Vehicle?

Postby Swaffy » Tue Jan 02, 2018 3:30 pm

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™
Image
User avatar
Swaffy
 
Posts: 1705
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Both Bases Capped to Spawn a Vehicle?

Postby freddy » Sat Jan 06, 2018 1:09 am

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
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: Both Bases Capped to Spawn a Vehicle?

Postby Swaffy » Sat Jan 06, 2018 2:36 am

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™
Image
User avatar
Swaffy
 
Posts: 1705
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Both Bases Capped to Spawn a Vehicle?

Postby freddy » Mon Jan 08, 2018 1:02 am

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
User avatar
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: Majestic-12 [Bot] and 12 guests

cron