Okay, basic aim:
Having a kit that can build a rallye point which then serves as a spawnpoint for the team and is destroyed after 60 seconds.
To make it a realistic asset, it will be implemented as pickup kit ONLY, the officer can only place one rally point total (Reloading not possible, magsize of 1). These limitations are necessary as a well placed spawnpoint behind enemy lines can be a devastating advantage: A single soldier can creep behind the enemy lines, set up this rally point, let dozens of others respawn and stage a large surprise attack on rear flags.
For this to work, you need to create a kit, a new handweapon, a new PCO, a new ObjectSpawnerTemplate and a Global Spawn Group. Yeah, sucks, but not that bad if you know what to do. I'll put the complete code up here, the important lines are commented with "<---"
First, the kit, probably the most easiest of all. Please don't be alarmed, I did this for Battlegroup42, but it works for every other mod or Vanilla too, obviously. (Objects\Items\GerKit\Offizier_Spawn\Objects.con)
Code: Select all
ObjectTemplate.create Kit Germanearly_Offizier_Spawn
ObjectTemplate.setType Assault
ObjectTemplate.setKitTeam 1
ObjectTemplate.geometry offizierkit
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.networkableInfo KitInfo
ObjectTemplate.addTemplate German_Helmet
ObjectTemplate.addTemplate German_hippack
ObjectTemplate.setHealthBarIcon "Ingame/Healthbar_empty_at_64x64.tga"
ObjectTemplate.setHealthBarFullIcon "Ingame/Healthbar_full_at_64x64.tga"
ObjectTemplate.addWeaponIcon "Weapon/icon_eliteknife.tga"
ObjectTemplate.addWeaponIcon "Weapon/icon_walterpp.tga"
ObjectTemplate.addWeaponIcon "Weapon/icon_empty.tga"
ObjectTemplate.addWeaponIcon "Weapon/icon_empty.tga"
ObjectTemplate.addWeaponIcon "Weapon/icon_nbhgr39.tga" <-- placeholder tga for the Spawner. can be replaced with whatever you want.
ObjectTemplate.addWeaponIcon "Weapon/icon_binoculars.tga"
ObjectTemplate.setKitIcon 2 "kits/offizier.dds"
ObjectTemplate.setKitName 2 "Offizier"
ObjectTemplate.setKitActiveName 2 "RESPAWN_ACTIVE_AT"
ObjectTemplate.addTemplate WalterPP
ObjectTemplate.addTemplate EliteKnife
ObjectTemplate.addTemplate Binoculars
ObjectTemplate.addTemplate Spawndrop1 <-- Just add our new handweapon here. My Rallypoint occupies weapon slot "5" so it's put here.
ObjectTemplate.aiTemplate Assault
Basically, for the handweapon to work as intended, you need the weapon to shoot a projectile, the projectile (basically a mine) has an addtemplated objectspawnertemplate that will spawn your PCO that has the spawnpoint attached to it. Yes, that's quite a workaround .
As I'm super lazy I just put step 2-5 in the same object.con (Objects\Items\Handweapons\Spawndrop\objects.con)
Code: Select all
ObjectTemplate.create HandFireArms Spawndrop1
ObjectTemplate.itemIndex 5
ObjectTemplate.networkableInfo HandFireArmsInfo
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.projectileTemplate SpawnDropProj
ObjectTemplate.magSize 1
ObjectTemplate.numOfMag 1 <--- Only one rallye point can be placed, everything else would be too imba
ObjectTemplate.magType 0
ObjectTemplate.reloadtime 10
ObjectTemplate.roundOfFire 1
ObjectTemplate.fireOnce 1
ObjectTemplate.AmmoType 6 <--- You can't "reload", once again to nerf this weapon.
ObjectTemplate.GUIIndex 13
ObjectTemplate.setHudAmmoType ATIconAndStrengthBar
ObjectTemplate.setAmmoIcon "Ammo/icon_gebladung.tga" <---Again, Placeholder, as I used the geballte Ladung as "base" for my spawner object.
ObjectTemplate.setCrossHairType CHTIcon
ObjectTemplate.setHasMag 0
ObjectTemplate.rotationalSpeed 2/0/0
ObjectTemplate.velocity 2
ObjectTemplate.fireInCameraDof 1
ObjectTemplate.hideDuringFireTime 3 <---- weapon will be "hidden" after being fired, denying use of another weapon after the rallye point has been placed
ObjectTemplate.fireDelay 5 <--- After you press Fire to deploy the rally point, it takes 5 seconds before the rallye point actually is placed
ObjectTemplate.soldierCameraPosition 0/-0.03/0.2
ObjectTemplate.cantSelectWhenNoAmmo 1
ObjectTemplate.changeWeaponWhenNoAmmo 1
ObjectTemplate.createSkeleton animations/geballteLadung.ske <--- Again, this is placeholder stuff, the soldier is displayed carrying the geballte Ladung currently...put here whatever you want to use
ObjectTemplate.useSkeletonPartAsMain base
ObjectTemplate.addTemplate SpawnDropLod
ObjectTemplate.loadSoundScript Sounds/Spawndrop.ssc
ObjectTemplate.create AnimatedBundle SpawnDropComplex
ObjectTemplate.createSkeleton animations/geballteLadung.ske
ObjectTemplate.geometry geballteLadung
ObjectTemplate.create SimpleObject SpawnDropSimple
ObjectTemplate.geometry geballteLadung
ObjectTemplate.create LodObject SpawnDropLod
ObjectTemplate.lodselector HandWeaponLodSelector
ObjectTemplate.addTemplate SpawnDropComplex
ObjectTemplate.addTemplate SpawnDropSimple
Code: Select all
rem Shoot Projectile
ObjectTemplate.create Projectile SpawnDropProj
ObjectTemplate.createNotInGrid 1
ObjectTemplate.geometry Landmine
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.addTemplate Spawner_1Spawner <--- Important: Here we add the ObjectSpawnerTemplate to the Projectile.
ObjectTemplate.setPosition 0/-0.225/0
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.timeToLive CRD_NONE/5.5/0/0 <--- This says the projectile will disappear after 5.5 seconds. The addtemplated spawner above has a spawndelay of 5 seconds, so it will spawn ONCE before the projectile dies, and with it the objectspawner. So only one rallye point will appear, after a 5 second delay
ObjectTemplate.gravityModifier 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.setHasMobilePhysics 1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.setHasResponsePhysics 1
ObjectTemplate.setHasPointPhysics 0
ObjectTemplate.hasCollisionEffect 0
ObjectTemplate.invisible 1 <--- Making the projectile invisible, no one has too see that...
ObjectTemplate.material 230
ObjectTemplate.dieAfterColl 0
ObjectTemplate.drag 1.5
ObjectTemplate.mass 2000
Code: Select all
ObjectTemplate.create SpawnPoint SpawnDrop_1Spawner
ObjectTemplate.setSpawnRotation 0/0/0
ObjectTemplate.setSpawnPositionOffset 0/0/0
ObjectTemplate.setSpawnPreventionDelay 0
ObjectTemplate.setSpawnId 85 <---Choose a spawnID that 100% is NOT used by any regular spawns on the map (they usually count from 0-x, and few maps have over 85 spawnpoints ;) )
ObjectTemplate.setGroup 70 <---Choose a Spawngroup that 100% is NOT used by any other globalspawngroup!
ObjectTemplate.setEnterOnSpawn 0
ObjectTemplate.setAIEnterOnSpawn 0
ObjectTemplate.setSpawnAsParaTroper 0
rem *** SpawnGroup ***
SpawnPointManager.group 70
SpawnPointManager.groupteam 1
SpawnPointManager.groupIcon test2.tga
Code: Select all
ObjectTemplate.create ObjectSpawner Spawner_1Spawner
ObjectTemplate.setObjectTemplate 1 Spawner_1
ObjectTemplate.setObjectTemplate 2 Spawner_1
ObjectTemplate.holdObject 0
ObjectTemplate.SpawnDelayAtStart 1
ObjectTemplate.minSpawnDelay 5 <---Here you see, the spawndelay is set to "5". Combined with the "5.5" TimeTolive of the projectile -> One spawn.
ObjectTemplate.maxSpawnDelay 5
ObjectTemplate.timeToLive 0
ObjectTemplate.Distance 20
ObjectTemplate.spawnOffset 0/0.2/0 <--To make sure the spawner spawns above ground if the rally point is placed in tricky places.
ObjectTemplate.team 1
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.damageWhenLost 0
Code: Select all
ObjectTemplate.create PlayerControlObject Spawner_1
ObjectTemplate.setNetworkableInfo ProjectileInfo
ObjectTemplate.geometry rallye_m1 <--Choose whatever geometry you want to display the rally point. Project Reality uses a pile of backpacks, I used a Gulaschkanone ;)
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.hasArmor 1
ObjectTemplate.hitPoints 60 <-- Easy way to make sure the spawner is killed after 60 seconds. Give it 60 HP, set criticaldamage to 60 and make it lose 1 HP per second...I also chose this way to make it possible to destroy the rallye point by use of explosives. So no exploiting the spawnpoint by placing it in the middle of a firefight and happily spawning there all the time ;) .
ObjectTemplate.maxHitPoints 60
ObjectTemplate.criticalDamage 60
ObjectTemplate.hpLostWhileCriticalDamage 1
ObjectTemplate.addArmorEffect 30 e_PanzDamage 0/0.5/0 <---Cosmetics
ObjectTemplate.addArmorEffect 5 e_PanzFire 0/0.5/0
ObjectTemplate.mass 1000 <--- As I used a formerly static object, I had to give it some mass so it would properly sit on ground and it even can be pushed around by other vehicles properly.
ObjectTemplate.Material 45 <--- Regular light tank material to interact with terrain and other objects on collision
ObjectTemplate.GUIIndex 80
ObjectTemplate.setMinimapIcon "Minimap/minimap_icon_stationary_16x16.tga"
ObjectTemplate.setMinimapIconsize 0 <--- Rallye point is invisible on minimap :)
rem -----------------------------------------------
ObjectTemplate.addTemplate SpawnDrop_1Spawner <--Just adding 4 Spawners, so you spawn randomly around the rallyepoint. Good if multiple people are spawning at the same time. Add as many as you want...
ObjectTemplate.setPosition 0.5/0.2/0.5
ObjectTemplate.addTemplate SpawnDrop_1Spawner
ObjectTemplate.setPosition -0.5/0.2/-0.5
ObjectTemplate.addTemplate SpawnDrop_1Spawner
ObjectTemplate.setPosition 0.5/0.2/-0.5
ObjectTemplate.addTemplate SpawnDrop_1Spawner
ObjectTemplate.setPosition -0.5/0.2/0.5
ObjectTemplate.addTemplate SpawndropDamper <--- Had to add these as I used a formerly static object. These Dampers are basic springs defined in the physics.con to stop the object from "jiggling" around when placed and behaving more correctly
ObjectTemplate.setPosition 0.5/0.2/0.5
ObjectTemplate.addTemplate SpawndropDamper
ObjectTemplate.setPosition -0.5/0.2/-0.5
ObjectTemplate.addTemplate SpawndropDamper
ObjectTemplate.setPosition 0.5/0.2/-0.5
ObjectTemplate.addTemplate SpawndropDamper
ObjectTemplate.setPosition -0.5/0.2/0.5
rem -----------------------------------------------
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.setHasResponsePhysics 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.setHasMobilePhysics 1
ObjectTemplate.setHasPointPhysics 0
ObjectTemplate.hasCollisionEffect 0
ObjectTemplate.timeToLive CRD_NONE/60/0/0
ObjectTemplate.explosionForceMod 2
ObjectTemplate.explosionRadius 0 <--- doesn't hurt anyone if it gets destroyed :)
ObjectTemplate.explosionDamage 0
Code: Select all
ObjectTemplate.create Spring SpawndropDamper
ObjectTemplate.setNetworkableInfo SpringInfo
ObjectTemplate.geometry Harley_wheel <- unimportant, as next line states it is invisible anyway.
ObjectTemplate.createInvisible 1
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.Grip c_PGFRollGrip
ObjectTemplate.setStrength 25
ObjectTemplate.setDamping 7