Yoshi714
  • Yoshi714
  • 100% (Exalted)
  • Major Topic Starter
18 years ago
I have a few questions about scripting. I've been trying to make more difficult AI and have succeeded in much of it, but some things just arent working out after I think hundreds of attempts.

1) If I make a script specific to a certain general, say LaserGen and it has to do with anything for example receiving 3k for building the strategy center (which I think is actually the default cheat amount hes given in the regular skirmish script) and I play a game that has multiple LaserGen's in it that are AI controlled does that mean that only the first AI player to build a strategy center gets that bonus cash?? Seems as though that shouldnt be the case, but I ran a game of 4 LaserGen's up agasint 3 SupWeapon Gen's and myself and I sold out at the start so I could be an observer, and one of the LaserGens had considerably more cash throughout, and especially at the ned of the game than the others leading me to believe that these scripts do not work independently with each AI player. Can anyone clear this up for me??

2) I am trying to alter some of the build teams for many of the generals. Most of it is fairly simple and has been easy to figure out just through guess work but I am having difficulty getting infantry to garrison (load) the humvee's. I have two sets of team scripts, one for the humvees and one for the infantry. Both are built as they should, collect in the middle but then infantry don't load into the humvee's. In my 'on create' script for the infantry I have them TEAM > LOAD NEARBY TRANSPORT and yet they don't do it. I also tried having them first merge onto the team of humvees then load transport. I also tried having them already on team to begin with. Nothing seems to work here so far. I do konw my teams are working though because I askthem to build a medic which the computer never does, I don't either but its an easy check to make sure the team is atleast made.

3)With base expansion it seems ideal to have the AI build at each supply location. In the scripts I have them building patriots and FB's and eventually war factories and drop zones and particle cannons at supply locations with xx amound of cash left. The problem is, the scripts ask them to do this every so often, rather than every time they discover a new supply dock. Now, what I would like to do is have them build these 'mini bases' each time they find a new supply dock and build a supply center rather than just building these buildings on top of each other at the first or second or even third dock they find when they have access to no more. This isnt as important as the first two issues as if a computer has that many mini bases he's prolly kicking butt anyway.

4) Does anyone know how the X Y coordinate system works in the AIData.ini file?? It would seem trivial that it is just left to right and up and down like in good old calculus class... but yet the coordinates that I put in for the computer to build new buildings doesn't seem to follow those. I mean, if the x coor and the y coor are close to the x and y of the coor's for the command center than it is close to the command center, but not necessarily in the direction I would assume it to be. The angles work great, just the coordinates seem off. I even went into world builder and built the entire Tank Gen's setup (of skirmish buildings, obviously he builds more on the fly from AI scripting) and I did a capture screen of him in a game with plenty of build room and there was no comparibility between them. This has me baffled!?! Any thoughts?

Thanks
Turtling is not a strategy, its a weakness
Sponsor
Me Myself and Pi
18 years ago
1) This skirmish scripts for each player don't interfere with each other. Each skirmish player has a copy of his own scripts & correspond with each other. Even if you tried to get the script to work with each other, like setting a flag to a value, that flag won't even exits to another skirmish player. This applies to multiple players of the same faction.

2) The skirmish player could very well be building different teams then you made. Maybe what you could do is try to create a team that will gaurd the CombatZone after being created & make it like there's about 10 missile defenders & one ranger.

3) I don't have any advise to offer here.

4) What you could do is try changing the first building built to 0,0 & see where he builds it. He could build it right over is command center or the bottom right, I'm not sure. After you find that point, move the start position down in the world build to so that the 0,0 falls on the bottom left corner of the map. Then wherever you place, move your mouse right over the point at which the building. Then look at the bottom left of the world builder window. You'll see X & Y coordinates.
Yoshi714
  • Yoshi714
  • 100% (Exalted)
  • Major Topic Starter
18 years ago
I got the team created fine, I made it weird enough that I would recognize it, especially since id tested a million other things on the map by then I could pretty much say EXACTLY what mr computer players next move is... I had a team of 3 medics and 12 comanches (strange enough this team actually did a better job than most the ones already used) my rocket teams though just kept pumping out, like i set the max number of them on the map to be 10, i know like they would ever last that long in combat, but i did it just in case. so after a while since my teams were 15 rockets and 5 sninpers, I would have about 100 infantry crowding my inner base area. I have also tried to get them to garrison a second firebase but no luck there. the first fire base team that is told to go to the firebase and garrison nearby building dose great, but the second one doesnt go to the firebase, they just stand there.


I have two more questions...

5) Is it possible to remove all scripts that are in an individual map without deleting them one by one? Id like to export from one map to another, but dont have a copy of the second map without scripts already in it, plus, if I just import them without deleting the old ones than it just keeps both rather than replacing or complimenting (which would be preferred)

6) I would like to export my scripts to the Scripts folder in the game, replacing the Scripts.scb file so that mine are used by default when none are in the map already (I assume thats how it works), but I tried doing this once before and just got the serious error message on game start

Thank you

[EDIT: Double Post Splice -- CommieDog]
Turtling is not a strategy, its a weakness
Me Myself and Pi
18 years ago
5) No I don't think so. If you have then in folders then you can just delete the folders & that will delete the scripts in them.

6) If it works in your map, then you should be able to replace those same scripts with the skirmish skirmish scripts. Just make sure that you don't include any scripts that only apply to your map. I have done this before I worked just right.
Yoshi714
  • Yoshi714
  • 100% (Exalted)
  • Major Topic Starter
18 years ago
Ok, I may have had a 'refil supply dock' script in there, or even a random police car just for kicks, ill give it another try... that would make things a TON easier when it comes to testing outcomes on different maps.
Turtling is not a strategy, its a weakness
CommieDog
18 years ago

1) If I make a script specific to a certain general, say LaserGen and it has to do with anything for example receiving 3k for building the strategy center (which I think is actually the default cheat amount hes given in the regular skirmish script) and I play a game that has multiple LaserGen's in it that are AI controlled does that mean that only the first AI player to build a strategy center gets that bonus cash?? Seems as though that shouldnt be the case, but I ran a game of 4 LaserGen's up agasint 3 SupWeapon Gen's and myself and I sold out at the start so I could be an observer, and one of the LaserGens had considerably more cash throughout, and especially at the ned of the game than the others leading me to believe that these scripts do not work independently with each AI player. Can anyone clear this up for me??

Yoshi714 wrote:


That depends on how you wrote the scripts. If you use for the player name, then each AI player should work independently even if they are the same faction and drawing from the same list of scripts. You you are naming a particular faction as a player name, then the script will only interact with the first player of that faction to be declared on the Skirmish Select screen.

2) I am trying to alter some of the build teams for many of the generals. Most of it is fairly simple and has been easy to figure out just through guess work but I am having difficulty getting infantry to garrison (load) the humvee's. I have two sets of team scripts, one for the humvees and one for the infantry. Both are built as they should, collect in the middle but then infantry don't load into the humvee's. In my 'on create' script for the infantry I have them TEAM > LOAD NEARBY TRANSPORT and yet they don't do it. I also tried having them first merge onto the team of humvees then load transport. I also tried having them already on team to begin with. Nothing seems to work here so far. I do konw my teams are working though because I askthem to build a medic which the computer never does, I don't either but its an easy check to make sure the team is atleast made.

Yoshi714 wrote:


Check to make sure that the infantry team is not set to Agressive stance when being ordered to load.

4) Does anyone know how the X Y coordinate system works in the AIData.ini file?? It would seem trivial that it is just left to right and up and down like in good old calculus class... but yet the coordinates that I put in for the computer to build new buildings doesn't seem to follow those. I mean, if the x coor and the y coor are close to the x and y of the coor's for the command center than it is close to the command center, but not necessarily in the direction I would assume it to be. The angles work great, just the coordinates seem off. I even went into world builder and built the entire Tank Gen's setup (of skirmish buildings, obviously he builds more on the fly from AI scripting) and I did a capture screen of him in a game with plenty of build room and there was no comparibility between them. This has me baffled!?! Any thoughts?

Yoshi714 wrote:


The coordinate axes are rotated based on the position of that player's starting point relative to the center of the map so that the X axis will intersect both the center of the map and the player's starting point. I can't remember with certainty, but I believe that positive X values correlate with offset towards the center of the map.
UserPostedImage 
CommieDog: Because someone has to do your dirty work for you
Yoshi714
  • Yoshi714
  • 100% (Exalted)
  • Major Topic Starter
18 years ago
Ok, so let me make sure im hearing your right with your first answer. In my case I am making maps for skirmish play, to play with my friends and compuer (we like to do 2v6 and what not againt hard computers) Anyway, if in that gmae I have 2 super gen's and 2 tank gens which is one of my fav games t play, and in the scripts it says IF SkirmishplayerSup_Weapon has build building of type strategy center then give player XX cash. That scripts is specific to the skirmish team, NOT to the player?? So does that mean in that case only one skirmish player will get the cash? Seems like this would be kinda dumb since the original skirmish scripts are written like that and often enough there are more than one of any type of skirmish team.

The infantry team is not set to aggressive, although I did try that at one point and yea, no change really. I did some searching and found the script for the NucGen's abilibty to garrison ALL of his bunkers. It seems some sort of sequential script was used?? Looks as though a behavioral script CANNOT tell them to enter but rather it references thier actions to another script that tells them to enter. Maybe I am wrong on this but it seems to work for the NucGen and I am yet to try it, had a 'encountered a serious error' message mid game while messin with the NucGen and got pissed cuz I ruined my 3 day streak of no error messages in my AI endeavors... I really wish I could get my maps to upload on here, 2 of mine I really like and would like to share them and get feedback.
Turtling is not a strategy, its a weakness
Me Myself and Pi
18 years ago
When you're working on the scripts for a skirmish player think as if it's just one player using them, not two, one. If there is more then one of the same skirmish player on the map, then a script will be activated for one the players when it meets the condition & when the other meets its condition, it will be activated for him. Just think of it like this: When there is two of the same skirmish players for, lets say, the Laser General a copy of the Laser General scripts will be given to the first player & another copy to the second player. While the game plays, these script won't interfere with each other.

You can also use instead of selecting the skirmish player from the list. refers to the player that you put the script in. So if you put a script in the SkirmishUSA folder, any script that uses will be in reference to the USA skirmish player. I bet EA Games did this so that after they were done with the skirmish scripts for one player they could just copy the scripts for the other player & not have to change the player names in every script that uses them.
Yoshi714
  • Yoshi714
  • 100% (Exalted)
  • Major Topic Starter
18 years ago
Thanks, yea I use the 'this player' feature, that other post had me confused for a second, I was already thinking about how I could change my scripts to make it apply for EACH general of same type... but glad I can brush that one aside! Noy my map is crashing about 15 or 20 min in, not real sure why, I'm going to restart my computer then try a differnt map if that didnt work... If its scripting its got to be in the NucGen's folder since its all ive messed with since testing everything with the USA gens... Is there another way to upload this besides the attaching it to a post??
Turtling is not a strategy, its a weakness
Yoshi714
  • Yoshi714
  • 100% (Exalted)
  • Major Topic Starter
18 years ago
I got my script to export and run on other maps (although something in the NucGen's script is still causing a crash after 20 min, doesnt do it if hes not in the game)
Turtling is not a strategy, its a weakness
Yoshi714
  • Yoshi714
  • 100% (Exalted)
  • Major Topic Starter
18 years ago
I have another question about scripting... In the 'build teams' window where all the teams are organized, there is a value for priority. I have tried to do a little experimenting with that number basically to try to get china to make more hackers instead of wasting on infantry constanty, atleast early anyway, but I am having trouble figuring out if a higher number or lower number means higher priority for the build. I assume its the higher one just becuase that would make more since but I see no difference. Also, once the computer decides it wants to build a team based off its priority do you know if it tries to build that WHOLE team before starting another one, or does it just kinad makes units that are on teams, then if it has enough standing around to make a team than gather them. At first I thought it was the second one, but lately I've noticed units running directly to another unit that they are on a team with, then both of them joining a thinrd and so on, but it could just be coincidence. It may seem like this really doesnt matter but with China who I feel is far better than USA out in the open I'm trying to make their temas as strong and as frequent as possible. Thank you.
Turtling is not a strategy, its a weakness
Me Myself and Pi
18 years ago
I'd think that the higher the priority, the more effort the player will put in building that team over the others.

I'm not sure if the AI tries to build the whole team. If the human player suddenly uses air attacks, it may stop building all teams & work on anti air teams.

Their are script where two team merge into one. Some teams may merge when most of the units are destroyed.