Jump to content

TD mapping, trouble with AI not rebuilding


Trailhog250

Recommended Posts

Hello C&C Comm Center! This is my first post  8)

 

Now, I need some help here with this...

 

I am having trouble scripting the AI to rebuild their structures. I know it's my fault so I'll point that out before anyone else does  :P

 

 

I read nyerguds guide and it actually inspired me to start mapping for TD. (I map/script some for C&C3/BFME2) I have achieved win/loss triggers, properly making the mission playable, getting the briefing in, the videos, the factions, terrain, tiberium, scripting AI teams that will attack.

 

BUT, I'm stumped on this one thing... which is holding back my maps. I cannot figure out how to make the AI rebuild their destroyed structures. (I know how to use the Production trigger so please DO NOT bring that up  XD)

 

I have read what nyerguds had to say about the 'Base' file but it didn't help me no matter how many times I tried to understand it or implement it manually. I cannot find the program 'BaseIT'. I have googled countless searches. I understand how to make them rebuild in a certain order, the name of the structure (ie HAND=Hand of Nod).

 

I need some help, if noone can point me to the editor then please explain HOW the number comes up. (you wouldn't believe the methods I've used to try and get the number right lol)

 

All I need is this last piece of the puzzle and I can start my map making. I'm using CCMap 3.1 btw. And yes I have extracted the vanilla maps from general.mix with XCC.Utilities but looking at that didn't help me understand my problem. Do note that I have no problem making AI teams that attack and rebuild their self. Just the structures.

 

Thanks in advance,

Link to comment
Share on other sites

That manual is based on a very old manual written around 1996, and it mentions a lot of old DOS tools. You don't need them though; CCMap supports rebuilding. If I remember correctly you can just right-click on any building and set a checkbox that determines whether the AI will rebuild it.

 

As for that exact number, if you really want to know how to calculate it by hand, well...the method IS in the ccmanual file.

 

Basically, you take the map cell number the building is on, divide it by 64 (since all maps have a width of 64), and then quotient is Y, and the remainder is X. With that X and Y, you get the number by doing [16777216*Y + 256*X].

 

These numbers may seem random, but hexadecimally, that's 1000000(hex)*Y+100(hex)*X, or in bytes, simply YY.00.XX.00)

To make it more clear... if you take the example value of the ccmanual file, namely "436212992", put it in the Windows calculator, and then switch it to hexadecimal mode (you need to use the scientific / programming view for that), you'll see it transform to "1A 00 15 00", meaning Y=1A(hex) and X=15(hex). Convert these numbers to decimal individually, and you'll see Y=26 and X=21, meaning the cell number of the building is (26*64)+21=1685. This whole conversion can perfectly be done both ways.

 

 

And no, I don't have a fricking clue why Westwood made it so complicated instead of just using the cell numbers :P

Link to comment
Share on other sites

All I need is this last piece of the puzzle and I can start my map making. I'm using CCMap 3.1 btw. And yes I have extracted the vanilla maps from general.mix with XCC.Utilities but looking at that didn't help me understand my problem. Do note that I have no problem making AI teams that attack and rebuild their self. Just the structures.

 

Trailhog250,

I've been taking a look at it, but it didn't work  out fine YET. I have to audit the formulas.

If you wanna see the job so far, this is the link:

Mission.Audit.xls

 

It's an EXCEL file, just throw your INI stuff in the INI tab.

The subject you're looking for is ARMY tab, choosse STRUCTURES on B43.

The BASE section will start appear on the right of the spreadsheet.

Feel free to contact, here or PM.

Feedback needed, by anyone.

 

Also, since you're making SP missions, this a small project I'm involved:

Tiberian Dawn - Single Player missions

But if you're maps are brand new, you will have to publish it here in cnc-comm.com first, in the proper thread.

 

See ya'

 

/edit

You might want to read this also.

Link to comment
Share on other sites

Thanks for the answer,

 

@nyerguds, it is very simple now that I look at it. Simply right-click on a structure scroll down to where it says 'Base' and then move your mouse over it and when another box appears choose the option 'Add and Keep'. And voila! They rebuild it, I may write a guide here elaborating on the AI. (if time permits it)

 

That seems to be the biggest thing that throws people off... I personally found triggers a piece of cake. Nothing really hard about it once I read a guide, (it's a "if 'true' then 'false'" kind of method)

 

Alright, this topic is done. Problem solved,

Link to comment
Share on other sites

Solo... there's nothing hard about the formula. With "mod" being the "remainder after division" function, it's just

(CELL / 64)*16777216 + (CELL mod 64)*256

 

 

Yope, you're right, now it's working, thanks for the feedback.

I based the formulas from the info in the manual.

If you could add this last explanation, would be more clear for the mapmakers.

 

\edit

in EXCEL

=INT(CELL / 64)*16777216 + MOD(CELL;64)*256

Link to comment
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...