View unanswered posts | View active topics It is currently Wed Jan 08, 2025 1:40 pm



Reply to topic  [ 7 posts ] 
 Is it possible to make the AI buy an non-standard actor? 
Author Message
User avatar

Joined: Sat Mar 20, 2010 9:25 pm
Posts: 51
Reply with quote
Post Is it possible to make the AI buy an non-standard actor?
After screwing around with Spectator mod again, I realize how dull it is with the teams buying only standard stuff while I have all sorts of mods installed with awesome units and weapons. I was wondering if there is some mod, code or anything I could tamper with to make them buy the mod units. I also get a feeling this is the wrong section, I'm not sure whether this should go in Mod Making, Help or here :oops:


Fri Jul 08, 2011 7:54 am
Profile
User avatar

Joined: Sun May 30, 2010 5:30 am
Posts: 853
Location: Auckland, NZ
Reply with quote
Post Re: Is it possible to make the AI buy an non-standard actor?
A lot of mods come with coustom skirmish activitie using their soldiers and weapons, take a look through the scenes in-game, to find some.


Fri Jul 08, 2011 9:39 am
Profile
User avatar

Joined: Fri Jan 07, 2011 8:49 pm
Posts: 13
Location: Florida, United States
Reply with quote
Post Re: Is it possible to make the AI buy an non-standard actor?
It is indeed, and fairly easy to do.
Go to your CC main folder. Enter Base -> Scene -> Scripts, and you will be presented with several LUA files. Each of these corresponds to one of the game types you play. Open up "SkirmishDefense" with Notepad or another text editor and look for the following lines:

self.WList = { "Grenade Launcher", "Blaster", "Nailgun", "Pistol", "Sniper Rifle"...

This is the list of the weapons the computer can buy. Simply add weapon names in the same format and the computer will spawn with those weapons. Make sure to check the code name of the weapon in its mod folder so that it works correctly.

self.AList = { "Mia", "Dafred", "Dimitri", "Gordon"...

This is the list of actors the computer will buy. Add names in the same fashion as the weapons, and double check the code name.


Sat Jul 09, 2011 6:45 pm
Profile
User avatar

Joined: Sat Mar 20, 2010 9:25 pm
Posts: 51
Reply with quote
Post Re: Is it possible to make the AI buy an non-standard actor?
What do you mean "Code name"? I am currently playing around with the names, but when I try to load the game it pauses on "index.ini *checkmark* Done!" for Spectator, which is what I am trying to modify. I'm trying to give the AI the ability to buy some MDC weapons and the general purpose trooper.


Sat Jul 09, 2011 10:51 pm
Profile
User avatar

Joined: Fri Jan 07, 2011 8:49 pm
Posts: 13
Location: Florida, United States
Reply with quote
Post Re: Is it possible to make the AI buy an non-standard actor?
Alright, let's say you want the computer to buy Dummy Blasters. First, you need to find out what the game calls blasters, so go into the Dummy folder, Devices, Weapons. Here the folder is divided into Explosives, Launchers, Pistols, and Rifles, so explore until you find the Blaster's configuration settings. In this case, it is under the Pistols folder. Open up the settings and scroll down until you find this line:

AddDevice = HDFirearm

Then, find PresetName, right underneath that line. The preset name for the blaster is, of course, "Blaster."

PresetName = Blaster

Armed with this knowledge, we then go back to the Scripts folder, as I described in my last post. Open up SkirmishDefense, and find this line:

self.WList = { "Grenade Launcher", "Nailgun", "Pistol", "Sniper Rifle" }

We see that Blaster is not in this list. So, before "Grenade Launcher" we type "Blaster", and the list then looks like this:

self.WList = { "Blaster", "Grenade Launcher", "Nailgun", "Pistol", "Sniper Rifle" }

The computer will then purchase Blasters along with everything else in the list. Rinse and repeat for every weapon you want, and repeat the same process in the Actors line for the same results.


Sat Jul 09, 2011 11:13 pm
Profile
User avatar

Joined: Sat Mar 20, 2010 9:25 pm
Posts: 51
Reply with quote
Post Re: Is it possible to make the AI buy an non-standard actor?
Is there some kind of arbitrary limit on how many weapons the AI can be assigned to buy? After I kept getting errors with just 2 weapons beyond what was stable, I took off 2 of the standard weapons and it worked again.


Sat Jul 09, 2011 11:49 pm
Profile
User avatar

Joined: Fri Jan 07, 2011 8:49 pm
Posts: 13
Location: Florida, United States
Reply with quote
Post Re: Is it possible to make the AI buy an non-standard actor?
Really? I did more replacing than adding. Let me check really quickly.

EDIT:
I added two weapons to the default list, and the game ran fine. I'm going to ask the inevitable question about your syntax now :P

Make sure that:
There are quotes around the name of the weapon ("Lolgun")
There is a comma and space after every weapon except the last, with just a space ("Lolgun", "Wowgun" })

If not, I have no idea. Never had a problem except for typos in the weapon names.


Sun Jul 10, 2011 3:28 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.047s | 15 Queries | GZIP : Off ]