Jump to content

CnCNet Forums

Search In
  • More options...
Find results that contain...
Find results in...
Nyerguds

Article: A look under the hood: C&C's special mission behaviour code

Recommended Posts

After a really interesting question from Mr_Killt about the Nod mission in the original Command & Conquer where you have to assassinate Dr. Chan, I used my answers to him to write a small article on ModDB, detailing some of the special code used in Command & Conquer's campaign missions.

 

xCEqi.png

 

You can read the article right here.

Share this post


Link to post
Share on other sites

Your ''You can read the article right here.'' leads to a bad link for me. :P But I managed to google it and read it; and it is very interesting to read this!

Share this post


Link to post
Share on other sites

Aheh, fixed, sorry. I should know by now it's a bad idea to assume all forums use the same BBCode -_-

 

It's rather silly there's no apparent way to put any kind of link to such features on my patch's moddb profile front page :|

Share this post


Link to post
Share on other sites

Dude, get your eyes checked. He's under the top of the targeting cursor.

 

[edit]

 

Changed the image. Better now? :dry:

Share this post


Link to post
Share on other sites
As for the triggers... when playing a custom campaign one day, I noticed that Chan spawned from a destroyed tech center on a mission replacing Nod mission 10. After testing this some more, it turned out this happens only on Nod mission 10. On further examination inside the exe file, I also found special code to immediately link that spawned "CHAN" unit from the tech center to a trigger called "CHAN", which would allow for a really beautiful chain of events of first destroying the tech center, then killing Dr. Chan, and only then winning the mission. Normally, this kind of mission code is impossible for units spawned from destroyed buildings, just like triggers can't be linked to reinforced units.

 

The silly part is, none of that code was used. The mission designer just put a Chan unit next to the tech center, and linked a trigger to him that wasn't even called "CHAN", but just "WIN". Even worse, there was a "CHAN" trigger, but it was just the flare to reveal the island. One of the more bizarre side effects of this was that destroying the Tech Center would give you two Dr. Chans; one linked to the winning trigger, the other (uselessly) linked to a flare trigger (which is normally already activated at that point anyway).

 

On top of that, there was another trigger in the mission that didn't work as it should, namely one that should reinforce a chinook to get your commando onto Chan's island.

 

I concluded the mission was simply severely broken, and fixed all that. So now the mission works exactly as it was intended, with the special systems they'd built for it :)

Wow, this is a very impressive piece of info! Thanks for sharing that!

 

Pity that so many things in Westwood games got half-baked like this. I wonder what's the cause - too many people working on the project so they just lost track of some features?

 

  • The Advanced Comm Center was always capturable, but special code on the mouse cursor modifying prevented players from giving that capture command in single play, except on mission 12. This was rather weird, since it not only allowed capturing of GDI's superweapon in multiplay, but also meant that in single play, enemy engineers could capture your ACC, and you wouldn't be able to capture it back. I made it completely uncapturable, and added a system to custom change the capturability of any building in a mission.

BTW, I've always been wondering, when the AI player has the Adv. Comm. Center, does it fire the Ion Cannon whenever it's charged, or does it do so only when a trigger is activated?

 

Also, any idea why there was such a strange exception to this? It is my understanding that there's a "can't be captured" option for building, like in Dune II already, and stuff like the Temple of Nod uses it?

 

[Edit] BTW, I completely missed the fact that you have a C&C webcomic! I only knew of that hilarious issue of Command & Comic with the Akira reference :)

 

[Edit2] Although I seem to recognize some strips... Read and later forgot about it? O_o

Share this post


Link to post
Share on other sites

BTW, I've always been wondering, when the AI player has the Adv. Comm. Center, does it fire the Ion Cannon whenever it's charged, or does it do so only when a trigger is activated?

In multiplayer, they do. In single player, the AI only uses superweapons given by triggers.

 

Also, any idea why there was such a strange exception to this? It is my understanding that there's a "can't be captured" option for building, like in Dune II already, and stuff like the Temple of Nod uses it?

there is indeed such an option. The exception exists because you're SUPPOSED to capture an Advanced Comm Center in Nod mission 12. They just did this in a very retarded way.

 

[Edit] BTW, I completely missed the fact that you have a C&C webcomic! I only knew of that hilarious issue of Command & Comic with the Akira reference :)

 

[Edit2] Although I seem to recognize some strips... Read and later forgot about it? O_o

You seemed to have missed the fact they're not mine, too :P

 

Only the last one is mine, because I did a 'guest comic' for him. These were posted on the Petroglyph forum, but the original pics disappeared from the internet, so I decided to upload them all (including my extra one) on my site.

Share this post


Link to post
Share on other sites

there is indeed such an option. The exception exists because you're SUPPOSED to capture an Advanced Comm Center in Nod mission 12. They just did this in a very retarded way.

Meaning the developers somehow couldn't or didn't want to make the reverse exception (uncapturable except for mission X)? And went as far as to modify the player's cursor behaviour so that the Adv. Comm. Center can't be captured by the player even if it is theoretically possible to do so? Weird.

 

BTW, can this exception via cursor removal be circumvented by the force-move command on the engineers? (I mean, in the original game.)

 

You seemed to have missed the fact they're not mine, too :P

Yeah, I noticed that only after posting already :D

 

What I certainly did recognize is the player character image and the computer in the "bunker" (?) he operates from. Strange that I remember everything else rather vaguely, if at all.

 

On an unrelated note, recently I got into webcomics (had been reading some before, like Alien Loves Predator or the aforementioned Command & Comic, but very infrequently - probably due to the slow dial-up connection I used to have), most notably The Order of the Stick, Irregular Webcomic!, Darths & Droids, Freefall and Supernormal Step :)

Share this post


Link to post
Share on other sites

Meaning the developers somehow couldn't or didn't want to make the reverse exception (uncapturable except for mission X)? And went as far as to modify the player's cursor behaviour so that the Adv. Comm. Center can't be captured by the player even if it is theoretically possible to do so? Weird.

Making the cursor exception was a LOT easier than actually changing the building's capturability state for one single mission. Note that if they'd made the exception opposite on the mouse cursor, that wouldn't work, since an engineer entering an uncapturable building is simply lost (as the AI sometimes shows by infiltrating turrets or SAMs with them)

 

BTW, can this exception via cursor removal be circumvented by the force-move command on the engineers? (I mean, in the original game.)

Nope, the whole thing was blocked exactly as if it were uncapturable. You just got a normal arrow cursor, and when you clicked it would select the building instead of giving a command.

 

What I certainly did recognize is the player character image and the computer in the "bunker" (?) he operates from. Strange that I remember everything else rather vaguely, if at all.

Actually, they're all from some other classic game IIRC, so, you may remember that :P

 

Anyway, the original thread is here:

http://www.petroglyphgames.com/forums/index.php?showtopic=2469

 

On an unrelated note, recently I got into webcomics (had been reading some before, like Alien Loves Predator or the aforementioned Command & Comic, but very infrequently - probably due to the slow dial-up connection I used to have), most notably The Order of the Stick, Irregular Webcomic!, Darths & Droids, Freefall and Supernormal Step :)

You don't want to go into webcomics with me here... we'd have to split the thread, lol. I follow tons of them :D

Share this post


Link to post
Share on other sites

Another weird thing I noticed was that in the original campaigns, enemy buildings do not start repairing as quickly in the first few missions as they do later or in covert ops. Upon replacing scb01ea with a custom map, I saw it still behaved the same and I didn't change anything in the .ini file regarding this. So I figured it must be another thing hardwired into the .exe.

Share this post


Link to post
Share on other sites

Yes, you're right, I saw this too. In the first missions, they don't sell when they run out of money to repair with. I have no idea where that logic could be ingame though. Only hint I could have towards finding that is the function to request a player's amount of money.

Share this post


Link to post
Share on other sites

If the enemy money is 0, he will understeand that he got no base, and he should not sell buildings. I've already did a mission and gave to him no money.

 

Also, the enemy repair faster when the tech level is higher. you know :D

Share this post


Link to post
Share on other sites

Also, the enemy repair faster when the tech level is higher. you know :D

Actually, I never noticed that.

 

On a side note, IIRC the AI in Dune II differs from the player in how much it spends on repairs.

Share this post


Link to post
Share on other sites

If the enemy money is 0, he will understeand that he got no base, and he should not sell buildings. I've already did a mission and gave to him no money.

I doubt that... any tests I've done with that resulted in immediate selling when attacking something.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...