Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Computer forces do nothing despite AI scripts
Computer forces do nothing despite AI scripts
Jun 15 2010, 7:14 pm
By: kennedy_m  

Jun 15 2010, 7:14 pm kennedy_m Post #1



I'm relatively new to the Starcraft Campagn Editor, but I've made several maps to date that all worked correctly. The map I'm having problems with is my largest to date.

In this map, you start as the green Terran. Following your mission objectives, you encounter some purple Terran that are rescuable units. You take these, and along with your green units, you are dircted to destroy the beginnings of a small yellow Zerg base. After this, you head down to a partially started red Terran base. These are also set as rescuable units, and this location is where you are directed to set up your main base.

There are now four computer controlled forces left one the map - two Zerg (orange and blue), and two Protoss (teal and brown).

The problem occurs when I play the map. I was using a cheat that lifts the fog of war so I could test the map. Through doing this I realized that all of the computer forces weren't doing anything! The Protoss each sent one probe (of four) to mine, then just sat around. The orange zerg built a second hatchery and a fifth drone, but only had two mining. Then they nothing else. The blue Zerg built a fifth drone, sent one to mine, then did nothing else.

I watched this for over forty five minutes and nothing changed. I've played and replayed this map, using the map settings, and the exact same sequence of events occur each time. I have AI scripts running for each of the computer forces. They are set to Expansion Campaign Insane. I've checked all my locations and all my triggers and everything appears to be in correct working order.

I've made similar maps in the past and never had a problem like this! I've tried everything I can think of, if anyone has any ides they would be greatly appreciated!! Thanks! :)



None.

Jun 15 2010, 7:44 pm DavidJCobb Post #2



I think Expansion Campaign Insane is meant to be used in expansions (expos) -- that is, secondary bases. Try running an Area Town script at a location.



None.

Jun 15 2010, 7:58 pm kennedy_m Post #3



Ok, I'll try that... I've run other maps with the expansion campaign and they've worked fine... The computer builds up and then attacks like crazy.

I also tried running just custom level AI scripts, and the exact same senario occurs. >:(

EDIT:
The reason I've been using the Expansion AI scripts is because this map makes use of terrain only available in Brood War, as well I'm also making use of medics for the Terrans.

Post has been edited 1 time(s), last time on Jun 15 2010, 11:23 pm by NudeRaider. Reason: merged posts



None.

Jun 15 2010, 8:08 pm Aristocrat Post #4



Quote from kennedy_m
The reason I've been using the Expansion AI scripts is because this map makes use of terrain only available in Brood War, as well I'm also making use of medics for the Terrans.

"Expansion" is melee terminology for creating a new base; all BW AI Scripts are labeled "Brood War".



None.

Jun 15 2010, 8:14 pm kennedy_m Post #5



Oh, okay. This is slowly starting to make sense. As you can tell I'm sill trying to get a handle on the basics!

So would I want to run a Zerg Campaign Insane, or a Zerg custom level? (At their starting base) I want my opponents to be as difficult as possible.

According to the Help Guide within the editor, the Expansion predicate for the AI scripts simply enables them to utilize the new units includes in Brood War. :wtfage:

What I still don't understand the most is why the computer forces only send one drone or probe to mine, when they have four available to use. And they don't build anything even though they have the resouces to do so!

Post has been edited 1 time(s), last time on Jun 15 2010, 9:01 pm by FaRTy1billion. Reason: Please use the edit button (far right below the post) instead of



None.

Jun 15 2010, 8:41 pm DavidJCobb Post #6



Well, IIRC Campaign scripts were meant to be beatable. They respond "lazily" to attacks, letting the player get kill a few units, break a few buildings. They also don't tend to build very much, nor do they try to advance up the tech tree. A full reference for all Campaign AI scripts can be found on the site's old wiki.

Melee scripts, on the other hand, want to beat the player; they will build, they will expand, and they will advance up the tech tree. They will also actively attack the player, however, and this may not be what you want. The Insane script is particularly devious; it "cheats" and gives itself a few thousand minerals every time it runs low.

Custom AI scripts are supposed to work with whatever they're given, though this is obviously not foolproof when you consider the variety of situations an AI might find itself in, when used in a UMS map.

If none of those work, try posting the map here. Maybe one of the more experienced mappers here can find a specific issue with it.



None.

Jun 15 2010, 8:47 pm kennedy_m Post #7



Ok so I changed all the AI scripts to either Protoss custom level or Zerg custom level. I didn't kill the yellow Zerg this time, I'm playing right now and watching what happens.

So far both Protoss teams have one probe each mining and are doing nothing else.
The yellow Zerg have built two hatcheries and the orange Zerg have also built two hatcheries.
The Blue Zerg have built a second hatchery, one drone is mining and the rest are wandering around like idiots.
The Protoss's extra probes aren't even moving.
Not a single vespane geyser has been built either.

Also: the computer teams don't attack each
other, but they aren't set as allies... They should all be enemies, or so I thought...

I know I'm probably asking what seem to stupid question to experienced users, but I'm just starting and I want to be able to understand an do this well, so any and all help is greatly appreciated! ^^

EDIT:
Ok so a melée script is what I'm looking for then. The list of ai script in the editor doesn't have anything like that as an option what should I be looking for?

Post has been edited 1 time(s), last time on Jun 15 2010, 11:36 pm by NudeRaider. Reason: merged posts



None.

Jun 15 2010, 9:08 pm Aristocrat Post #8



Quote from kennedy_m
Ok so a melée script is what I'm looking for then. The list of ai script in the editor doesn't have anything like that as an option what should I be looking for?

"Custom Level" means Melee.



None.

Jun 15 2010, 9:16 pm kennedy_m Post #9



Thanks! Hahaha :D

So I set them to melée or custom level, played the map, and half an hour later the damn computer forces still haven't done anything! They have no troops no defenses, and I have a full army, mined to vespene geysers to depleted, and mined my entire mineral field. I could wipe them all out in under five minutes, but that's no fun!



None.

Jun 15 2010, 11:30 pm marsh24 Post #10



For the computer units not attacking each other, all computers are allies by default, even if they are in separate forces. To make them enemies, first they must be in separate forces and you have to use the set ally status trigger action for each player. For example, if you want P1 and P2 to be enemies from the start of the map, you would run for P1:

Conditions:
Always
Actions:
Set Player 2 to enemy.

as well as a similar trigger for P2. As an aside, you use this same trigger action to get a computer to ally with a human.

As far as your AI troubles go, you should ensure that the computer's race as set in in the map description section in SCMDraft (or in player settings in Staredit) coincides with the buildings you have given them as well as with the AI script you have assigned. In your case it sounds like you've definitely checked the AI matches the buildings, but you should check the first point.



None.

Jun 16 2010, 8:15 pm Positively Post #11



Have you got a location over the area you want them to activate the AI Script? :P. Might be it, dunno though. And make sure the AI scripts match the race/player.



None.

Jun 17 2010, 2:42 pm kennedy_m Post #12



One last question lol...
Why doesn't the Campaign Editor let me run more than one Campaign Insane script? Like one for the Zerg and one for the Protoss? When I run two, the computer forces only mine and don't build anything, but as soon as I disable one of the triggers running one of the AI scripts, the other computer force builds like it should.
What can I do to solve this problem? I'm looking to create two computer forces that will be very challenging to defeat.


I just tried running a campaign insane ai for the Zerg and a custom level for the Protoss but they're just mining and not building anything! What am I missing or doing wrong?

This is the same problem I keep running into in my maps... I've been able to create single player maps against one computer opponent, but as soon as I create multiple computer forces and run more than one AI script, all the computer players mine only and don't build anything! How can I create multiple computer opponents that all start with the basic main building and a couple mining guys, that will expand, build a town, and attach the human player?

Post has been edited 2 time(s), last time on Jun 17 2010, 2:59 pm by kennedy_m.



None.

Jun 17 2010, 2:52 pm Biophysicist Post #13



If you want challenging computer forces, and this is a single-player map, you can mod aiscript.bin. It's not too hard if you're willing to give the AI bonus resources, though non-cheating AI are a lot harder. Or you might be able to use one of the scripts from BWAI, assuming you can get permission. (Though, writing your own - or getting me to do it :awesome: - would probably be better, because it gives you finer control over what the AI does than just using a copy of someone else's script.)

EDIT: MSN me if you're interested. tassadarzeratul@live.com



None.

Jun 17 2010, 3:24 pm kennedy_m Post #14



And whatcan I do I I way the computer force(s) to target a specific building that is under human control? I tried the kill trigger, but that just instanty kills the unit, instead of the computer building up a base, building an army, attacking the human player, and targeting that specific builing during the attack. Is something like this possible to do?



None.

Jun 17 2010, 3:40 pm Biophysicist Post #15



Good question. There are two ways that I see. One, make everything else invulnerable. >.> Two, use a mod with a plugin that gives you that level of trigger control over units. That's probably the best way, but plugins will cause the game to explode if you play on the wrong patch and are hard to learn (unless you already know C++ - I do and am willing to write it for you if you go that route).



None.

Jun 17 2010, 6:48 pm Azrael Post #16



Quote from kennedy_m
the computer building up a base, building an army, attacking the human player, and targeting that specific builing during the attack. Is something like this possible to do?
Yes, it's pretty easy to do actually.

First, you need to find the conditions you want to use. You could use "Elapsed time" if you know what time you want the computer to attack, or you could use "Brings" with a location at the player's base to determine when the computer is attacking, or you could use "Commands" and force the computer to attack when it commands a certain number of some unit. The conditions are up to you, you can initiate this during an actual attack or force the computer to attack.

As for the actions, there are 2 ways to do this depending on how you want the computer to act while it targets the building. In these triggers, Player 1 is the human player and Player 8 is the computer. Make sure you run them for the computer player.

1) Computer focuses on the building and ignores everything else:

-Enable invincibility for All [any unit] owned by Player 1 at Anywhere.
-Disable invincibility for Target Building owned by Player 1 at Anywhere.
-Run AI script: Send all units on random suicide missions.

Then have a short delay, and Disable Invincibility for All [any unit] owned by Player 1 again. If you do this quickly enough, the player will never notice they had invincibility. The computer units will already be locked onto the "target building" and will ignore everything else it comes across, even if it's being attacked.

2) Computer targets the building but also attacks everything on the way:

For this, just center a location on the "target building," and

-Issue Order to All [men] owned by Player 8 at Anywhere: Patrol to Target Building.

You can make multiple ones if you don't want it to affect other units, such as

-Issue Order to All Zerglings owned by Player 8 at Anywhere: Patrol to Target Building.
-Issue Order to All Hydralisks owned by Player 8 at Anywhere: Patrol to Target Building.
-Issue Order to All Guardians owned by Player 8 at Anywhere: Patrol to Target Building.

You can use either of these methods to direct the computer's attack to a specific building.

Post has been edited 2 time(s), last time on Oct 12 2010, 12:11 pm by DevliN. Reason: Mineral abuse.




Jun 17 2010, 6:57 pm Biophysicist Post #17



That's what I meant by "make everything invulnerable" (though I guess it's rather not obvious from that).

I still say modded AI script ftw: You can make a much deadlier AI than normal using modding.



None.

Jun 17 2010, 7:05 pm Azrael Post #18



Yeah, people can make some beasty scripts. I don't have any experience with that though ^^

Post has been edited 2 time(s), last time on Oct 12 2010, 12:11 pm by DevliN. Reason: Mineral abuse.




Jun 17 2010, 7:12 pm Biophysicist Post #19



Neither do I, but if someone gave me a build order (or build orders) to base a script off of, that would be a different story.



None.

Jun 17 2010, 8:59 pm kennedy_m Post #20



Wow guys, thanks for the help! :) I can't wait to get
home and try tha stuff out. Hopefully I have some luck! Lol

Does anyone know why I can't seem to run two AI scripts at the same time?



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[03:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[01:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[01:52 am]
Vrael -- hah do you think I was born yesterday?
[01:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: Roy, jjf28, l)ark_ssj9kevin, O)FaRTy1billion[MM], lil-Inferno