Hello, my name is St3alth95, and I am working on creating my first ever map.
I've done some very basic programming before, so I understand the very basics (what a variable is, what a function is, etc), but I am completely new to the Starcraft II editor.
I am going to explain what I want to try and accomplish with triggers, and the answers I am looking to receive are not so much copy-and-paste in nature but more of an explanation of the concept behind the code.
First off, I'd like the players in my map to start off on a small island with one unit and a dropship. The first question I have is, in what way do I create a trigger so that only players in the game would be spawned units? (For example, if 5 people were playing, only 5 units and 5 dropships would spawn.)
After they have spawned, the players load their unit into the dropship and set off around the map looking for a base. The bases will all start neutral, and I want the player's to be able to purchase a base. I theorize that they could move the unit they have into a region around the base and then be granted control of the base, or the base itself could be modified so that it could be selectable and had a purchase ability which would require minerals.
Once a player has taken a base, I would like the base to automatically spawn units once every 60 seconds. For example, one base could spawn 2 marines and a firebat, every 60 seconds. Ideally, the spawns would be upgradeable through research at the base. After the first research, the spawn could increase to 2 marines, a firebat, and a marauder.
I would like the method of obtaining a base to be coded in such a way that the players could create another unit for a price from the base they currently own and send it to another neutral base to buy it as well.
Also, the method of obtaining minerals would be through bounty. The units would grant varying levels of minerals based on how strong they are, such as 5 for a zergling and 20 for a marauder.
Once again, let me state that this is my first time experimenting with the Starcraft II editor, so as much thoroughness as possible in replies would be appreciated.
I'm not going trough things thoroughly because it seems you haven't been exploring the editor much, and im not very pro with the editor myself but...
Here are some short answers to your questions, i hope it helps a little.
btw, it isn´t all coded, you can do a lot of stuff with the data editor.
I theorize that they could move the unit they have into a region around the base and then be granted control of the base, or the base itself could be modified so that it could be selectable and had a purchase ability which would require minerals.
You could either have a player gain control by moving near the unit or you could have an ability or whatever that modify´s the owner.
Once a player has taken a base, I would like the base to automatically spawn units once every 60 seconds. For example, one base could spawn 2 marines and a firebat, every 60 seconds. Ideally, the spawns would be upgradeable through research at the base. After the first research, the spawn could increase to 2 marines, a firebat, and a marauder.
Make it so that the base has a train ability for the units, make the train ability like 60 secs, make the unit autocast it.
I would like the method of obtaining a base to be coded in such a way that the players could create another unit for a price from the base they currently own and send it to another neutral base to buy it as well.
Just make the base be able to spawn a specific unit for the same cost as the base, make the unit able to capture base(many ways to do this.)
Also, the method of obtaining minerals would be through bounty. The units would grant varying levels of minerals based on how strong they are, such as 5 for a zergling and 20 for a marauder.
just alter the field Combat: kill resource on the unit.
Thank you for the help! I now have the units spawning at the beginning based on the active players, but I have yet to figure out how to create an ability that changes the owner of a neutral building. If you could elaborate further it would be much appreciated.
Thank you for the help! I now have the units spawning at the beginning based on the active players, but I have yet to figure out how to create an ability that changes the owner of a neutral building. If you could elaborate further it would be much appreciated.
I've tried to solve the problem of changing the owner of a neutral builder by placing all the initial "Kings" that each player starts with in a unit group. If a unit belonging to this unit group enters a small region around a base, the unit is killed and the building changes owner. The problem I am having is in training new kings. I created an ability which I applied to each base to train another king for 150 minerals. The problem is, I would like to add these newly trained units to the unit group to which each king was added at the start, but I cannot figure out how.
you could make a trigger like this, dont know if its really efficient however it checks whenever a king is created and puts it in the specific unitgroup for the player:
Thank you for laying out the code for me! It seems my problem was I was using (Unit type of (Triggering Unit)) == King rather than Created Unit, so it was asking if my base was a king.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello, my name is St3alth95, and I am working on creating my first ever map. I've done some very basic programming before, so I understand the very basics (what a variable is, what a function is, etc), but I am completely new to the Starcraft II editor. I am going to explain what I want to try and accomplish with triggers, and the answers I am looking to receive are not so much copy-and-paste in nature but more of an explanation of the concept behind the code.
First off, I'd like the players in my map to start off on a small island with one unit and a dropship. The first question I have is, in what way do I create a trigger so that only players in the game would be spawned units? (For example, if 5 people were playing, only 5 units and 5 dropships would spawn.)
After they have spawned, the players load their unit into the dropship and set off around the map looking for a base. The bases will all start neutral, and I want the player's to be able to purchase a base. I theorize that they could move the unit they have into a region around the base and then be granted control of the base, or the base itself could be modified so that it could be selectable and had a purchase ability which would require minerals.
Once a player has taken a base, I would like the base to automatically spawn units once every 60 seconds. For example, one base could spawn 2 marines and a firebat, every 60 seconds. Ideally, the spawns would be upgradeable through research at the base. After the first research, the spawn could increase to 2 marines, a firebat, and a marauder.
I would like the method of obtaining a base to be coded in such a way that the players could create another unit for a price from the base they currently own and send it to another neutral base to buy it as well.
Also, the method of obtaining minerals would be through bounty. The units would grant varying levels of minerals based on how strong they are, such as 5 for a zergling and 20 for a marauder.
Once again, let me state that this is my first time experimenting with the Starcraft II editor, so as much thoroughness as possible in replies would be appreciated.
Thank you for your help.
@St3alth95: Go
Welcome to the forum.
I'm not going trough things thoroughly because it seems you haven't been exploring the editor much, and im not very pro with the editor myself but... Here are some short answers to your questions, i hope it helps a little.
btw, it isn´t all coded, you can do a lot of stuff with the data editor.
good luck
(Status of player 1) == Playing, the do some Actions.
or
Player Group - Pick each player in (Active Players) and do (Actions) Actions
You could either have a player gain control by moving near the unit or you could have an ability or whatever that modify´s the owner.
Make it so that the base has a train ability for the units, make the train ability like 60 secs, make the unit autocast it.
Just make the base be able to spawn a specific unit for the same cost as the base, make the unit able to capture base(many ways to do this.)
just alter the field Combat: kill resource on the unit.
Thank you for the help! I now have the units spawning at the beginning based on the active players, but I have yet to figure out how to create an ability that changes the owner of a neutral building. If you could elaborate further it would be much appreciated.
I've tried to solve the problem of changing the owner of a neutral builder by placing all the initial "Kings" that each player starts with in a unit group. If a unit belonging to this unit group enters a small region around a base, the unit is killed and the building changes owner. The problem I am having is in training new kings. I created an ability which I applied to each base to train another king for 150 minerals. The problem is, I would like to add these newly trained units to the unit group to which each king was added at the start, but I cannot figure out how.
@St3alth95: Go
you could make a trigger like this, dont know if its really efficient however it checks whenever a king is created and puts it in the specific unitgroup for the player:
@Rice87: Go
Thank you for laying out the code for me! It seems my problem was I was using (Unit type of (Triggering Unit)) == King rather than Created Unit, so it was asking if my base was a king.