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
; Tiberium Spike vehicle form
[TIBSPIKEV]
Name=Tiberium Spike
Image=TTNK ; Put the real image here
Nominal=yes
Category=Support
Prerequisite=CABHUT
Primary=SpikeDeploy ; Needed to make it deploy back into TIBSPIKE1
DeployToFire=yes ; Same as above
DeploysInto=TIBSPIKEB
DeployTime=.0001
Strength=1500
Armor=heavy
TechLevel=-1
Sight=5
Speed=0
Cost=1000
Points=50
ROT=1000 ;0
MovementRestrictedTo=Road ; Needed to prevent abuse of the logic
Crusher=yes ; Needed to prevent abuse of the logic
Crewed=no
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=10
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Crusher ; Needed to prevent abuse of the logic
ThreatPosed=0
DamageParticleSystems=SparkSys,BigGreySmokeSys,SmallGreySSys
Weight=1
AllowedToStartInMultiplayer=no
CrateGoodie=no
NonVehicle=yes ; So hijackers can't capture it
Selectable=no ; Has to be unselectable or the player could order it to move
IsCoreDefender=yes ; Makes it immune to EMP
This building / vehicle combo is the actual Tiberium Spike. But we also need 1 extra structure and vehicle to make this work:
Code:
; Money Spawner vehicle
[MONEYSPAWN]
Name=Rich! I'm rich!
Image=PICK ; Doesn't matter it never appears ingame
Strength=100
Armor=light
TechLevel=-1
Sight=0
Speed=0
Cost=50 ; This adjusts how much money you get per "tick"
Points=0
ROT=5
Crusher=no
Crewed=no
MaxDebris=0
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Normal
SpeedType=Winged ; Key to making the vehicle not appear and give you money instead
ThreatPosed=0
Weight=1
AllowedToStartInMultiplayer=no
CrateGoodie=no
NonVehicle=yes
; Tiberium Spike deployer
[TIBSPIKEDEP]
Name=Tiberium Spike
Nominal=yes
Strength=100
Armor=light
TechLevel=-1
Sight=5
Cost=10000
BaseNormal=no
Points=0
Power=0
Crewed=no
Capturable=false
MaxDebris=0
Primary=SpikeMad
Elite=SpikeMadC ; Needs to be here to prevent a known crash
Turret=no
ThreatPosed=0
DamageParticleSystems=
HasStupidGuardMode=true
Immune=yes
LegalTarget=no
;InvisibleInGame=yes ; Can't use this, would break the logic. Make it use an empty shp instead.
AIBuildThis=no
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
[SpikeMadCWH]
Spread=0
Verses=-100%,-100%,-100%,-100%,-100%
InfDeath=0
ProneDamage=-100%
Wall=no
Wood=no
Conventional=no
;AnimList=S_CLSN16 ; Enable this only for testing
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.
Next go to art.ini and add this to the building artwork section:
Code:
[TIBSPIKEDEP]
Image=Inviso
Remapable=yes
Foundation=0x0
Buildup=NALASRMK
DemandLoadBuildup=true
FreeBuildup=true
NewTheater=yes
PrimaryFirePixelOffset=0,-13 ; This is very important. Makes the 0-damage appear over the Tib. Spike.
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
; Tiberium Spike vehicle form
[TIBSPIKEV]
Name=Tiberium Spike
Image=TTNK ; Put the real image here
Nominal=yes
Category=Support
Prerequisite=CABHUT
Primary=SpikeDeploy ; Needed to make it deploy back into TIBSPIKE1
DeployToFire=yes ; Same as above
DeploysInto=TIBSPIKEB
DeployTime=.0001
Strength=1500
Armor=heavy
TechLevel=-1
Sight=5
Speed=0
Cost=1000
Points=50
ROT=1000 ;0
MovementRestrictedTo=Road ; Needed to prevent abuse of the logic
Crusher=yes ; Needed to prevent abuse of the logic
Crewed=no
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=10
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Crusher ; Needed to prevent abuse of the logic
ThreatPosed=0
DamageParticleSystems=SparkSys,BigGreySmokeSys,SmallGreySSys
Weight=1
AllowedToStartInMultiplayer=no
CrateGoodie=no
NonVehicle=yes ; So hijackers can't capture it
Selectable=no ; Has to be unselectable or the player could order it to move
IsCoreDefender=yes ; Makes it immune to EMP
; Money Spawner vehicle
[MONEYSPAWN]
Name=Rich! I'm rich!
Image=PICK ; Doesn't matter it never appears ingame
Strength=100
Armor=light
TechLevel=-1
Sight=0
Speed=0
Cost=50 ; This adjusts how much money you get per "tick"
Points=0
ROT=5
Crusher=no
Crewed=no
MaxDebris=0
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Normal
SpeedType=Winged ; Key to making the vehicle not appear and give you money instead
ThreatPosed=0
Weight=1
AllowedToStartInMultiplayer=no
CrateGoodie=no
NonVehicle=yes
[YOUR_SCRIPT]
Name=Oil Deploy
0=9,0 ; Deploy
1=5,1 ; Wait 1 time unit
2=6,1 ; Jump to the 1st line (keeps repeating if the deploy failed)
And finally a teamtype as shown below:
For each oil derrick you need to create a new copy of the teamtype and change the Group of it (as circled in the pic).
That covers the taskforce / script / teamtype, now 2 triggers to finalize this:
For vehicle to deploy into building
For building to undeploy into vehicle
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 forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum