View Full Version : Building lines on Units
Chronosfera
03-04-2003, 02:32 PM
This might be no news for some of you, but nice to post nonetheless.
Many building modules and lines can be directly transferred to units (not very surprisingly). I have been trying some modules and had some success so far. Energy production and consumption can be applied on infantry and units directly with the EnergyProduction line added, as well as some modules which can be put to units, like deploying of mine, POWERED in kindof, as well as the oil derrick logic. I won't post the codes here as they are direct c&p.
http://www.alliesrevenge2.com/chrono/re/lowpower.jpg
My Rangers powered down
http://www.alliesrevenge2.com/chrono/re/marathon.jpg
Charity Marathon - moving oil derrick :D
Too bad a negative value of auto deposit does not work in Generals unlike in RA2, I can't reproduce something like building running cost drain :(
I will test out more building codes on units and vice versa, maybe we can make a unit build other units or charge a superweapon ... (although I doubt it) ... but it will be interesting :D
DeeZire
03-04-2003, 02:50 PM
Kick ass work :D
You could reproduce the Robot Drone thing from YR then - a unit that wont run without power ;)
Flyby
03-04-2003, 04:21 PM
Interesting indeed. :)
This is a good proof of "object oriented programming" where the modular building blocks can be recombined with almost anything...
Let's all do some crazy experiments !!!! :dead:
Chronosfera
03-05-2003, 12:49 AM
I tried a few more things and results are mostly positive.
Infantry can act as a cost modifier like the techoilderrick, however the modifier is triggered by an upgrade and can only be activated for one time no matter how many rangers (with the code pasted in its part) I built. That would mean we can still have something like an industrial plant but not something more complicated? Like a star port/ price fluctuation/ price increases as number of war factories incrase ... will all be impossible.
Units can also be an object prerequisite for another object. I made my ranger the prerequisite of burton and it worked out nicely. However when I tried to add Prerequisite
Object = AmericaInfantryRanger 5 (dreaming of making something available only when you have 5 rangers) Generals froze badly and I had to reboot my computer manually :(
Well thought I should post these .. and I will still update this thread :)
Curator
03-05-2003, 02:09 AM
Because the game is largely object oriented almost all code works on things such as infantry, buildings and vehicles. The ambient sound effects placed on maps, for instance, are objects themselves just without all the code required to make them into something 'tangible'.
Phoib
03-05-2003, 03:10 AM
Nice proof of object orientated indeed.
My "TD Nod Airstrip thingy idee" is also a proof of this, I just used the DropZone module ;)
That required objects also means units is nice.
Wonder if system objects will work (AKA tank rubble hull as prequiristic).
I can't see the value of it other then knowledge, but it's nice to know anyway :)
ravage
03-05-2003, 07:26 AM
in generals,units and buildings are almost same,except buildings can't move.you can even add units in FactionBuilding.ini and it works!in fact you can add anything into any .ini file in DATA\INI\Object.
i am attempt to make a unit can upgrade other units can no success...:(
Flyby
03-05-2003, 08:07 AM
i am attempt to make a unit can upgrade other units can no success...:(
Have a look at the Pilot....
ravage
03-05-2003, 08:15 AM
no,i mean a unit can use upgrades like FlashGrenade,CaptureBuilding...
Chronosfera
03-05-2003, 10:33 AM
Some modules might require that object to be a structure though (maybe a structure body module or a kindof= STRUCTURE), for example I couldn't get my ranger to spawn burton's or other units.
This can be of some importance if we can make use of all the possibilitiies, like when we plan about mods make sure we are not constrained by old thoughts like planning structures as structures, units as units and infantry and infantry. Hmm, many behaviors can be mixed together, maybe those of projectiles and crates too, since they are all objects.
Crates look a bit complicated to me though ... - .-
Flyby
03-05-2003, 10:55 AM
Some modules might require that object to be a structure though (maybe a structure body module or a kindof= STRUCTURE), for example I couldn't get my ranger to spawn burton's or other units.
It would be interesting to indentify what the limits are for each of the modules. I'm still on the inventorisation level doh :|
I wonder if it wouldn't be beter to split up inventorisation tasks, instead of reinventing the wheel each on us own?
Unless someone already has a complete inventory of all tags and modules???
Phoib
03-05-2003, 11:07 AM
*pokes the big guy*
"DZ, they want something from you..."
;)
Well, for unit production, look to the AngryMobnexus, that should give some clues (The spawning part)
And for the inventarisation of tags, you mean just like the one at the top of these forums?
DeeZire
03-05-2003, 01:56 PM
There shouldnt be any restrictions AFAIK - you can use any Behaviour module. You have to think like Chrono says - forget about infantry, buildings, vehicles etc and think only of one type of thing - 'objects'.
Actually, thats only partly true - you can use any behavioral module on any object, but some behavioral modules need the presence of others to work fully.
smurfbizkit
03-05-2003, 02:20 PM
in generals,units and buildings are almost same,except buildings can't move.you can even add units in FactionBuilding.ini and it works!in fact you can add anything into any .ini file in DATA\INI\Object.
actually you can create your own ini's as well...and they will run(as long as they are in the object folder)
Phoib
03-05-2003, 02:55 PM
:eek:
So, if I understand correctly, and comprehend the file structure of Generals fully, this means that any ini file in the Objects directory will be parsed as long as it contains units?
EG you at Blitz 2 have a Blitz2Units.ini for the units, and so on, with a custom commandset and whatever ini you further need?
How handy... :drunk:
Goketa
03-05-2003, 07:16 PM
I made it so when technical comes out a hijacker comes out out of it. This would mean that if ur makin a mod u could put a bike and a hero so the hero will have his own bike
ravage
03-06-2003, 07:52 AM
:eek:
So, if I understand correctly, and comprehend the file structure of Generals fully, this means that any ini file in the Objects directory will be parsed as long as it contains units?
EG you at Blitz 2 have a Blitz2Units.ini for the units, and so on, with a custom commandset and whatever ini you further need?
the game will read all of them,so my "Humvee have two turrets" bug will happen.
that's why we need patch 1.4.
DeeZire
03-06-2003, 08:24 AM
Thats always been the case with the Object folder - thats why a seperate folder was created for objects and also why those files are not in the same folder as others ;)
The 'Object' folder is a special case. You can have any number of files, and give them any names, in that folder and it doesnt matter - the game will still parse them.
A long time ago, absolutely everything you see in the Object folder now was all in one INI file. Naturally, it got a bit tedious to work with that file as it grew, so it was split into the logical parts which you see now to make editing and debugging a lot simpler. It would have been even easier to have had USAUnit.INI, USABuilding.INI etc etc and it would still work.
As a point of interest, the game doesnt even look for FactionUnit.INI, FactionBuilding.INI etc etc - it simply reads any INI files in the Object folder and parses them into tables. The only condition is that you can only put object definitions in the Object folders INI files.
Just one quick point that people dont seem to have picked up on yet - for the first time, you can specify a conditional OR as a Prerequisite, and this is very handy indeed. Lets say you want to be able to build a special infantry unit that can fly, and you want to be able to build him if you have an Airfield OR a War Factory - any of them will do, but you must have one of them. You can do it like this;-
Prerequisites
Object = AirField WarFactory
End
Very useful. AFAIK, the USA Command Center still uses that old idea - you can build that structure if you have a War Factory OR an Airfield (or both of course). This is probably the only bit of the orginal Generals logic that still remains, where you still build your strategy center if you played as Air Force or Tank COmmand General.
DeeZire
03-06-2003, 08:29 AM
the game will read all of them,so my "Humvee have two turrets" bug will happen.
that's why we need patch 1.4.
Im not sure what you mean there - I use a 5.6MB Object.INI file for my whole mod and have no problems as long as its in the Object folder.
The issue is that sometimes your 'custom named' INI file may not take precedence over the default INI files. Until 1.4 comes out, you should stick with Generals' current naming convention and use the same INI file names to ensure that they 'overwrite' the games default values a la RA2.
ravage
03-06-2003, 08:40 AM
i posted a pic of a humvee have two turret.that's because i have a INI in Object folder,and in this INI the humvee have another turret.looks like the game will use all of them.
i hope patch 1.4 won't disable that,because we can use this "bug" to make units have more than 2 turrets:)
DeeZire
03-06-2003, 10:16 AM
But the 'bug' doesnt stop there - having two files that both declare variables for one object will screw the hell out of the ObjectCreationList - as explained by EA here. Thats what is leading to the sync errors when you mod the game AND use a map INI file to make mods for the same objects.
So in answer to your exploit, yes it will be fixed by 1.4. I dont see the issue with it as you can have 2 turrets on a unit anyways if you want and you can do that perfectly legitimately with the AltTurret subset. If however what you want is some version of the IFV from RA2, then youll have to go down a long road of weaponset upgrades to make that work.
Other than that, I have to say that a Humvee with more than 2 turrets sounds more than little stoopid and deserves not to work anyways :D
Chronosfera
03-06-2003, 10:31 AM
I wonder if I can combine AND and OR, like having
Prerequisite
Object=blah blah
Object=blah
and create something from there.... hmm, what can be done from that besides a separated tech line? (talking to himself :dead: )
Curator
03-06-2003, 03:18 PM
Object = Warfactory Barracks
Object = StrategyCenter
That will make it so you need either the warfactory and the strategy center or the barracks and the strategy center in order to enable the object in question.
Powered by vBulletin® Version 4.1.8 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.