[SSM] Adding Spawnpoints to PCOs

Ask questions, discuss ideas, get answers
Post Reply
User avatar
pon
Posts: 4
Joined: Sat Feb 13, 2021 11:24 pm
Contact:

[SSM] Adding Spawnpoints to PCOs

Post by pon »

Dear friends,

I've been scrolling through a plethora of interesting server-side modding topics the last few days, like attaching a spawnpoint to a Ho-ha, adding spawnpoints to vehicles, rotating paraspawns etc. This gave me the idea to make plane airspawns for maps that do not really have room for an airfield (take Batte of the Bulge for example), so you can select a spawnpoint and spawn into a plane BF3/BF4 style.

OST.con

Code: Select all

ObjectTemplate.create ObjectSpawner ShermanSpawner
ObjectTemplate.setObjectTemplate 2 Fletcher
ObjectTemplate.holdObject 1
ObjectTemplate.MinSpawnDelay 2
ObjectTemplate.MaxSpawnDelay 3
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 4
ObjectTemplate.Distance 4
ObjectTemplate.DamageWhenLost 10
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.Active Fletcher_Entry
ObjectTemplate.setEntryRadius 0

ObjectTemplate.Active FletcherDeckBrowningEntry
ObjectTemplate.setEntryRadius 0

ObjectTemplate.Active Fletcher_EntrySmall
ObjectTemplate.setEntryRadius 0

ObjectTemplate.Active Fletcher
ObjectTemplate.removeTemplate 11
ObjectTemplate.removeTemplate 10
ObjectTemplate.removeTemplate 9 

ObjectTemplate.Active FletcherDriverSoldierSpawn
ObjectTemplate.group 68
ObjectTemplate.groupTeam 2
ObjectTemplate.EnableToChangeTeam 0


ObjectTemplate.Active FletcherDriverSoldierSpawn
ObjectTemplate.setEnterOnSpawn 1
ObjectTemplate.setAIEnterOnSpawn 0
ObjectTemplate.setOnlyForHuman 1

ObjectTemplate.Active SBD
ObjectTemplate.addTemplate FletcherDriverSoldierSpawn
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.forwardmod 50

ObjectTemplate.Active Mustang
ObjectTemplate.addTemplate FletcherDriverSoldierSpawn
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.forwardmod 50
OS.con

Code: Select all

Object.create ShermanSpawner
Object.absolutePosition 891.55/1000.90/404.89
Object.rotation 0/0/0
Object.setTeam 2
I managed to get this working without bots without any trouble at all. The spawnpoint moves with the vehicle and others can even mid-air spawn into the SBD without trouble. The spawnpoint had been sourced in first place from the Gato, and later from a Fletcher and both work without any trouble, as can be seen in this video. However, as soon as I try to run this with bots (either COOP on a live server, SP on my own client or on CQ with a bot patch) its just crashes. I know bots can be funky and all, do certain unexpected things and are generally a nightmare code wise, but something like rotating paraspawns works fine, even though the difference is that this spawnpoint has been attached to a PCO and forces the player into the vehicle.

Is there a way to work around this? I'd love to have both bots and plane airspawns working within the same map. Is there a way to make it bot-friendly, or REM them out of certain things so they're only accessible for humans?
Image
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: [SSM] Adding Spawnpoints to PCOs

Post by freddy »

You could try lock the spawns for bots on those plane spawns and see if that helps. (spawnPointManagerSettings.con)

Code: Select all

spawnPointManager.OnlyForHuman 1
User avatar
pon
Posts: 4
Joined: Sat Feb 13, 2021 11:24 pm
Contact:

Re: [SSM] Adding Spawnpoints to PCOs

Post by pon »

freddy wrote: Sat Dec 18, 2021 8:54 am You could try lock the spawns for bots on those plane spawns and see if that helps. (spawnPointManagerSettings.con)

Code: Select all

spawnPointManager.OnlyForHuman 1
Cheers Fred, though how would you do that? Would it be better to reuse an already existing group, or is it possible to create new groups within SSM? And how do you link the spawnpoints from the Fletcher to a spawnpointmanager group?
Image
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: [SSM] Adding Spawnpoints to PCOs

Post by freddy »

You can find the definitions in game.rfa but you can also put the code in a map in "spawnPointManagerSettings.con" to override the settings

Example in \bf1942\levels\Coral_Sea\Conquest\spawnPointManagerSettings.con

Code: Select all

rem *** Enterprise Driver ***
spawnPointManager.group 72
spawnPointManager.groupTeam 2
spawnPointManager.groupIcon test2.tga
spawnPointManager.groupEnableToChangeTeam 0
spawnPointManager.onlyForHuman 1
rem spawnPointManager.groupStatus 0
It doesnt work to make new spawns for ssm
Post Reply