Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Help with AI scripts
Help with AI scripts
Oct 28 2008, 10:44 pm
By: blupigan  

Oct 28 2008, 10:44 pm blupigan Post #1



hello i am making a map and i am doing the triggers backwards to ease in testing the map by myself. i finished terrain and such and now im doing the boss, i was the bsos to be a neutral animal unit that remains in the center of the boss's chamber with 8 invincible infested kerrigans that stand in a circle around the boss.

my problem is i want the kerrigans to remain in their spots until a unit enters the chamber then i want the kerrigans to chase the units down and kill them and then return to their spots. so you can tell how its supposed to function, you draw the kerrigans away from the center with sacrifice units and then attack the boss from the other side and repeat etc. i cant find an ai script that will make the kerrigans protect the area but not remain there indefinitely, i want them to be free moving but only in the presence of an enemy unit and after enemy units are no longer in the area i want them to go right back to their specific spot.

i am using scmdraft and i downloaded scSIedit III, i also have general mengsk XTRA edit.

is there any way to do this?

here is a screenshot of the chamber and the locations that id like the kerrigans to remain

Attachments:
Capture.JPG
Hits: 7 Size: 145.92kb



None.

Oct 28 2008, 10:50 pm Fisty Post #2



I believe that the default AI for Computer controlled units is that they will follow their target to an extent (their sight range I think), then they will go back to their starting spot.



None.

Oct 28 2008, 10:53 pm blupigan Post #3



so what ai script would i use to get them to return to their original spots. like i want the kerrigans to remake their circle even after attacking and killing units so as many times as you returned to the spot they would always return to the same circle shape



None.

Oct 28 2008, 11:23 pm blupigan Post #4



no i tried default ai script and also the value this area higher ai script and the problem is once the kerrigans move from their spot they remain in the spot that they finished the unit off in rather than return to their original spot



None.

Oct 28 2008, 11:37 pm poiuy_qwert Post #5

PyMS and ProTRG developer

Pretend it happens? When there are no enemies in the room remove the kerrigans and create new ones?




Oct 29 2008, 1:10 am Biophysicist Post #6



You could use the Order action instead of remove/create.



None.

Oct 29 2008, 1:45 am FatalException Post #7



I concur. Player (human) brings at least 1 [any unit] to boss location, Move location player to (unit) owned by Player (human), Order all Infested Kerrigan owned by player (enemies) at boss location attack to player, preserve trigger.
Player (human) brings at most 0 [any unit] to boss location, Order all Infested Kerrigan owned by player (enemies) move to kerrigan default location, preserve trigger.
No AI script involved. No reason to overcomplicate things.



None.

Oct 29 2008, 3:11 pm NudeRaider Post #8

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from name:Deathman101
I believe that the default AI for Computer controlled units is that they will follow their target to an extent (their sight range I think), then they will go back to their starting spot.
That is true, but not for heroes. Heroes always follow you around indefinitely and just stop if you teleported or died.
So he could take ultralisks for example instead of infested kerrigans.

Quote from FatalException
I concur. Player (human) brings at least 1 [any unit] to boss location, Move location player to (unit) owned by Player (human), Order all Infested Kerrigan owned by player (enemies) at boss location attack to player, preserve trigger.
Player (human) brings at most 0 [any unit] to boss location, Order all Infested Kerrigan owned by player (enemies) move to kerrigan default location, preserve trigger.
No AI script involved. No reason to overcomplicate things.
The problem with ordering is that it only works for all kerrigans to one location, instead of each of them to a different one.
You can solve that by following each of the kerrigans by a 1x1 pixel location.
The trigger for this is simple:

C: Always
A: Center 'pixel 1' on kerri at 'pixel 1'
A: Center 'pixel 2' on kerri at 'pixel 2'
A: ... etc. for all 8

You need hyper triggers for that.

Once that is done you can program your own little boss AI by using triggers. Some examples:

Your original request:
C: Player Force brings at most 0 men to 'boss'
A: Order Kerrigan at 'pixel 1' move to 'start kerri 1'
A: Order Kerrigan at 'pixel 2' move to 'start kerri 2'
A: ... etc. for all 8

Prevent players from splitting forces and attack undefended rear:
C: Player Force brings at least 1 men to 'north entrance'
C: Computer defender brings at most 1 kerrigan to 'northern hemisphere' *)
A: Order Kerrigan at 'pixel 1' move to 'start kerri 1'
A: Order Kerrigan at 'pixel 2' move to 'start kerri 2'
A: ... etc. but only the 4 kerris that originally started north of the boss
*): Make 2 extra locations covering the south and north half of the boss


A trigger set to stop kerrigans from going too far, without ordering all of them back:
C: Always
A: Subtract 1 from death count timer

C: Computer defender brings at least 1 kerrigan to 'outside boss' *)
C: Death count timer is at most 0
A: Create 1 burrowed ling at 'pixel 1'
*): This location is slightly larger than 'boss'

C: Computer defender brings at most 0 lings to 'boss'
C: Death count timer is at most 0
A: Order kerrigan at 'pixel 1' move to 'start kerri 1'
A: Set death count timer to 8
A: Remove all lings for Computer defender

C: Computer defender brings at least 1 lings to 'boss'
C: Death count timer is at most 0
A: Remove all lings for Computer defender
A: Create 1 burrowed ling at 'pixel 2'

C: Computer defender brings at most 0 lings to 'boss'
C: Death count timer is at most 0
A: Order kerrigan at 'pixel 2' move to 'start kerri 2'

... etc. there's always one trigger creating a ling and another checking where that ling is.
As you can see I put together the "no ling found at this location"-trigger and the "create ling for next kerri if ling was not found"-trigger. Ofc you will need to do them for all 8 kerris.
I added a death count timer condition so that if one kerri is found outside she's not ordered back all the time, as this would slow down lower numbered kerris. (constantly creating burrowed units under a unit slows it down.)

These are only a few examples of what you can do with that method. You could also add a 2nd, larger location following each kerri to detect if this kerri is currently engaging an enemy. The possibilities are endless. The more effort you put into triggering the more intelligently your boss will fend off the attackers.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
Please log in to shout.


Members Online: O)FaRTy1billion[MM]