Joined: 28 Apr 2009 Location: Auckland, New Zealand
Posted: Wed Jun 01, 2011 9:12 am Post subject:
Using upgrades as prerequisites.
Subject description: Simple as it sounds
Is it possible to use an upgrade eg. the Ion cannon uplink, as a prerequisite for specific units. I was tinkering with the idea of creating a mod where after building a GDI command centre, you could select your "war doctrine" by adding an upgrade to it. This would unlock specific units to you etc. _________________ Beta Tester for Mental Omega 3.0
I remember the tinkering in this which has gone on in the past in regards to buildings
You can use an upgrade as a prerequisite for a building, but only if you build the upgrade directly after the upgradeable building (IE, you build the PP, then the Turbine rather than the PP, then the Barracks then the Turbine). If you build something in between then the upgrade won't work as hoped. It will work if you build another PP and then place a Turbine on it.
I believe the same is true of units.
So in general, not without some glaringly evident bugs. QUICK_EDIT
The result is: it can work quite perfect, if you give the conyard an upgrade and before anything else can be build, you let the player decide which subfaction he wants to use. Then, after he placed the subfaction upgrade on his conyard, he gets one powerplant for faction A and another one for faction B. So that now these powerplants serve as prerequisites for future buildings/units, because the upgrade lost its prereq ability due to the construction of the powerplant. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 28 Apr 2009 Location: Auckland, New Zealand
Posted: Wed Jun 01, 2011 10:08 am Post subject:
So in order for it to be a prerequisite building, the upgrades must have the "Command Centre" as their prerequisite and be buildable straight away?
What if i made it "Build Command Centre => Build upgrade (I'm thinking heavy armour general, airforce general and experimental weapons general) => ANOTHER building (Ie Airforce Command, Armoured Command, Experimental Command) => Upgrade specific units" Would this theoretically work, nothing in between each? _________________ Beta Tester for Mental Omega 3.0
Last edited by Death Cultist on Wed Jun 01, 2011 10:12 am; edited 1 time in total QUICK_EDIT
Not really. For it to work, you have to make sure the player can't build anything else than the upgrade, after he build the Command Centre. If he builds something else, the upgrade looses its ability to work as prerequisite.
And i'm quite sure your Command Centre is a high tech building where a lot of other buildings are already available. In your case the player could still build a powerplant or something else right after the Command Centre and from this point on, the upgrade can't work as prerequisite anymore.
Thus only very early in a game, where the player can't build anything else than the upgrade, the upgrade as prerequisite works quite reliable. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Wed Jun 01, 2011 10:33 am Post subject:
IIRC, in YR and I guess then in TS as well, only the last built building is checked if it has the prerequisited upgrade.
You can use this for anything, just remember this point. _________________ "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
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Wed Jun 01, 2011 11:08 am Post subject:
No problem... I've learnt many factoids like this from DCoder since I started testing Ares. Glad it's helpful. _________________ "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
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Wed Jun 01, 2011 5:12 pm Post subject:
Well, I usually build 2 barracks late-game to speed up training... but it can work.
The best way would be putting the upgrade to a BuildLimit=1 building. _________________ "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
And how should that prevent the player from building a powerplant or anything else after the BuildLimit=1 building? _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Thu Jun 02, 2011 12:17 am Post subject:
I mean if the building which is meant to be upgraded has BuildLimit=1, then the player is forced to build the upgrade to all incarnations of the building, since (s)he can't have the building twice, and the modder thereby prevented this bug to kick in. _________________ "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
The result is: it can work quite perfect, if you give the conyard an upgrade and before anything else can be build, you let the player decide which subfaction he wants to use. Then, after he placed the subfaction upgrade on his conyard, he gets one powerplant for faction A and another one for faction B. So that now these powerplants serve as prerequisites for future buildings/units, because the upgrade lost its prereq ability due to the construction of the powerplant.
Can it cause problems if the player starts building faction upgrade A, but then cancels it and builds upgrade B instead? Or cancel both of them a few times, then build one? _________________ QUICK_EDIT
I mean if the building which is meant to be upgraded has BuildLimit=1, then the player is forced to build the upgrade to all incarnations of the building, since (s)he can't have the building twice, and the modder thereby prevented this bug to kick in.
No, because if he builds the BuildLimit=1 building, then a powerplant or refinery and then the upgrade, the upgrade doesn't work as prerequisite anymore. Because the last built building was a powerplant/refinery and not the buildlimit=1 building.
SuperJoe wrote:
Can it cause problems if the player starts building faction upgrade A, but then cancels it and builds upgrade B instead? Or cancel both of them a few times, then build one?
No, that's not a problem at all.
The only thing you have to make sure is, that the upgrade is build right after the upgraded building. _________________ SHP Artist of Twisted Insurrection: Nod buildings
The result is: it can work quite perfect, if you give the conyard an upgrade and before anything else can be build, you let the player decide which subfaction he wants to use. Then, after he placed the subfaction upgrade on his conyard, he gets one powerplant for faction A and another one for faction B. So that now these powerplants serve as prerequisites for future buildings/units, because the upgrade lost its prereq ability due to the construction of the powerplant.
That's excactly what I had done in CL quite a while ago. It worked perfect, but
There really is little point in trying to make an upgrade work as a prerequisite, on one hand it can fully work but on the other it's complicated and messy and can easily be prone to failure by user error, the nearest I got to making something like this was by trying to emulate an upgrade. In my case I made a new building with foundation=0x0 and adjacent=0 / 1 (can't remember). I could build the "upgrade" and it could only be placed by selecting one of my buildings though there was no foundation square for it, just the standard cursor. Worked fine as a prerequisite but was a weirder way of doing it. _________________ QUICK_EDIT
That's an interesting way Morpher. The only problem i see is, that this 0x0 building can't be destroyed anymore. So maybe at one point the AI is trying to destroy this dummy building (making it ingame look like the AI is shooting on an empty cell) and it might also make the player unable to lose.
But i really like the idea that the adjacent=0 thing makes it look/work like an upgrade. It would be nice to make it restricted to one type of building though.
\EDIT
Adjacent=0 still allows the building to be placed right next to another player building and not only on top of it (works exactly like Adjacent=1 from what i've seen/tested).
Foundation=1x1 and PlaceAnywhere=yes also didn't make it look like an upgrade, even if it has a visible foundation cursor and can still be placed on top of other buildings.
however Insignificant=yes, allows the player to lose, even if he has one of these 0x0 foundation buildings, so this isn't a problem as assumed before. _________________ SHP Artist of Twisted Insurrection: Nod buildings
The 0x0 foundation building 'upgrade' is an older idea in the RA2 modding loop. This is used in several mods such as Robot Storm, Project Phantom, AG's Shattered Alliances, and Final War. The AI will not have issues with this building.
Was thinking of an alternative way to implement sub-factions, though this idea might be an old one. After deploying a con.yard, you'd have access to only 1 building, a warfactory. From there you could build eg. 3 different vehicles (maybe called sub-faction command vehicles?). The ProductionAnim would then self-destruct the warfactory, so you can only build one of the said vehicles. Then deploy it and use it as prerequisite for the sub-faction specific stuff. This would work even for the AI, it would randomly choose between the triggers to create one of the sub-faction vehicles. Though you'd have to use the condition part of the AI scripts to check that the sub-faction command vehicle is present.
The command vehicle would also have to be Immune=yes and Insignificant=yes. Dunno if any of the generic prerequisites could be used so that stuff that is shared between all factions is available no matter which sub-faction you chose, and only sub-faction specific stuff has the command vehicle as prerequisite. _________________ QUICK_EDIT
you could still build the warfactory more often then one time, allowing you to create from each sub faction a vehicle, giving you acsess to all technology.
If you would destroy the conyard AND the WF, the player would loose the game when short game is on ...
_________________
Think of me as Nordos, 'cause Banshee wouldn't rename me QUICK_EDIT
you could still build the warfactory more often then one time, allowing you to create from each sub faction a vehicle, giving you acsess to all technology.
If you would destroy the conyard AND the WF, the player would loose the game when short game is on ...
BuildLimit=-1 should allow it to be built only once. _________________ QUICK_EDIT
One issue in TS is that currently their is no hack/DLL enhancement which allows Negative Prerequisite i.e. if you build one BuildLimit=-1 0x0 building, you can't build the other BuildLimit=-1 0x0 building _________________ QUICK_EDIT
Joined: 28 Apr 2009 Location: Auckland, New Zealand
Posted: Fri Jul 01, 2011 11:07 pm Post subject:
Okay I have encountered numerous bugs with this idea. It truly a headache, I'm attempting to make a mod with sub-factions and and now simply tinkering with the idea of just making six extra factions (nightmare coding here I come). I've mostly had trouble with adding a new MCV. Is there anyway to code a new faction without it having CABAL as the default EVA? _________________ Beta Tester for Mental Omega 3.0
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