Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
I've been playing with the same scripts for weeks attempting to get the AI to reliably detect enemy AI units of different types. It's not the units per-say, but the player that's giving me problems. I've used generic scripts as in
*** IF ***
Player '' has Greater Than or Equal To 1 unit or structure of type 'Artillery' in the area 'LongrangeBD_L_P4'
*** OR ***

I've also tried naming every faction and unit as in

*** IF ***
Player 'SkirmishAmerica' has Greater Than or Equal To 1 unit or structure of type 'AmericaVehicleTomahawk' in the area 'LongrangeBD_R_P4'
*** OR ***
Player 'SkirmishAmericaAirForceGeneral' has Greater Than or Equal To 1 unit or structure of type 'AirF_AmericaVehicleTomahawk' in the area 'LongrangeBD_R_P4'
*** OR ***
Player 'SkirmishAmericaLaserGeneral' has Greater Than or Equal To 1 unit or structure of type 'Lazr_AmericaVehicleTomahawk' in the area 'LongrangeBD_R_P4'
*** OR ***
Player 'SkirmishAmericaSuperWeaponGeneral' has Greater Than or Equal To 1 unit or structure of type 'SupW_AmericaVehicleTomahawk' in the area 'LongrangeBD_R_P4'
Etc, etc, etc...

They've detected themselves when I've used this detailed list but Most of the time, not the enemy. So it sometimes works so that's what's driving me nuts.

The only enemy "Player" that's detected reliably is . So does anyone have any ideas as to how to define an AI enemy? It would be much simpler if I could use '' for all the scripting. Can '' be defined in some way?

Note: I've pinged these detection scripts back and forth to see if that would help and nada. Also, I've defined all unit types such as 'Artillery' in each AI folder and they work for which makes me think it's the AI player that's not recognized.

Also note that on a two player test map, '' worked when I was the enemy. This however didn't work when I tried the same script on a larger map with other AI players. I (as the enemy) was not detected.
Sponsor
Me Myself and Pi
17 years ago
When referring to a skirmish player, that script must be in the corresponding Skirmish Player's folder. So when you refer to TeamPlayerAmerica in a script, that script needs to go into the TeamPlayerAmerica folder. But then you don't even need to use TeamPlayerAmerica, you can just use . (When is in a skirmish player's folder, is then considered to be that player.) This saves modifying time when you have to copy each script into the other folders.

But when you do this, the skirmish scripts the EA created won't take affect in your map. So then you'll need to import them. If you import them right from the game directory (Data\Script\SkirmishScript.scb) they won't come into the right folder. Here are the same script that have been rearranged to import into the right folder:
Download Attachment: UserPostedImage Skirmish Scripts.zip 
229.85 KB
Be sure that before you import them to uncheck Auto Verify. Also, after you import them, it take about 30 seconds to load up the script window each time. So be sure that all of your scripting is done before importing.
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
Yes Me Myself And Pi,
I've had AI skirmish scripts loaded in this map for some time and they're working well. I also have copies of these detection scripts in each factions folder.

The problem and the point is for example is that a script in say China's folder looking for unit from Player 'SkirmishAmerica' doesn't detect the player(SkirmishAmerica) or possibly the unit from that faction. It seems to work for detecting units from local player fine and also its own units but not an enemy. The term '' doesn't work either.

As you said, Player 'SkirmishAmerica' would only work in that player's folder, which is my assumption at this point as well.
***
I'm going to try changing these scripts to spawn a marker if '' has a unit in an area. I was going to spawn the marker to team plyrcivilian and see if AI can pick that up. I'll see how that goes.
Update
Well after some testing I've found that AI player will spawn a marker to its own team and it will be detected by other AI players. Marker names do need to be unique to each AI player and position so it'll take some editing but at least I'll be able to do what I wanted to do.
Thanks for your help.
Me Myself and Pi
17 years ago
Yeah, I've done that too in an AOD map so I could communicate between the scripts in the SkirmishGLA & PlyrCivilain's folders. But it seems weird that doesn't work. Maybe if the computer has multiple enemies, is only one of them.