Posted by: randomperson - Friday, August 1, 2008 12:29:48 PM
I am writing some of the upgrades for Generals British Forces and not being that experianced I don't understand how to write my own behavior moduals and what I want to do can't be copyed from existing code.
What I want to do is make an aircraft stelthed after an upgrade.
I also want to make units build quicker after an upgrade.
Are these even possible and if they are would it be possible to give sugestions on the code?
Posted by: Me Myself and Pi - Sunday, August 3, 2008 8:36:10 PM
That's pretty tough to do. Even after creating the correct module, you'd need to make a command button. I'd recommend looking at other upgrades like Worker Shoes. I haven't experimented with this kind of stuff but maybe upgrades like that can be modified a little for price reduction. Also, you should be able to use that camouflage upgrade that rebels get for the air craft you want to modify.
Posted by: randomperson - Monday, August 4, 2008 5:37:42 AM
[quote=Me Myself and Pi]That's pretty tough to do. Even after creating the correct module, you'd need to make a command button. I'd recommend looking at other upgrades like Worker Shoes. I haven't experimented with this kind of stuff but maybe upgrades like that can be modified a little for price reduction. Also, you should be able to use that camouflage upgrade that rebels get for the air craft you want to modify.[/quote]
I've already made other upgrades and done all the work except writing the behavior module. I used the Rebel code for the stealth, thanks for the tip
[quote=Me Myself and Pi]That's pretty tough to do. Even after creating the correct module, you'd need to make a command button.[/quote]
Are you kidding me? It's very easy to do!
[quote=randomperson]What I want to do is make an aircraft stelthed after an upgrade.[/quote]
Is this a global upgrade or an individual unit upgrade?
[quote=randomperson]I also want to make units build quicker after an upgrade.[/quote]
I'd have to look into that one; I know that price reduction is possible with a CostModifierUpgrade module tag (tech oil refinery), but I'm not 100% sure on build time reductions.
Posted by: icewind - Tuesday, August 5, 2008 12:40:00 AM
I know that build time reduction is possible.
But do you want it for every unit or just one kind of unit?
For every unit just take a look at the code used for the refinery.
For single units I don't think it's used in the original game but the Shockwave mod uses it.
You just have to copy the unit, add "Upgraded" or something to the name and change the build time.
Now you just have to copy a new command set and button for the building the unit is build but let it build the "upgraded" unit.
Now just make the upgrade itself change the command set of the building.
Posted by: randomperson - Tuesday, August 5, 2008 9:13:03 AM
[quote=AuroraAlphaHL2]
[quote=randomperson]What I want to do is make an aircraft stelthed after an upgrade.[/quote]
Is this a global upgrade or an individual unit upgrade?[/quote]]
It dosn't matter now, I have done what i wanted to do
[quote=AuroraAlphaHL2]
[quote=randomperson]I also want to make units build quicker after an upgrade.[/quote]
I'd have to look into that one; I know that price reduction is possible with a CostModifierUpgrade module tag (tech oil refinery), but I'm not 100% sure on build time reductions.[/quote]
I might have to settle for that then, thanks for you help
Posted by: randomperson - Monday, August 25, 2008 11:38:59 AM
I am also trying to emulate the supply lines upgrade for america. I have found the code that tells the game how much to increse the capacity by but I can't find where this code is activated by the upgrade. There doesn't seem to be a behavior module and the command button is a standered one. Any ideas?
Posted by: Me Myself and Pi - Monday, August 25, 2008 7:00:39 PM
Did you look in the Upgrade.ini file? I think that's the one you're looking for.
Posted by: randomperson - Friday, August 29, 2008 12:22:52 PM
yes Upgrade_AmericaSupplyLines is the one but I can't find any code to do with this upgrade that activates a change in the code, is there one? if so where is it?
Posted by: Me Myself and Pi - Friday, August 29, 2008 1:27:12 PM
I did a search throughout the .ini files & couldn't find any code where I could change the percentage amount for the supply lines, but couldn't find it. I did find a few places where the cash bonus is manually put it. So for the Supply Drop Zone Crate, when the upgrade is purchased, $25 extra is added to the cash bonus. The same goes for the Oil Derrick. $20 is add to that too. But I couldn't find any percentages in reference to the supply lines. This is really weird. Is this what you're asking about?
Posted by: randomperson - Friday, August 29, 2008 3:05:18 PM
yes, I only want to do the standard increase though and I am completely stumped, I thought that it would be a standard modal but I can't find a reference anywhere
Posted by: Me Myself and Pi - Friday, August 29, 2008 5:56:05 PM
Yeah, I'm stumped myself. Another thing I tried is I renamed the supply lines upgrade in the hope the game would crash. Then I hoped that I could check the ReleaseCrashInfo.txt file to find where the source of the crash was. I made the change in the CommandSet.ini to be sure that that .ini file wouldn't cause the crash. When I tried the game, it game loaded up fine. But when I tested the supply lines upgrade, it had no affect on my chinooks. [unamused] So my changes did affect the game.
Now, if the stuff that sets the percentage number is in an .ini file, I would've thought the game would crash. But it didn't.
So who knows how to change the number.