![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
This tutorial lets you create "invisible barriers" spawner which prevents attacker from reaching, say 2nd line bunkers in Tobruk, until defender lose all 1st line bunkers. I will start by pasting then explaining the codes inside ObjectSpawnTemplates.con.
Code: Select all
rem *** dummy of psudo-PushCage ***
ObjectTemplate.create ObjectSpawner AAGunSpawner
ObjectTemplate.setObjectTemplate 2 Ho-Ha
ObjectTemplate.setObjectTemplate 1
ObjectTemplate.SpawnDelay 0
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10
ObjectTemplate.holdObject 1
rem *** self-destorying dummy ***
ObjectTemplate.Active Ho-Ha
ObjectTemplate.setHasResponsePhysics 0
ObjectTemplate.criticalDamage 101
ObjectTemplate.hpLostWhileCriticalDamage 10
rem *** PushCage 1st layer ***
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition -8/-1000/-8
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition -8/-1000/8
ObjectTemplate.setRotation 90/0/0
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition 8/-1000/8
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition 8/-1000/-8
ObjectTemplate.setRotation -90/0/0
rem *** PushCage 2nd layer ***
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition -8/-998.5/-8
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition -8/-998.5/8
ObjectTemplate.setRotation 90/0/0
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition 8/-998.5/8
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate sandbagl_m1
ObjectTemplate.setPosition 8/-998.5/-8
ObjectTemplate.setRotation -90/0/0
rem *** unnoticable dummy wreck ***
ObjectTemplate.TimeToLiveAfterDeath 1
ObjectTemplate.fadeAtTimeToLiveAfterDeath 0
ObjectTemplate.timeToStartFadeAfterDeath 0
any PCO which isnt used in that map can do. Preferably land vehicles. I like APCs because they always have easy spellings.
![Razz :P](./images/smilies/icon_razz.gif)
dont forget that setObjectTemplate to the defender id ONLY and the holdObject line. The later is necessary because you need to put the dummy very high, if you dont want anybody spot the dummy.
self-destorying dummy
"ObjectTemplate.setHasResponsePhysics 0": you may need multiple dummies at the same position. Without this line, dummies may crash each other.
"ObjectTemplate.criticalDamage (hp of dummy + 1)" makes it always self-destroy.
The unit of "ObjectTemplate.hpLostWhileCriticalDamage" is per second. Calculate the time of destory so that it matchs the losing time of the 1st line bunkers.
layers of PushCage
sandbagl_m1 are those right-angled sand bags. Sand bags are always friendly to vehicles as they wont be damaged when rammed to sand bags, and right-angled shaped are flexible for making bounding rectangles. An alternative can be the 3-quarter-circle-shaped sand bags, which let you type less codes but the final shape is limited. I am not sure if there's any better choice.
The 2nd layer prevents attacker stepping on other vehicles or nearby static objects to overstride the 1st layer. An 1.5 increment of height should be fine.
For maps that include planes, you may need to add a deathbubble only for attacker infantries as well, because they may bail and get inside the boundary.
unnoticable dummy wreck
not sure if they are necessary to make nobody notice the wrecks.
![Razz :P](./images/smilies/icon_razz.gif)
The template is now ready. Next simply spawn the dummies at 1000 units above the flags of 2nd line bunkers, with OSIDs attached to 1st front line bunkers.
==================================================
EXTRA TUTORIAL
In fact, the above barrier isnt large enough for flags in Tobruk. You may want to directly decrease the ObjectTemplate.radius to, say 30 units. By doing this, the "white flag of capturing" icon will still show up in client side, although he is 30~50 units away from the flag, meaning he isnt really capturing the flag, which isnt preferable. Making large bounding rectangles is also not a good choice, because no one want the main roads blocked. So here's a method to decrease the radius of capturing circle (somehow) precisely without any problem.
A flag represents a capturing sphere with specified radius (R). Imagine this sphere pinned on ground level, then the radius of the intersacted circle (r) equals to R. r decreases correspondingly if the sphere is raised by (h) units from ground level, (when h is smaller than R ofcoz.) The relation of the above : R^2=r^2 + h^2 Yes this is Pythagorean Theorem. Too long to explain without picture. You may draw it in your own brain.
![Laughing :lol:](./images/smilies/icon_lol.gif)