Joined: 01 Feb 2007 Location: National Reference Laboratory for IPNV
Posted: Sun Jul 01, 2007 7:03 pm Post subject:
Naval Yard/Alt war factory V 2.0
Subject description: Without using mobile buildings
I suggest you to read Morpher's Naval Yard/Alt war factory, if you can understand it properly, and apply it to your mod you should be able to understand this, as it's heavily based on it. With this you can replicate an almost exact copy of RA shipyards, though it's more close to RA2 shipyards
Knowledge/Abilities required:
-Full understanding of Morpher's tutorial.
-Create new sides.
-AI editing (very little)
-Common rules.ini modding
Notes:
-It will work fine if captured.
-It doesn't need to be deployed from a vehicle, you can build it from the Conyard.
-It won't cause problems if it's not the primary building, in fact it doesn't matter if you set the naval yard or the war factory as primary, vehicles will be built from the appropriate building.
-You can set some vehicles to be built from both factories (RO's using that for GDI hovers).
-It has the same limitations than Morpher's method; the AI won't use it properly(I suggest that it shouldn't be allowed to build units from the alternate warfactory), and you won't be able to build a unit from each warfactory at the same time.
-It will make you reach the 100 units limit faster.
-It works with any type of factory.
-This was the real reason to include a navy in RO, as I wanted to utilize this logic.
-This was originally RO exclusive coding feature, however I decided than that was being mean with the community, as all mods should post their discoveries
-Screenshots of this will appear soon in RO forums; I'll fix the link when ready.
-Only few people knew this logic, since I told them , RO modding team, and Morpher, maybe some other TO members, as he might have included/discussed this logic.
Introduction to Morpher's method:
Well, we have all noticed that if we capture an opposite side's factory, we'll be able to build their units, and those units will only come from their respective factory.
So a side's factory just builds their own side units. As Morpher said, if we make a factory with owner=Neutral, only units that belong to the Neutral house will be built from there (with owner=Neutral).
The problem to exploit this was how could you build another side's factory, if this already limited you (your conyard has it's ownership tagged to the side you chose when you start the game, so you can't build enemy buildings, even if they have the same prerequisite, since they have owner=the other side. Also this seems to apply only to conyards, as factories keep dual ownership if built by some side).
Morphers solution was to abuse deploying code, which allowed units from an specific side to deploy into buildings from other side. With this, he created 1 virtual (dummy) side for each side, a set of units and a factory that were owned by one of those sides.
However it had a big problem, the building couldn't be placed from the conyard, losing the RA feeling to it.
Machine's Extended Method:
To have that RA feel it would be necessary to have naval yards built from the conyard; this was thought to be impossible, however I found a workaround (not really, it was more like theorical illumination )
All I had to do was to find a way to build a building from another side. The answer was really easy, just had to set owner tag to a dual owner.
Owner=GDINAVAL,GDI
Code:
Example coding from RO:
; GDI Ship Yard
[GAWEAP2]
Name=Ship Yard
WeaponsFactory=yes
Factory=UnitType
WaterBound=yes ; just if you want it as a shipyard
AIBuildThis=no
Owner=GDINAVAL,GDI
In this way I could build the naval yard from the conyard, however a problem appeared, ground units could be built from the naval yard. So i gave the warfactories an small edit. Owner=GDI,GDIARMOR
Code:
Example coding from RO:
; GDI Starport
[GADROP]
Name=Starport
WeaponsFactory=yes
Factory=UnitType
Owner=GDI,GDIARMOR ;*;
And then made a clone of every GDI unit built by the AI. And gave to the originals, the ones that are going to be built by the player, Owner=GDIARMOR instead of Owner=GDI
After that I edited AI.ini to suit the changes made to the units, ensuring than the AI was only able to build the cloned units.
Code:
Example coding from RO:
; Medium Mech; built by the player
[MMCH]
Name=Titan
Owner=GDIARMOR
; Cloned Medium Mech; built by the AI
[CMMCH]
Name=Titan
Owner=GDI
Doing this, the result would be that the player could only build units with Owner=GDIARMOR on his warfactory and units with Owner=GDINAVAL on his shipyard.
However this is not the end, as you would have the cloned units in your build tab greyed out, and have the new constructions options bug every time you built a new unit/building. Finally, to have the logic properly working, I had to get rid of the bug, the edit is quite simple, an exploit of AI cheats.
Since the AI ignores the prerequisites, I gave all the AI clones an extra prerequisite, a dummy building which could be never be built by the player, in this way, the player wouldn't notice any change and have 2, or more alternate warfactories built from the conyard working without problems withing them.
Code:
Example coding from RO:
; Cloned Medium Mech; built by the AI
[CMMCH]
Name=Titan
Owner=GDI
Prerequisite=GDIFACTORY,DUMMYBUILD
;DUMMYBUILD exist in the building list, and has it's own entries to prevent any problem.
Finally I edited AI.ini. not a hard change just replaced the original unit entries with their cloned versions, be sure to do it in Firestorm too.
I havn't tested it yet but this should work for creating seprate factorys for anything not just ships. (eg if your useing vechicles with jumpjet loco you could have them built by a hanger rather than the warfactory) QUICK_EDIT
Joined: 01 Feb 2007 Location: National Reference Laboratory for IPNV
Posted: Sun Jul 01, 2007 8:42 pm Post subject:
Exactly, I also tested it as a helicopter factory, using a helicopter which was, in reality, a shp infantry. However now, with Team Black's research, it could be perfectly used into making a jumpjet aircraft factory
BTW, it does work, at least it does in RO. I hope, that I haven't forgot some small coding, so when you test it, please notify me if it worked , as I don't want to have posted it incomplete; anyways I don't think that something is missing, it's just to be safe. QUICK_EDIT
one improvemnt you can make:
There is no need to change the ai.ini at all. Make the origenal the one for the AI and your copy the player version. (as i did when testing the above)
And yes it did work apart from some minor bugs that came from me adding the image= to every object includeing those that already had an image= resulting in it looking for non existant grafics) QUICK_EDIT
Joined: 01 Feb 2007 Location: National Reference Laboratory for IPNV
Posted: Sun Jul 01, 2007 9:07 pm Post subject:
Yeah I know, though I prefer it that way, it was the same thing than Morpher suggested long ago.
Good that it works fine, now I know that I didn't forgot anything QUICK_EDIT
I think there is a bug with this I found while testing btw - it relates to the "mutant hijacker" type units in online multiplayer. When you capture a "double owned" unit with it, afik you do not get the unit. _________________ QUICK_EDIT
I've researched this method a little more, i've elimiminated the need for AI clones, and i've found a bug with the MCV, due to it's nature, it can also go out of the naval yard/alt factories
but i'd say that's an acceptable bug, i've tried to fix it, but it all got rather messy, so i simply let that little bug remain _________________ Micro TS
Portable, no campaign, movies or music, just the engine and needed resources for skirmish and lan. QUICK_EDIT
Joined: 25 Aug 2004 Location: DAS BOOT IM DER OSTSEE
Posted: Mon Jul 02, 2007 12:58 pm Post subject:
Curious, but will the AI actually use these units if given them in a taskforce? or is this only for human players...? _________________ PPM's Reichstrollfuherer, 236th Trollenparties brigade. QUICK_EDIT
Curious, but will the AI actually use these units if given them in a taskforce? or is this only for human players...?
i suppose you could try, in fact, i'm going to try once i get back home, seeing the ai attack you with ships would simply be way too cool
knowing the ai though, the bastard will probably be entirely useless with em _________________ Micro TS
Portable, no campaign, movies or music, just the engine and needed resources for skirmish and lan. QUICK_EDIT
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Mon Jul 02, 2007 4:25 pm Post subject:
if I recall correctly, AI are also allowed to disobey TechLevel=-1, right?
I think I remember mutants building 4tnks in that one Nod firestorm mission.
Joined: 01 Feb 2007 Location: National Reference Laboratory for IPNV
Posted: Mon Jul 02, 2007 7:37 pm Post subject:
Team Black wrote:
if I recall correctly, AI are also allowed to disobey TechLevel=-1, right?
I think I remember mutants building 4tnks in that one Nod firestorm mission.
I thought that too, but I made some test with that, and the AI ignored the scripts with units with TechLevel=-1
@Carnotaurus:
AFAIK, the AI won't use them even if you add the taskforces, since naval units would belong to another faction. Also I think that's likely that the AI would ignore the hack and still get units from every warfactory.
@Creagor:
Weird, I didn't notice any bugs with the mutant hijacker other than hijacked units which are not selected with the same type of units (that's because the AI units are clones, and not really the same unit)
@Judeau:
It would be good if you could post the changes you made . BTW I don't have any problems with the MCV, AFAIK. QUICK_EDIT
Joined: 25 Sep 2006 Location: Teamblackistan Posts: Over 9000
Posted: Mon Jul 02, 2007 7:53 pm Post subject:
oh I see - they gave the 4tnk and mutants TechLevel=11 and made the [GDI] house techlevel=11
so that's only something that'll work on singleplayer I guess _________________ The Fall of Hammerfest - Epic Tiberian chain story
Tiberian Odyssey mapping department. Discord The Team Black Index QUICK_EDIT
I don't play around with AI and TechLevel much, but was there not a comment in the RA1 rules or something saying that TechLevel=11 or above are for special case only... maybe that means AI... QUICK_EDIT
@Judeau:
It would be good if you could post the changes you made . BTW I don't have any problems with the MCV, AFAIK.
GDIN and NodN mean "normal" unit
GDINAVAL means naval unit, same with nod
Code:
[MCV2] ;home for GDI and Nod
Nominal=yes
Name=Mobile Construction Vehicle
Image=MCV
Prerequisite=Factory
Strength=6000
Category=Support
Armor=heavy
DeploysInto=gacnst
TechLevel=1
Sight=6
Speed=4
Owner=GDIN,NodN,GDI,Nod ;if i include the both standard and "normal unit" designation, it SHOULD not be buildable from the naval yard, it does exit the blasted thing as well though
CrateGoodie=yes
Cost=2500
Points=250
AllowedToStartInMultiplayer=yes
ROT=5
Crewed=yes
Crusher=yes
Explosion=TWLT070,S_BRNL58,S_CLSN58,S_TUMU60
VoiceSelect=25-I000,25-I002,25-I004,25-I006
VoiceMove=25-I012,25-I014,25-I016,25-I018,25-I022
VoiceAttack=25-I014,25-I022,25-I024,25-I026
VoiceFeedback=ZAP,SERVO-BUG1,SERVO-BUG2
MaxDebris=24
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
ThreatAvoidanceCoefficient=1.00
Weight=3.5
MovementZone=Normal
ThreatPosed=1 ; This value MUST be 0 for all building addons
DamageParticleSystems=BuildingSparkSys,SmallGreySSys
SpecialThreatValue=1
ZFudgeColumn=12
ZFudgeTunnel=15
[GANAVYARD]
Nominal=yes
Name=GDI Naval Yard
Image=GDIYARD
WeaponsFactory=yes
Factory=UnitType
Prerequisite=GARADR,GAWEAP
DeployTime=.022
Strength=1400
Armor=concrete
TechLevel=1
Sight=6
BaseNormal=no
Cost=2000
Points=200
Power=-50
Capturable=false
Repairable=true
Crewed=no
Bib=no
Adjacent=20
WaterBound=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=8
ThreatPosed=1 ; This value MUST be 0 for all building addons
DamageParticleSystems=BuildingSparkSys,SmallGreySSys,BigGreySmokeSys
DamageSmokeOffset=408, 880, 435
AIBuildThis=no
Owner=GDINAVAL,GDI
DeploySound=MECHANICAL2
; Medium Mech
[MMCH]
Nominal=yes
Name=Titan
WalkRate=2
Image=MMCH
Prerequisite=GDIFACTORY
Primary=120mm
Elite=E120mm
Strength=1300
Category=AFV
Armor=heavy
Turret=yes
IsTilter=no
TooBigToFitUnderBridge=true
TechLevel=3
Sight=8
Speed=4
CrateGoodie=yes
Crusher=yes
Owner=GDIN ;titans exit the right building as they should
Cost=800
Points=40
ROT=5
Explosion=TWLT070,S_BRNL58,S_CLSN58,S_TUMU60
VoiceSelect=25-I000,25-I002,25-I004,25-I006
VoiceMove=25-I012,25-I014,25-I016,25-I018,25-I022
VoiceAttack=25-I014,25-I022,25-I024,25-I026
VoiceFeedback=ZAP,SERVO-BUG1,SERVO-BUG2
MaxDebris=6
Locomotor={55D141B8-DB94-11d1-AC98-006008055BB5}
MovementZone=Destroyer
ThreatPosed=5.5 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,SmallGreySSys
DamageSmokeOffset=100, 100, 275
Weight=1.5
VeteranAbilities = FASTER,STRONGER,FIREPOWER,ROF,SIGHT,SENSORS,VEIN_PROOF
EliteAbilities = FASTER,STRONGER,FIREPOWER,ROF,SIGHT,SELF_HEAL
Accelerates=false
ZFudgeColumn=8
ZFudgeTunnel=13
AllowedToStartInMultiplayer=no
CloakingSpeed=3
this should be enough info for you _________________ Micro TS
Portable, no campaign, movies or music, just the engine and needed resources for skirmish and lan. QUICK_EDIT
Joined: 01 Feb 2007 Location: National Reference Laboratory for IPNV
Posted: Tue Jul 03, 2007 1:25 pm Post subject:
Judeau wrote:
Code:
[MCV2] ;home for GDI and Nod
Name=Mobile Construction Vehicle
Owner=GDIN,NodN,GDI,Nod ;if i include the both standard and "normal unit" designation, it SHOULD not be buildable from the naval yard, it does exit the blasted thing as well though
AllowedToStartInMultiplayer=yes
With that coding the MCV should be able go out from the naval yard, as both have owner GDI, just remove GDI, NOD from it's owners, and the problem would be solved. QUICK_EDIT
[MCV2] ;home for GDI and Nod
Name=Mobile Construction Vehicle
Owner=GDIN,NodN,GDI,Nod ;if i include the both standard and "normal unit" designation, it SHOULD not be buildable from the naval yard, it does exit the blasted thing as well though
AllowedToStartInMultiplayer=yes
With that coding the MCV should be able go out from the naval yard, as both have owner GDI, just remove GDI, NOD from it's owners, and the problem would be solved.
except the resulting mcv would deploy into a conyard with owner GDIN or NodN
which can't make most buildings
and don't forget it can't be a starting unit anymore then
i tried making mcv clones with only GDIN or NodN, with their own conyard clones to deploy into
but a lot of build options were unavailable with those _________________ Micro TS
Portable, no campaign, movies or music, just the engine and needed resources for skirmish and lan. QUICK_EDIT
ive got around this by having owner=Civilian on all buildings and then using
Prerequisite=GACNST2 ;New GDI Con Yard
and
Prerequisite=NACNST ;New Nod Con Yard
on all the buildings so only the correct sides can construct the buildings.
(this requires each side having it's own MCV and Con Yard) QUICK_EDIT
ive got around this by having owner=Civilian on all buildings and then using
Prerequisite=GACNST2 ;New GDI Con Yard
and
Prerequisite=NACNST ;New Nod Con Yard
on all the buildings so only the correct sides can construct the buildings.
(this requires each side having it's own MCV and Con Yard)
interesting, implementing now _________________ Micro TS
Portable, no campaign, movies or music, just the engine and needed resources for skirmish and lan. QUICK_EDIT
Another note I forgot. The starting MCV's and the buildable MCV's are seprate.
Main diffrences are:
Code:
Start MCV:
Owner=GDI
Buildable MCV:
Owner=GDIARMOUR
This means the mcv the player builds is GDIARMOUR so must come from the correct factory but the starting one is able to be given at map start.
They both deploy into the same structure so if deployed then undeployed they would both end up being the buidable version.
that was what i tried when i said it got messy
i seemingly messed up the buildings then _________________ Micro TS
Portable, no campaign, movies or music, just the engine and needed resources for skirmish and lan. QUICK_EDIT
either way if it's a buildable MCV, it can't be your starting MCV
seeing as the sides you start with are GDI and Nod.
But, don't worry, I know how to do it properly _________________ Micro TS
Portable, no campaign, movies or music, just the engine and needed resources for skirmish and lan. QUICK_EDIT
Joined: 01 Feb 2007 Location: National Reference Laboratory for IPNV
Posted: Mon Jul 09, 2007 2:31 pm Post subject:
Judeau wrote:
WRONG
sorry, couldn't help myself
either way if it's a buildable MCV, it can't be your starting MCV
seeing as the sides you start with are GDI and Nod.
But, don't worry, I know how to do it properly
Weird, it works perfectly for me. Even after setting the owner to different sides. I mean, that I still get that MCV (Owner=GDIARMOR,NODARMOR), maybe BaseUnit=MCV has something to do with that.
Well anyways, if it causes problems to anyone, just invert both MCVs, it should work properly.
I had that FS problem I while ago too, I solved it by removing few houses that I had added. It is possible that there's maximum number of houses
you can add. If this is the case, the limit is 6 (including neutral+special).
[I had GDI, Nod, Special, Neutral, GDINaval and CABAL as houses and it worked. Then I added Forg and CABNaval and FS refused to work.
I got it to work again by removing GDINaval and CABNaval.] _________________ Check out some TF Kane's Wrath action:
Tournament 3rd place. Vs. bikeRushOwnz in tournament. Ladder wars vs. bikeRushOwnz. QUICK_EDIT
I'm dragging this up yet again, but ever since I've used this alternate method, my G.D.I. A.I only ever builds Hover MLRS, and not any of the original units, and I really can not see why?
I may be completely wrong and this has nothing to do with it, just the Hover MLRS is the only unit thats buildable in both a war factory and a naval yard. _________________ QUICK_EDIT
If you want, you can PM me the inis and i have a look at them.
Right now i have no clue why this tutorial isn't working for you.
In TI I used this to have 2 helipads and 2 barracks for one side. The separated aircraft/infantry work and don't even need clones of the units. _________________ SHP Artist of Twisted Insurrection: Nod buildings
I just noticed an issue with this workaround.
Whenever you capture a building that is the prerequisite for the other sides warfactory, you get a greyed out build-option for that warfactory.
e.g.
you play Nod
and the GDI weaponsfactory has
[GAWEAP]
Prerequisite=GAPILE
Owner=GDI,GDIARMOR
If you then capture GAPILE you get a greyed out build-option for the weapons factory that is listed at the end of your buildlist and you always hear EVA saying "new building options" whenever you finish building something.
I've isolated this problem already to the dual ownership of the building. If you would have only one owner (regardless if GDIARMOR or GDI), the greyed out build-options bug doesn't occurs.
It seems the game just checks
If Owner has more than 1 entry,
then show the building for all player who have the correct prerequisites
and not
If Owner has more than 1 entry,
then show the building for all player who have the correct prerequisites and the correct Owner.
I'm not sure, but i think that's one purpose of this key.
Though RA2 also profits from the fact of having separate conyards for each side which can be assigned as prerequisite to the problematic buildings with more than one owner. And since you'll never be able to have all the necessary prerequisites without the conyard that builds the building, this could be why the greyed-out-build-options-bug doesn't happens in RA2. _________________ SHP Artist of Twisted Insurrection: Nod buildings
ForbiddenHouses is checked in HouseClass::Can_Build() and HouseClass::Generate_AI_Build_List(), also checks if it can build a building type from the games array, i think that is about where it chooses AI lists. QUICK_EDIT
There it seems to be fixed simply by assigning the side specific conyard as prerequisite to the navalyard and warfactory. (lazy/sloppy programmers that )
right now i can only think of adding the other house to the building to fix the New-Construction-Options bug.
e.g.
you play Nod
and the GDI weaponsfactory has
[GAWEAP]
Prerequisite=GAPILE
Owner=GDI,GDIARMOR,Nod
Then you would be able to build the GDI weaponsfactory as soon as you capture the GDI barracks. But you don't get the NCO-Bug anymore. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 01 Feb 2007 Location: National Reference Laboratory for IPNV
Posted: Wed Jan 13, 2010 1:55 am Post subject:
I can't remember what I did, but I guess it was that.
Anyway, you could add GDI's power plant to the prerequisite, so the player can't build GDI's war factory by just having the barracks. QUICK_EDIT
i have tested it in addition to it is requied to add additional Sites like "GDIArmory" and "NodArmory" otherwise the tanks will build in the Yard (when it is primary) =)
and the
Code:
Adjacent=6
should also been setted =) Otherwise the Base must build directly on Water =)
My Problem:
But when the naval-yard is primary setted and im build a tank, then the Side-Speak says "New Construction Option" everytime =/
Code:
ShipYard=yes
is that like the behavor in RA2? (i have found it in rules.ini for TS)
Quote:
ShipYard = This building is a ship yard or sub pen
It Seems to be work, i have removed the weaponfactory=yes and added Shipyard=yes. The ships will produced in the Navalyard and cam out on it at all 4 Sites ^^ 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