View Full Version : Question about AI burrowing...
Dwebtron
06-03-2007, 10:56 PM
Is it possible (and if so how) to make an AI script that makes a zerg unit burrow.
A Zerg ai unit will always burrow while still if it has the ability researched.
Dwebtron
06-04-2007, 3:20 PM
I don't think I asked the question the right way, What I mean to ask is if a player owns the zerg unit.... How can I keep that unit burrowed? It's similar to how there is the computer AI trigger to keep marines / ghosts in a terren bunker so that the player can't take them out. Is this possible? To keep zerg units burrowed with a trigger of sorts?
matefkr
06-04-2007, 3:34 PM
in several way, but the question is whats it for?
One way: Give it to a neutral player and make shared vision with this neutral player (use turn on shared vision for "humanplayer" in a trigger of that neutral player).
Dwebtron
06-06-2007, 10:50 AM
well, the reaoson I ask is because i'm creating a map where units are 'buyable' in a type of defense formation. I want to be able to use lurkers, but I don't want the player being able to move them. In this regard, i was hoping to be able to limit the ability of the player to 'unburrow' the lurkers.
NeutronHInc
06-06-2007, 4:36 PM
Okay, this is how I did it for an old lurker defense map I did... (using SCMDraft) (Please note that I used Player 8 for the Hypercheck trigger so everything would fire off instantly)
I simply made it four lanes. One lane for each of the four human players.
In each lane I placed 60 locations. 30 1x1 locations and 30 3x3 locations in the following pattern, e = 3x3, a = 1x1 and - = a 1x1 empty tile.
eee-eee-eee-eee-eee
eae-eae-eae-eae-eae
eee-eee-eee-eee-eee
---------------------
eee-eee-eee-eee-eee
eae-eae-eae-eae-eae
eee-eee-eee-eee-eee
---------------------
eee-eee-eee-eee-eee
eae-eae-eae-eae-eae
eee-eee-eee-eee-eee
---------------------
eee-eee-eee-eee-eee
eae-eae-eae-eae-eae
eee-eee-eee-eee-eee
---------------------
eee-eee-eee-eee-eee
eae-eae-eae-eae-eae
eee-eee-eee-eee-eee
---------------------
eee-eee-eee-eee-eee
eae-eae-eae-eae-eae
eee-eee-eee-eee-eee
Also, for each lane there were three other locations. One that covered the WHOLE lane, one at the top to spawn the enemies and one at the bottom for the enemies to move to and be killed. So, I used up 252 of the 256 locations. :o
Now, this was the tricky part...
For every 10 kills a player got (up to 250 since they started out with 5 lurkers) they would suffer a Death of a Civilian.
For each civilian death suffered two switches would be set, say P1Lurk1 and P1KillLurk1. The triggers would look like...
Conditions:
Player 1 suffers exactly 1 death of Civilian
Actions:
Set P1Lurk1
Set P1KillLurk1
Conditions:
Player 1 suffers exactly 2 death of Civilian
Actions:
Set P1Lurk2
Set P1KillLurk2
Now, once those two switches are set, this is the trigger I had set up...
Conditions:
P1Lurk1 is set
P1KillLurk1 is set
Player 1 brings exactly 0 lurker to P1L1
Player 1 brings exactly 0 lurker to P1KL1
Actions:
Create 1 lurker for player 1 at P1L1 Apply Properties: Burrowed
Preserve trigger
Now, this is where the two locations come into play...
Each lurker was created burrowed at the location I wanted them to stay at, lets say P1L1 and P1KL1. This is how I got them to stay burrowed...
Conditions:
Player 1 brings exactly 0 lurker to P1L1
Actions:
Kill all lurker for player 1 at P1KL1
Preserve trigger
The end result was the fact that once you unburrow and move the lurker from its place, it would die that second and another one replace it, burrowed obviously.
The down side, doing it this way I used up almost all locations and switches, but it worked exactly the way I wanted it to.
Maybe it will work for you as well.
If you have any questions, feel free to ask me. I know just about everything about SC mapping.
Dwebtron
06-06-2007, 4:46 PM
Correct me if i'm wrong, but isn't the downsides with that is that yours works as long as there is only one lurker in said location? I plan to have 25 at the same location. It is my understanding that if I implement your solution, they could unburrow 24 of them before the kill and recreate consequence is triggered?
However, I am thinking about using the dual locations in a way where if they unburrow (since i plan to stack all 25 lurkers in one location) if the count of lurkers decrease from 25 to kill them all and re-create them.... is that the message you were trying to convey? lol i'm so confused. (did this sound arrogant? it wasn't ment to be...)
- thanks for the help
NeutronHInc
06-06-2007, 5:32 PM
Correct me if i'm wrong, but isn't the downsides with that is that yours works as long as there is only one lurker in said location? I plan to have 25 at the same location. It is my understanding that if I implement your solution, they could unburrow 24 of them before the kill and recreate consequence is triggered?
However, I am thinking about using the dual locations in a way where if they unburrow (since i plan to stack all 25 lurkers in one location) if the count of lurkers decrease from 25 to kill them all and re-create them.... is that the message you were trying to convey? lol i'm so confused. (did this sound arrogant? it wasn't ment to be...)
- thanks for the helpNo, didn't sound arrogant. Like I said, if you had any questions, simply ask me, and you did just that. That is what I'm here for, to help fellow mappers. :D
Okay, if you want 25 at a location, heres how to do that...
Lurker Creation Trigger
Conditions:
P1Lurk1 is set
P1KillLurk1 is set
Player 1 brings at most 24 lurker to P1L1
Actions:
Create 1 Lurker at P1L1 for Player 1
Wait for 50 milliseconds
Preserve trigger.
What this does is it will create 1 lurker every second, if you don't use a hypercheck trigger, until there is a total of 25 at that location. That is how the "at most" works. If you want 25 lurkers at a location, you should enter one less then the total you want there. So 25 total lurkers would be at most 24. 50 Lurkers would be at most 49, and so on.
If you have the Hypercheck trigger in your map, it will create the 25 lurkers almost instantly. That is why I put the Wait for 50 milliseconds trigger in there, because I always use the hypercheck trigger in every UMS map I make. The wait for 50 milliseconds will be just enough wait time for the lurker to actually appear burrowed at the location before the next is created there. Some would argue that the wait is not needed, but it is better safe the sorry you know?
Lurker Kill Triggers
Conditions:
P1Lurk1 is set
P1KillLurk1 is set
Player brings at least 1 lurker to P1LurkerBorderTop1
Actions:
Kill All lurker for Player at P1KillLurkers
Preserve trigger
Conditions:
P1Lurk1 is set
P1KillLurk1 is set
Player brings at least 1 lurker to P1LurkerBorderBottom1
Actions:
Kill All lurker for Player at P1KillLurkers
Preserve trigger
Conditions:
P1Lurk1 is set
P1KillLurk1 is set
Player brings at least 1 lurker to P1LurkerBorderLeft1
Actions:
Kill All lurker for Player at P1KillLurkers
Preserve trigger
Conditions:
P1Lurk1 is set
P1KillLurk1 is set
Player brings at least 1 lurker to P1LurkerBorderRight1
Actions:
Kill All lurker for Player at P1KillLurkers
Preserve trigger
Now, this is the easiest way to do it. You have a total of SIX locations for each spot the lurkers will be.
As for the location sizes...
P1L1 is the first location, this is where they will be spawned. It should be 1x1 in size. For the border locations, the Top and Bottom should be 1x3, the Left and Right should be 1x1 in size, and the P1KillLurkers should be 5x5 to 6x6 in size. Heres how I would set them up... e = border locations, o = KillLurkers, a = P1L1
ooooo
oeeeo
oeaeo
oeeeo
ooooo
Note, that is just an example. As long as you use a Hypercheck trigger, any lurker that comes to any of the border locations will kill all the lurkers instantly. THEN, as soon as there is less then 25 lurkers there, the creation trigger will fire up again and put them all back instanly.
The main thing I suggest to all mappers, create a small demo map for the trigger you want to do. Test it, if it doesn't fire right, tweak the triggers until it goes off just the way you want it to. I've done it since I started making maps back in '99.
If you can't get the triggers to work for you in the demo map, upload it here and I'll see what I can do for you.
Hope that helps ya. :cool:
Dwebtron
06-06-2007, 6:42 PM
hmm. I made the test map to try out what you told me, but I donno if i did something wrong or not. I suppose i obviously did, if i can't get it to work.... Since I'm new to warboards, how would I post the test map so that you can see for yourself?
NeutronHInc
06-06-2007, 7:17 PM
hmm. I made the test map to try out what you told me, but I donno if i did something wrong or not. I suppose i obviously did, if i can't get it to work.... Since I'm new to warboards, how would I post the test map so that you can see for yourself? Under where you type in your post is "Additional Options" and in there is a button "Manage Attachments". Click it, browse to where the demo map is, upload and hit Submit.
Easy as pie my friend. :D
Or find me on AIM, MSN, Yahoo, or ICQ and send me the map that way...
AIM - NeutronHInc
MSN - NeutronHInc@adelphia.net
Yahoo - neutronhinc
ICQ - 232779191
Dwebtron
06-06-2007, 7:39 PM
here's the test map i made, and i know i did SOMETHING wrong...
Dwebtron
06-11-2007, 5:18 PM
i guess i'm gunna bump this?
NeutronHInc
06-11-2007, 5:45 PM
Sorry about taking a while to get back to you, been a little busy, but I'm back to help you figure this out...
Okay, first thing you need to do is download SCMDraft 2 0.8.0 (http://www.stormcoast-fortress.net/cntt/software/scmdraft/download) and use SCMD from now on. I am going to assume for this post that you haven't used SCMD yet. So if you have, you'll already know what I'm going to post here. lol
When you open SCMD for the first time, it may seem overwhelming, but it will get easier as you work in it more. SCMD has many features that you will find very handy. First of which is the fact you can zoom in and out to see the map more or place units in a tight spot. It does isometric(normal StarEdit type) terrain and square. It uses two types of trigger editors, the classic version like StarEdit's, but you can do far more with it like you can in x-tra editor and a more text based trigger editor, I recommend you stay clear of it because it is a little buggy at times. The grid, can be any size you want it to be, it has five "default" sizes and a 6th that you can customize to your heart's content, though I've never had to use the custom. I mainly use Normal and Fine grid. Making locations in SCMD is better then ANY other editor out there, you can make them ANY size you want, as you will see when you open the "test.scx" I've fixed for you(I'll upload it with this post).
Okay, enough about the features, you can find the rest yourself and have some fun with it.
Now, open the "test.scx" in SCMD. You will notice right off that the locations have been changed, they are 1x4 and 4x1 Normal Grid, but placed using Fine Grid. This is how you should place the locations in your map. It works perfectly.
Also, in the Classic Map Triggers under Force 1 I left a note, it is to explain the "Hypercheck trigger" (found under Player 2) that most maps use these days. You should use this trigger in your map since the test map works flawlessly with the Hyper in it.
I hope this post helps and you find the changes to the test.scx map insightful.
Again, if you have any questions, feel free to ask me, I'm sure I'll know the answer. :)
Cheers! :cool:
Dwebtron
06-12-2007, 8:30 PM
alright cool, thanks. That acctually answered a bunch of questions, except now I've come up with another. This one I've been workin' on but I'm just at a loss of the best way to make this work.
I know what I want to happen, I just don't know how to get it working 'under the hood'. I want a nuclear strike to be 'buyable'. The player will have ghosts already, so all they would have to do is say... move a civilian to a beacon and get a command center, use a nuclear missile, then return the control of the command center to the computer. The computer would then rebuild the nuke, and make it buyable again. I've been able to do everything, except I can't seem to find a reliable way to get the command center to be returned to the computer once the nuke goes off. This might be a dumb question, but I'm stuck on it :(
Thanks a lot for all your time, by the way. I also love that editor (I've been using the "Starcraft 'X-tra editor'")
NeutronHInc
06-13-2007, 4:36 PM
alright cool, thanks. That acctually answered a bunch of questions, except now I've come up with another. This one I've been workin' on but I'm just at a loss of the best way to make this work.
I know what I want to happen, I just don't know how to get it working 'under the hood'. I want a nuclear strike to be 'buyable'. The player will have ghosts already, so all they would have to do is say... move a civilian to a beacon and get a command center, use a nuclear missile, then return the control of the command center to the computer. The computer would then rebuild the nuke, and make it buyable again. I've been able to do everything, except I can't seem to find a reliable way to get the command center to be returned to the computer once the nuke goes off. This might be a dumb question, but I'm stuck on it :(
Thanks a lot for all your time, by the way. I also love that editor (I've been using the "Starcraft 'X-tra editor'")Well, giving a Nuke that's owned by one player to another player is a very tricky thing, and I've never been able to pull it off right. For some reason, no matter what trigger you use, the Nuke that has been built will remain owned by the player that created it, even if another player owns the CC+Silo for a short time. So any kills by the Nuke will goto the player that originally created it.
Swapping buildings though is easy. I've uploaded a map that I think is exactly what you need. Play it in Multi-Player - Local Area Network (UDP). I always test my maps this way.
I hope this helps you.
Don't worry about it man, that's what I'm here for, to help you out. :D
Cheers! :cool:
Dwebtron
06-14-2007, 12:04 PM
Acctually, I had an idea that I believe would make it not matter. Since in the test map, the nuke is blue, couldn't you transfer the kills that blue gets to whatever player dropped the nuke?
I tried to modify it so that this would happen, but needless to say i'm dumb and couldn't figure it out.
I tried "player 2 kills at leats 1 Bengalaas (and any unit) - > modify score for p1: add 1 kill, modify score for p2: subtract 1 kill, preserve trigger"
Is there somethin' I did wrong?(trigger was active for player 1 and 2)
Also, is it possible for the game to distinguish which player dropped the nuke so that it could give that player the kills earned by the computer's nuke?
NeutronHInc
06-14-2007, 8:11 PM
Acctually, I had an idea that I believe would make it not matter. Since in the test map, the nuke is blue, couldn't you transfer the kills that blue gets to whatever player dropped the nuke?
I tried to modify it so that this would happen, but needless to say i'm dumb and couldn't figure it out.
I tried "player 2 kills at leats 1 Bengalaas (and any unit) - > modify score for p1: add 1 kill, modify score for p2: subtract 1 kill, preserve trigger"
Is there somethin' I did wrong?(trigger was active for player 1 and 2)
Also, is it possible for the game to distinguish which player dropped the nuke so that it could give that player the kills earned by the computer's nuke?Well, I did some messing around, you can give nukes to other players. I completely forgot about that. The catch is, you will need a CPU for each human player though...
Players:
Player 1
Conditions:
Player 5 commands at least 1 Nuclear Missile.
Actions:
Give All Nuclear Missile owned by Player 5 at 'Anywhere' to Player 1.
Preserve trigger.
Players:
Player 2
Conditions:
Player 6 commands at least 1 Nuclear Missile.
Actions:
Give All Nuclear Missile owned by Player 6 at 'Anywhere' to Player 2.
Preserve trigger.
Players:
Player 3
Conditions:
Player 7 commands at least 1 Nuclear Missile.
Actions:
Give All Nuclear Missile owned by Player 7 at 'Anywhere' to Player 3.
Preserve trigger.
Players:
Player 4
Conditions:
Player 8 commands at least 1 Nuclear Missile.
Actions:
Give All Nuclear Missile owned by Player 8 at 'Anywhere' to Player 4.
Preserve trigger.
That is all you need to add. Obviously, you need each CPU to have a CC+Silo. Also, for each CPU, you need to make a "build nuke" trigger for only that CPU.
I've updated the map to show this... (hit yes when it asks if you want to overwrite it)
Hope that helps...
Cheers! :cool:
Dwebtron
06-16-2007, 1:09 PM
Hum. While it does help, it also doesn't. I was hoping to only use two cpu's and have six players... Is there a way to transfer the kills earned by the nuke to the player that launched it?
NeutronHInc
06-16-2007, 3:21 PM
Hum. While it does help, it also doesn't. I was hoping to only use two cpu's and have six players... Is there a way to transfer the kills earned by the nuke to the player that launched it?At this time, with the limitations in the way triggers work, not really. There is no trigger that tells the game who launched what.
Sorry dude. I hate the game's limitations.
The only other way to pull off what you want is to give each player a CC+Silo somewhere on the map and make the Nuke cost whatever you want it to cost. Just make sure the build time is 1 so it builds almost instantly.
That reminds me, don't set ANY unit/building's build time to 0, I've noticed that in patch 1.15 that if a unit's build time is set to 0, it crashes the game. You can however set Upgrade research time to 0 without the game crashing.
Dwebtron
06-18-2007, 1:09 AM
Hmm. Ok, thanks I'll try to find a workaround. If I can't, I'll just toss the entire idea of nukes. Now, I have a few questions about hyper triggers, now that I'm messing around with them... If you accidently (forgot) put a 'wait' trigger on the computer player with the hyper triggers on, what would happen? would they be negated? Also, is it possible to turn hyper triggers on and off with a switch?
... Now, I have a few questions about hyper triggers, now that I'm messing around with them... If you accidently (forgot) and/to put a 'wait' trigger on the computer player with the hyper triggers on, what would happen? would they be negated? Also, is it possible to turn hyper triggers on and off with a switch?
I really need to know which one of those that have added in red on your quote you forgot.
1st - If you forgot "and put a wait block on the triggers" for that player then the hypers won't work.
2nd - But if you forgot "to put a wait block on the hypers" they might not work that well since the other triggers for the hyper have different amounts of those.
And yes, you can have hypers enabled/disabled with a switch. Just bear in mind that all switches in the map start off when it's being played because that might infer with the aim you're intending. ;)
Dwebtron
06-18-2007, 7:20 PM
it was to, but it helps to have the extra knowledge anyway! hahaha thanks guys!
I have another question. (I'm filled with them)
Is there a way to make creep disappear? That is, if there is a sunken colony there is it possible to make it go away while the colony is still there?
NeutronHInc
06-19-2007, 1:51 AM
it was to, but it helps to have the extra knowledge anyway! hahaha thanks guys!
I have another question. (I'm filled with them)
Is there a way to make creep disappear? That is, if there is a sunken colony there is it possible to make it go away while the colony is still there?Nope.
The only way to have no Creep is to pre-place the Zerg building on an "non-build-able" location, such as Rocky Ground, in an editor that allows such placement, SCMDraft for one.
Oh, and since you may ask what I think you will ask next, no, buildings cannot be placed on "non-build-able" terrains by using triggers.
Dwebtron
06-20-2007, 8:45 PM
hahahah thanks guys, especially for the answer before i asked. :) I guess if I come up with any other questions I'll post them here? Thanks alot!
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.