Posted: Sun Sep 02, 2012 10:04 pm Post subject:
Oil Derricks in TS (New way)
Alright, here's the new oil derrick logic for TS. I haven't found any exploits or flaws in this method yet, and it is quite easy and clean to implement. Few things to note:
- You need to take over 1 of the 4 tiberium types for this. Normal TS pretty much only uses 2 tiberium types anyway. You can still use this tiberium type in maps, harvesting it just won't give you alot of money.
- Your refineries and silos can get filled up with cheaply valued tiberium pretty quickly. To balance it all out you could increase the Storage value in all silos and refineries.
- The Oil Derrick building needs to have Foundation of 4x3 for harvester team swap to work (afaik, correct me if I'm wrong).
First we need one vehicle and one building in rules.ini. These are pretty much just a special harvester and a special refinery.
Code:
; Vehicle part of the Oil Derrick
[OILVEH]
Image=HARV
Name=Oil Drill ; Or whatever you think sounds logical
Nominal=yes ; Display full name to enemies
Selectable=no ; Can't select it so it can't be ordered to stop unloading
Storage=2147483647 ; Absolute max so the oil derrick will keep functioning forever
IsCoreDefender=yes ; Immune to EMP
NonVehicle=yes ; Can't hijack or repair it
Immune=yes ; Should probably be immune to avoid confusion (target the building instead)
LegalTarget=no ; If you enable Immune you should use this too
CrateGoodie=no ; You never want these to appear from crates
Dock=OILBUILD ; Can't dock at normal refineries
Harvester=yes
Crusher=no
Crewed=no
Weight=10.0
Category=Support
Strength=1000
Armor=heavy
TechLevel=-1
Sight=0
Speed=10
Owner=Civilian
;;PipScale=Tiberium ; Doesn't really need this
;;Explodes=yes ; Do not enable this or there will be one hell of an explosion when the oil derrick dies
AllowedToStartInMultiplayer=no
Cost=0
Points=0
ROT=5
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=5
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Normal
ThreatPosed=0
DamageParticleSystems=SparkSys,SmallGreySSys
ImmuneToVeins=yes
; Building part of the Oil Derrick
[OILBUILD]
Image=NAREFN
Name=Oil Derrick
Nominal=yes
Storage=0 ; Since you can't control in which silo money goes, I recommend using 0 here.
ToProtect=yes ; If you want AI to protect it bit more actively use this
BaseNormal=no ; So you can't build next to it
Unsellable=yes ; So you can't sell it
Refinery=yes
Bib=yes
Strength=2000
Adjacent=0
Armor=heavy
TechLevel=-1
DockUnload=yes
Sight=6
Owner=Civilian
Cost=2000 ; XP bonus for killing it
;;PipScale=Tiberium ; Enable this if you give it Storage
Points=100
Power=0
Powered=no
TogglePower=no
Capturable=true
Repairable=true
Crewed=no
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=8
ThreatPosed=0
DamageParticleSystems=SparkSys,SmallGreySSys,BigGreySmokeSys
DamageSmokeOffset=410, 100, 165
AIBuildThis=no
Easy enough right? Then we need to place the oil derricks onto the map and do the following things.
1. Place the oil derrick(s) in the map, and waypoint(s) infront of them.
2. Create a new Taskforce that contains one OILVEH.
3. Create a Script shown below:
4. Create the following Team:
5. Create a new Trigger:
In the final part of the Trigger (Actions), add a new Action for every oil derrick, and give them each a different waypoint infront of the oil derricks. So in this example case:
Finally, we need to do one little hack to the Game.exe. You can use a tool like Hex Editor Neo to do this. Open Game.exe and go to offset 0x1BF3C0. You should see 6a 00 here.
Change the 00 to the tiberium type that you want to take over for the oil derrick logic. I recommend taking over the unused Cruentus tiberium. So change this bit to 01. If you want to take over some other tiberium type, just use the numbers from 00 to 03, they correspond to the tiberium types in the [Tiberiums] list in rules.ini. Save the changes to the exe.
One final edit to rules.ini. Depending on what tiberium type you used for this logic, change it as follows:
Code:
[Cruentus] ; I chose to use this tiberium
Name=Oil Cash
Image=2
Value=3 ; This changes how quickly you gain credits from the oil derrick. I recommend something between 1-5.
Growth=10000
GrowthPercentage=0
Spread=10000
SpreadPercentage=0
Power=1 ; I recommend using low value here since your silos can get filled with this quickly (and would result in massive explosion).
Color=NeonBlue
Debris=CRYSTAL1,CRYSTAL2,CRYSTAL3,CRYSTAL4
That should do it. Just remember to always add the Taskforce / Script / Team / Trigger for your maps that you add the oil derricks in. It is fairly easy to make the AI capture, protect and destroy the oil derricks with some ai.ini editing. Just use the OILBUILD building index with the script actions 46 (Attack Enemy Structure) and 47 (Move To Enemy Structure).
A big thank you to AlexB for looking into and finding out the hack needed to make this work. Without it this logic would have taken ALOT more work.
EDIT: Just a small explanation as to how this logic works. Basically you spawn a harvester into a map that is full of tiberium. Since we gave the harvester an extremely high Storage value, it is basically filled with limitless amount of tiberium. Once it drives to the oil derrick, it will remain there forever, unloading the tiberium. Players can't remove the harvester from the oil derrick since it has Selectable=no. The harvester changes sides as players capture the oil derrick. The harvester blows up when the oil derrick is destroyed, even if it has Immune=yes. The hack in game.exe changes the type of tiberium that harvesters in maps get filled with when you enable the "Full" parameter in their team. Remember this if you ever use the Full parameter in other situations!
A small addition to the Oil Derrick building. If you want oil derricks blow up when their owner loses, add Insignificant=yes to both OILVEH and OILBUILD. This is probably a good idea, since a player with just oil derricks wouldn't be able to do anything. This is how it works in RA2 as well.
EDIT: It appears you can't use Insignificant=yes on the oil derrick or the harvesters refuse to use them. Oh well, guess you'll just have to wait for the enemy to kill your oil derricks or choose quit or surrender. Think you should still give Insignificant=yes to the special harvesters though. If they managed to leave the oil derrick through some bug or AI somehow managed to get them to leave, this would be a fail-safe so no player (human or AI) would end up with an immune unit that would prevent them from losing a match. _________________ QUICK_EDIT
I wonder if Bib=no and a 3x3 foundation would make the harvester keep changing the house too when the building is captured.
@Banshee: please upload the images to the ppm server, so they aren't lost when the current hoster deletes them. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Just a sidenote, doesn't the campaign use the other 2 tiberium types as well, but with the same appearance?
I remember RA2/YR used the other two as well, but gave them a higher credit amount.
Then again, it's a small adjustment to fix it. _________________
Only Riparius, Vinifera and Arboreus (very rare, same color as vinifera) are used. Cruentus is never used by WW, so it's free to be used for this.
The only thing that might be problematic. If a silo next to a slope and full with Cruentus explodes, it might try to spawn Cruentus on the slope and thus cause an IE. (but i'm not sure about that) _________________ SHP Artist of Twisted Insurrection: Nod buildings
If Insignificant is set, it breaks several other logics. In this case, disables the refinery logic.
It also breaks the BuildLimit key, thus you can build more units than set. _________________ SHP Artist of Twisted Insurrection: Nod buildings
That's because Insignificant=yes makes the building not appear on the game's internal building array, which is checked by several in-game logics (like for on which buildings harvesters can dock, and from where to fire the SWs).
If you "fix" Insignificant=yes to make it add buildings to that list after all, you can as well remove the tag completely, because the buildings with it will no longer auto-explode when they are the only objects left for a player.
Unless you completely rewrite the code that checks it, that is. QUICK_EDIT
Insignificant actually makes the BuildingType be ignored when processing all active BuildingTypes. No code in the game removes or "hides" a object from the internal arrays. Unless its flushing the memory. QUICK_EDIT
Found another interesting way to do the oil derrick, though it has some problems that probably make it unusable. You can place a patch of tiberium directly beneath the refinery docking point, and then give the special harvester Storage=2. This will make it take some time to harvest tiberium, then unload it, and repeat, without ever moving away from the docking point. So you wouldn't have to lower the Value of the tiberium so much (thus fixing silo problem), since there would be a delay in unloading it. But it has some problems:
- If you capture the refinery while the harvester is not unloading, you don't gain the harvester (can't see a way to fix this really)
- How to make the tiberium patch last forever, and how to make it disappear when the refinery dies?
Oh and I forgot to mention that I already tried the method of disabling the special refinery with a trigger every now and then so halt the unloading, but unfortunately disabling the refinery does jack. Even when disabled the refinery works normally. There must be some way to use a script and/or trigger to get a delay into the unloading process, and still keep the harvester capturable.
One solution would be to get rid of the damn silos altogether but I can't even think of a way to do that properly. You could give a refinery a massive Storage, but if an enemy captured that refinery you'd lose all your money... the whole Storage logic is kinda stupid anyway since you can't control in which silo all the money goes. It should spread evenly into every storage available instead of being put into one silo / refinery until it is full. _________________ QUICK_EDIT
Did some quick tests to see how exactly the Storage logic works. From what I can tell it will fill the storages based on when they were built. Refineries and silos that were built first get filled first. But an exception to this is when you capture a storage building with an engineer. Captured buildings seem to immediately take priority and get filled first, then once they are full the filling resumes to the normal way. The emptying of storages works the same way, tiberium that was put in first gets taken out first.
But maybe this whole silo thing isn't such a massive problem. The silos are filled with worthless tiberium sure, but if you think about it, the silos get emptied real fast too. A silo full of this oil stuff is emptied when you build one light infantry. In the normal course of a game you probably are constantly building something, keeping the shitty tiberium from filling your silos since it gets used up pretty fast. Best way would be to experiment with this in a real match and see if it really is a problem. _________________ QUICK_EDIT
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Mon Sep 03, 2012 1:58 pm Post subject:
I'm curios to know how long would it take the harvester to unload? if it ever finished, it would eat all the tiberium on the map _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
I get 9.8 years with 2147483647 bails and 7 bails per second on medium speed setting. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Hmm, I simply looked at how long it took a normal harvester with Storage=28 to unload, and it took roughly 14 secs (on game speed 4) for a rate of 2 bails per sec. Maybe with game speed 6 someone could actually test this! _________________ Last edited by SuperJoe on Mon Sep 03, 2012 2:47 pm; edited 1 time in total QUICK_EDIT
The harvester driver probably wasn't happy with the state that the planet is in, so he went out and cleaned the entire world out of tiberium. Still not pleased, he took a portal to the Scrin home world and sucked it dry as well. And now he's back, dammit, and ready to make a delivery.
RP wrote:
SuperJoe, isn't there an Action called
'59=Reduce Tiberium at (waypoint) ...'
You could try if it works with that Action.
The main problem with the 2nd method still is the fact the harvester doesn't change sides while it is harvesting. I am still optimistic that with some trigger / script combo the 1st method can be adjusted to have delays between unloading. Just need to figure it out... _________________ QUICK_EDIT
I have a small question, is it possible to use a Insignificant building as prerequisite? _________________ Tiberian Fall The Art Of Tiberian Fall QUICK_EDIT
If Insignificant is set, it breaks several other logics. In this case, disables the refinery logic.
It also breaks the BuildLimit key, thus you can build more units than set.
I got such a problem with my mod. One of my techcenters is insignifficant and altough it has buildlimit 1 it can be built as many times as you want. Thx I'd never come behind this breaking it. This would explain why my TS is behaving so unlogic, when considering that some logics break others its a pandoras box. QUICK_EDIT
Just a small update to this. Giving the OILVEH Invisible=yes will make the indestructible harvester completely invisible in the game, leaving only the oil derrick structure visible. Though I recall that the Invisible key can cause problems in multiplayer matches? Does it cause problems on units, or just buildings? _________________ QUICK_EDIT
Joined: 10 Dec 2012 Location: I'm too busy conquering the world!
Posted: Sat Jan 12, 2013 7:42 am Post subject:
SuperJoe wrote:
Just a small update to this. Giving the OILVEH Invisible=yes will make the indestructible harvester completely invisible in the game, leaving only the oil derrick structure visible. Though I recall that the Invisible key can cause problems in multiplayer matches? Does it cause problems on units, or just buildings?
If the short game mode is ON, then it will not cause problem. However, if it is off, then it will cause problem because the harvester is invisible that mean players will not be able to find it. Unless the harvester gets destroy with the structure. _________________ Mod Leader and founder of World Domination
Just a small update to this. Giving the OILVEH Invisible=yes will make the indestructible harvester completely invisible in the game, leaving only the oil derrick structure visible. Though I recall that the Invisible key can cause problems in multiplayer matches? Does it cause problems on units, or just buildings?
If the short game mode is ON, then it will not cause problem. However, if it is off, then it will cause problem because the harvester is invisible that mean players will not be able to find it. Unless the harvester gets destroy with the structure.
The harvester already has Insignificant=yes and it dies when the oil derrick dies, so that shouldn't be a problem. I recall reading that the Invisible key could cause desyncs in multiplayer matches, but I could be wrong. _________________ QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Sat Jan 12, 2013 10:47 am Post subject:
AFAIK Invisible and InvisibleInGame only has issues if the unit spawns on the map, but not when it was already there at map start. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
Just quickly, I wanted to know how the Harvester is full of Tiberium type 3? Or does it defualt to type 3 when set to full? _________________ QUICK_EDIT
Just quickly, I wanted to know how the Harvester is full of Tiberium type 3? Or does it defualt to type 3 when set to full?
SuperJoe wrote:
Finally, we need to do one little hack to the Game.exe. You can use a tool like Hex Editor Neo to do this. Open Game.exe and go to offset 0x1BF3C0. You should see 6a 00 here.
Change the 00 to the tiberium type that you want to take over for the oil derrick logic. I recommend taking over the unused Cruentus tiberium. So change this bit to 01. If you want to take over some other tiberium type, just use the numbers from 00 to 03, they correspond to the tiberium types in the [Tiberiums] list in rules.ini. Save the changes to the exe.
By default harvesters are full of green tiberium when you set them to Full. _________________ QUICK_EDIT
Seeing how the numbering works, it should be even possible to write in the exe to use tiberium 04 and then add in rules.ini a new 5th tiberiumtype
Since you will never harvest or see it anywhere else, it might be enough for the game to simply know the Value of that new 5th tibtype.
e.g.
in the exe write 04h
Code:
[Tiberiums]
0=Riparius
1=Cruentus
2=Vinifera
3=Aboreus
4=OilDummy ;new one only used for oil derrick logic
[OilDummy]
Name=Oil derrick dummy
Image=1 ;use riparius as image
Value=1 ;very cheap but unlimited oil
Growth=10000
GrowthPercentage=0 ;don't grow or spread
Spread=10000
SpreadPercentage=0
Power=1 ;LKO: 0 still harms infantry and causes also an IE when chainreaction=yes
Color=Black ; **WARNING**: If you change this color, notify Bret_a; LKO: someone give me his Mail-Address so i can notify him
Debris=none
I only don't know what happens when you destroy the oil derrick. Will it correctly spawn the new tibtype? Since it uses an existing image, it should actually work and find the necessary overlays. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Might crash the game, but otherwise, wouldn't it be possible to add lots of new Tiberiums as long as they used one of the three available images? Technically you could have 3 forms of resource then?
EDIT: If that's the case, couldn't DTA technically have Tiberium, Ore and Diamonds? _________________ QUICK_EDIT
DTA uses already 3 different art sets, and not only riparius tiberium with a different color setting. So it has blue, green tib and the scrap debris (ressource that is dropped in enhanced mode by destroyed stuff).
The only thing left is Cruentus which is not suitable for Ore, due to the impassability for infantry.
But yes, as long as you use the same Image for the new tiberiumtypes, it should theoretically work to add more types. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Sorry to bump this topic but I want to confirm something, instead of hex editing I could just edit the basic Tiberium to create the effect?
Obviously doing so would mean I couldn't (or shouldn't) use it on the map as a resource.
EDIT: And the answer was yes, also since we can edit the other tiberiums you could use the main one for the oil derricks and turn one of the unused ones into the green tiberium, saves a hex edit. QUICK_EDIT
What about just a silo? Engineer enter and collect 4000 credits? How would that be done? My trigger work is not so good. _________________ MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.) QUICK_EDIT
@Rico: dying units spawn Riparius by default. I think having them spawn the oil derrick resource would be bad.
MadHQ wrote:
What about just a silo? Engineer enter and collect 4000 credits? How would that be done? My trigger work is not so good.
It's impossible to have a filled silo on multiplayer maps belonging to Neutral house.
Neutral is hardcoded to never have any money and always have empty silos.
The only exception is a full harvester belonging to Neutral. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Well what about giving the player 4000 credits upon entering building with out it being a silo? I do not even see a trigger to give player credits... _________________ MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.) QUICK_EDIT
Yes, because there isn't such a trigger.
Afaik it's impossible to give the player any money via trigger.
Only via workarounds like a unit that is sold automatically when spawned as FreeUnit, which is what the other technique was using. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Sorry to dig this up but i'm actually trying my best to make this work, seems ok on most point, the drillers are spawning full but they doesn't go to their ref and i can't figure it out.
All is set as SuperJoe says.
Don't care about the Game.exe hex editing.
Instructions can be found here. Assuming you're using the TS client, you need to list the patch in the TS client's makefile (src -> mods -> tsclient -> tsclient.mk) before compiling. Once you've compiled the new exe, replace your existing TS game.exe with it, then simply add the flag ProduceCashAmount to every building you want to act as an Oil Derrick. For example:
Code:
[CAOIL]
ProduceCashAmount=30 ;gives 30 credits every 180 frames (12 seconds on default speed)
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