This tutorial will allow you to add Oil Derrick type of structures to TS. Think I've managed to work out all the problems from this logic now, though if you find any problems with it, please let me know.

To make this work, we need 2 new structures and 2 new units. Let's start with the main part, a structure and vehicle that deploy into each other. Since the "oil derrick" needs to be of size 1x1, I've called them Tiberium Spike instead, just like C&C 3 has Tiberium Spikes. They have small foundation but are very tall.

EDIT:

Do this first in rules.ini:

Code:

MinDamage=0 ;1

Code:

; Tiberium Spike building form
[TIBSPIKEB]
Name=Tiberium Spike
Image=GATICK ; Put the real image here
Nominal=yes
TechLevel=-1
Strength=1500
Points=50
Cost=1000 ; Just for XP reward
Power=0
Armor=heavy
Sight=5
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
UndeploysInto=TIBSPIKEV
DeployTime=.0001 ; Doesn't seem to have an effect...
BaseNormal=no
Crewed=no
TickTank=yes
ThreatPosed=0
MaxDebris=10
DamageParticleSystems=SparkSys,BigGreySmokeSys,SmallGreySSys
DamageSmokeOffset=500, 500, 400
Capturable=yes
Unsellable=yes
Repairable=yes
TogglePower=no
Selectable=no ; Has to be unselectable or the player could order it to undeploy
Insignificant=yes ; So they blow up when the owning player dies
;Immune=yes ; Use this if you want them to be immune to damage
DeploySound=SUBDRIL1 ; If you want a sound effect played when each "tick" happens
UndeploySound=SUBDRIL1
FreeUnit=MONEYSPAWN ; This gives you the money
IsCoreDefender=yes ; Makes it immune to EMP

MONEYSPAWN is used to give you the money after each "tick". Adjust the cost of it to change how much money you get per "tick". TIBSPIKEDEP is just a hacky building that is required for the logic to work.

Now let's define the remaining rules.ini things, the weapons, projectiles and warheads.

Weapons:

Code:

[SpikeMad]
Damage=0
ROF=12 ; Should be lowish to make the deploying near instant
Range=2 ; Place the Spike Deployer always next to the Tiberium Spike so this range is enough!
ProjectileRange=0
Projectile=SpikeMadPR
Speed=0
Warhead=SpikeMadWH

[SpikeDeploy]
Damage=10
ROF=40
Range=255 ; Max range
Projectile=AAHeatSeeker2 ; Doesn't matter as long as it can target both ground and air
Speed=100
Warhead=AP ; Doesn't matter as long as all verses are more than 0

I won't even try to explain what goes on here. It uses various tricks to do what is necessary for the vehicle form of the Tiberium Spike to deploy back into the building form. If you have specific questions about any of these, I can answer them.

The most important thing here is PrimaryFirePixelOffset. With this you can change the location where the 0-damage is applied. This value requires you to place the TIBSPIKEDEP structure south-east of the Tiberium Spike structure. More on that next.

Now, go to FinalSun map editor. Place the Tiberium Spike (building form) on the map. Next, we need 3 triggers for each Tiberium Spike.

I recommend using 30 or higher values for the deploy trigger event (highlighted in the 1st pic), since the undeploy process can cause problems for missile based weapons. Rather increase the cost of MONEYSPAWN to give you more funds with every "tick". Now, attach the Tiberium Spike 1 Deploy trigger to the Tiberium Spike (building form) that you placed on the map earlier.

Next, place the TIBSPIKEDEP structure south-east of the Tiberium Spike building.

Attach the Tiberium Spike 1 Blow Step 2 trigger to it.

Finally, place a 1x1 piece of pavement exactly under the Tiberium Spike building. Cover the Tiberium Spike building with walls that cannot be destroyed, leaving only 1 entrance to the Spike.

I recommend doing this, otherwise your own units could start firing on the TIBSPIKEDEP structure if they were standing right next to the Spike.

That should cover everything. It has alot of steps, but once you've done all the code, adding Tiberium Spikes to maps only requires you to place the Tiberium Spike and TIBSPIKEDEP structures on the map (with the pavement and walls), then add in the 3 triggers for them. Sorry for not explaining some of the things in the tutorial more specifically, but writing this tutorial took ages as it is. If you have questions about anything just ask them below. I also encourage you to try to abuse / break the logic so I can try to correct any possible problems that might arise.

@SuperJoe: Could you upload the pictures to ppm? There are already many topics here, where the pictures are lost because of the hoster being offline or because it has deleted them after a month. And it would be a shame if the tutorial would become useless without the pictures._________________SHP Artist of Twisted Insurrection: Nod buildings

Where can you upload pics to PPM? I can only see the add attachment thingy, and with that the pics always appear at the very bottom of the post. Guess you could link to them directly in the post, but wouldn't they still remain in the bottom too? Is there some other way to upload things on PPM?

I've been using ImageShack and Tinypic before, both seem kinda reliable._________________QUICK_EDIT

I thought Banshee gave you already ftp/webspace on ppm due to your mod.
Yes, without ftp-space on ppm, you really have only the attachment possibility._________________SHP Artist of Twisted Insurrection: Nod buildings

The unit deploys, the deployedUnit has FreeUnit=MONEYSPAWN, this something has SpeedType=Winged, as its already stated by SuperJoe, this key is making the vehicle not appear and give you money instead. And finally, the trigger are needed to let it deploy indefinitely in a certain 'tick'._________________
So, yeah, I've created a new acc. 'cause no one could remember Ordosherrscher - and I didn't like that name anyway.QUICK_EDIT

Now that I've worked with map triggers a bit more I realised my old method to do the oil derrick was overly complicated. There is no need for a fake structure to force the vehicle form of the oil derrick to deploy. You only need these (copied from 1st post):

Code:

; Tiberium Spike building form
[TIBSPIKEB]
Name=Tiberium Spike
Image=GATICK ; Put the real image here
Nominal=yes
TechLevel=-1
Strength=1500
Points=50
Cost=1000 ; Just for XP reward
Power=0
Armor=heavy
Sight=5
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
UndeploysInto=TIBSPIKEV
DeployTime=.0001 ; Doesn't seem to have an effect...
BaseNormal=no
Crewed=no
TickTank=yes
ThreatPosed=0
MaxDebris=10
DamageParticleSystems=SparkSys,BigGreySmokeSys,SmallGreySSys
DamageSmokeOffset=500, 500, 400
Capturable=yes
Unsellable=yes
Repairable=yes
TogglePower=no
Selectable=no ; Has to be unselectable or the player could order it to undeploy
Insignificant=yes ; So they blow up when the owning player dies
;Immune=yes ; Use this if you want them to be immune to damage
DeploySound=SUBDRIL1 ; If you want a sound effect played when each "tick" happens
UndeploySound=SUBDRIL1
FreeUnit=MONEYSPAWN ; This gives you the money
IsCoreDefender=yes ; Makes it immune to EMP

Now place the TIBSPIKEV vehicle onto the map, and adjust it's properties as follows:

And that's it. No need for hacky buildings and crap, just a few map triggers.

Think you could even create just a single teamtype and trigger pair for all oil derricks to use, but it might slow down the game. I mean the neutral AI would constantly try to create the Oil Team teamtype. If you create seperate teams and triggers for each oil derrick, you can stop the constant recruiting by disabling "Oil x Step 1" trigger until the oil derrick actually undeploys._________________QUICK_EDIT

Think you could even create just a single teamtype and trigger pair for all oil derricks to use, but it might slow down the game. I mean the neutral AI would constantly try to create the Oil Team teamtype. If you create seperate teams and triggers for each oil derrick, you can stop the constant recruiting by disabling "Oil x Step 1" trigger until the oil derrick actually undeploys.

After a quick test yeah, you can go with only one teamtype and trigger pair to handle all oil derricks. I really don't know if this would have any meaningful impact on performance. If not, then this would be a very clean way to place as many oil derricks as you wish on a map.

If you want to try this, create only a single Oil Team and give it Group=-1. Make sure all the TIBSPIKEV you place on the map have Group=-1 as well. Then simply remove Action 1s from both Oil Step 1 and Oil Step 2 triggers (the last parts in the trigger screenshots). Also change Oil Step 1 Event timer from 3 to 1._________________QUICK_EDIT

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum