I believe Blizzard does most of their development in a windows environment, so they just natively expect crlf. I wouldn't be surprised if this changes due to their statement that they intend to get the editor working in the mac environment
There is not technical limit. WC3 had a system where it would prioritize pathfinding for each unit, so that when you had more units then what you could process in a frame, units waited until the processor could handle their pathfinding code. Initially, this didn't matter as graphics capabilities were far behind pathfinding capabilities, but, now WC3 renders pretty quickly with an 8800.
Right now, we are at that point with sc2 where pathfinding code is faster than graphics processing. It starts to visually lag before we have any problems with pathfinding, making the frames take more time anyway. Granted, this limit is 1000+ units on my computer, and my friends is close to 2000 units or more.
Simply, without a supercomputer, I don't think we can hit the limit yet.
There is no way to event for items being picked up or equiped. This is highly annoying as I want to add/remove behaviors on items that are in the inventory
Here is an odd bug. When you pick up an item off the ground, and it has a behavior on it, that behavior remains in effect while the item is in your inventory.
For example, if you give an item a timed life of 60 seconds, after 60 seconds, that item will die. There seems to be no way to remove a behavior when it goes into your inventory.
You still have the issue where the camera pans when you rotate it, Which is what I limited with the restricting camera bounds. I guess it's just a bug that blizzard has to fix.
Great tutorial! I still got one question though. When you want to attack and you keep clicking the mouse button it just does the animation over before letting the previous one finish.
How to solve this?
Another thing, if I remove the Attack button it will run away when hit.
The running away is a default behavior of an idle unit. Fixing that was beyond the scope of the tutorial, but you have to go into the data editor and clear that behavior. As for waiting for the animation to finish, there is no way to get the time of the animation or whether or not the model is doing a certain animation, so no. You could, however, look at how long the animation plays, and limit executing that attack trigger until the animation time has passed since you last attacked.
But this doesn't work as there is no unit group created, I think. Therefore, following the Trigger editor this can't even be done.
Would love to see a working version.
The function you need is Player Group from Player(). The trigger text I used is not very clear on this, so I will go through today and fix the 3 instances I turn Players into PlayerGroups.
The map I made while building this tutorial is linked at the very top of the page, so you can use that to compare.
While there is no built in solution, I know you can get the pitch as a Real, and then clamp it to a certain value. I don't know if you can set the pitch exactly, but, poke around
Great, guide! However, you don't need to set the camera bounds. If you take out "set camera bounds" when you set the camera and in "update camera" "camera follow for player 1" will auto follow the player without the jumpy animation.
So, after playing around with it, I can't get it working as you describe. The camera still pans with mouse relative mode on.
This is an advanced article on creating 3rd Person Control system. It assumes you know how to use the Trigger editor and some basics navigating the Galaxy Editor. You can download a working version of the 3rd person controls here: http://dl.dropbox.com/u/1940586/sc2-3psmovement-tut/ZerglingZapTut.SC2Map
Before We Trigger
We need a Unit to control, and for this tutorial, I will use an Archon. While much of the tutorial is unit independent, when we get to attacking, we will use the Archon attack for damage dealing, and other units don't have that.
So, Create an Archon for Player 1 in the center of the map. Also, create a circle region with the radius of 0.25 named CameraView
And then he said: Let there be Triggers
So, we got our Archon and our small area, Lets get crackin. Open up the Trigger editor and delete that pesky Melee Initialization trigger. Let's create a global variable that is of type Unit. I'm going to name it Player, and set it to our Archon. Also, I'm a fan of organization, so lets create a new folder in your Trigger Editor and name it Init. In this folder, we will put all of our initialization triggers.
Create a new Trigger named Init3ps. The Event will be (gasp) Map Initialization. For the actions, we have:
And run the map. You should now be looking at your Archon in 3rd Person mode! YAY!!!!! WOOP!!!
Tasty Trembling Triggers Rotating Round Rhombuses
Now we are going to have some fun with Movement. And by fun, I mean actually do it. Again, I like organization, so we are going to create TWO folders this time, One named 'Update' and the other named 'Movement'
Inside of Update, we will make a new Trigger named UpdateCamera. This trigger will keep the camera bounds correct while we move our unit, since the camera bounds will not follow a moving region for some reason. TBH, it feels like a bug, so I made this in a separate trigger from other update functions, so that if they fix the bug, we can quickly delete this part.
Create a Trigger in the Movement Folder named MoveForwardKeyDown. This is when you press the W key, you move forward. This is code roughly based on someone else's project, but I don't remember who. This is the most involved trigger here. The Move Order is fairly specific, and you need to make sure you use the function IssueOrderTargetingPoint
Triggering a move is great, now lets Trigger a WARRRRRR
Right, so we have movement and looking done, lets do some Awesome ATTACKING! RAAAAHHH ARCHON ZAP!!! Ahem.
Anyway, Head on back over to the terrain editor, and place some Zerglings for Player 2. We need something to Zap of course! We also need a Circle region that has a radius of 5 named 'ArchonAttackRange'.
Zerglings. Lol
After that, Take a quick hop skip and a jump over into the Trigger editor, and create a new folder named 'Attack'. If you can't tell, I REALLY like folders. Organization is great. Anyway, off that tangent. This process will be another few triggers, because we need to set up an attack radius, get every zergling in that radius, and then pick one to zap, preferably one that is close to us. WE CAN DO IT!
So, The first trigger we are going to make is the one that attaches the Attack Radius region to our Archon. In the Attack folder, create a new Trigger, 'AttachRadiusToPlayer'
Next, Create a new trigger named 'Attack'. This trigger is in quite a few parts, as it is pretty involved, and will use local variables (it makes things easier in the long run).
So, the first part is simple, make the event when player 1 presses left mouse.
Then, press Ctrl + B, or create a New Variable named 'TargetGroup'.
Now we have all of our units in that region we attached to our Archon. Lets pick one to destroy. Create another variable named 'Target'.
THIS IS IMPORTANT: Your target variable MUST MUST MUST come after your Target Group variable. TargetGroup needs to initialize first.
That's it for this tutorial. You may notice that the Archon will auto attack zerglings. Just go into the Data Editor and remove it's Attack ability, since we are making attacks ourselves. Make sure you don't remove it's Move ability though, cause we need that. Thanks for Reading.
Hi Hi. I love the Galaxy Editor, it's pretty legit. Also, I'm new here, and playing around with the Galaxy Editor. Also, about me, I'm was a programmer for the Empires hl2 mod, so SC2 is alot more...visual.
I maed a map: Zergling Zap! It's a 3rd person action game where you zap zerglings. Really, it's an experiment in 3rd person movement.
I'll probably release the triggers that do the controls. It's pretty crappy, and wont work in Multiplayer (I'm using a few GameTimeElasped timers at around .0001 seconds...not gonna fly over network). However, it's fun.
0
That's pretty legit
0
I believe Blizzard does most of their development in a windows environment, so they just natively expect crlf. I wouldn't be surprised if this changes due to their statement that they intend to get the editor working in the mac environment
0
There is not technical limit. WC3 had a system where it would prioritize pathfinding for each unit, so that when you had more units then what you could process in a frame, units waited until the processor could handle their pathfinding code. Initially, this didn't matter as graphics capabilities were far behind pathfinding capabilities, but, now WC3 renders pretty quickly with an 8800.
Right now, we are at that point with sc2 where pathfinding code is faster than graphics processing. It starts to visually lag before we have any problems with pathfinding, making the frames take more time anyway. Granted, this limit is 1000+ units on my computer, and my friends is close to 2000 units or more.
Simply, without a supercomputer, I don't think we can hit the limit yet.
0
There is no way to event for items being picked up or equiped. This is highly annoying as I want to add/remove behaviors on items that are in the inventory
0
Here is an odd bug. When you pick up an item off the ground, and it has a behavior on it, that behavior remains in effect while the item is in your inventory.
For example, if you give an item a timed life of 60 seconds, after 60 seconds, that item will die. There seems to be no way to remove a behavior when it goes into your inventory.
0
@SupDood: Go
You still have the issue where the camera pans when you rotate it, Which is what I limited with the restricting camera bounds. I guess it's just a bug that blizzard has to fix.
0
@SupDood: Go
Do you have an example map of this? I'd like to see how you did it.
The running away is a default behavior of an idle unit. Fixing that was beyond the scope of the tutorial, but you have to go into the data editor and clear that behavior. As for waiting for the animation to finish, there is no way to get the time of the animation or whether or not the model is doing a certain animation, so no. You could, however, look at how long the animation plays, and limit executing that attack trigger until the animation time has passed since you last attacked.
0
The function you need is Player Group from Player(). The trigger text I used is not very clear on this, so I will go through today and fix the 3 instances I turn Players into PlayerGroups.
The map I made while building this tutorial is linked at the very top of the page, so you can use that to compare.
While there is no built in solution, I know you can get the pitch as a Real, and then clamp it to a certain value. I don't know if you can set the pitch exactly, but, poke around
0
@SupDood: Go
Really? I will try this
So, after playing around with it, I can't get it working as you describe. The camera still pans with mouse relative mode on.
0
No, the Archon will automatically move in the direction the camera is facing, and the camera moves naturally around the Archon.
0
Kay, it's finished now.
Not in the scope of this tutorial, but it shouldn't be too hard to figure out.
0
This is an advanced article on creating 3rd Person Control system. It assumes you know how to use the Trigger editor and some basics navigating the Galaxy Editor. You can download a working version of the 3rd person controls here: http://dl.dropbox.com/u/1940586/sc2-3psmovement-tut/ZerglingZapTut.SC2Map
Before We Trigger
We need a Unit to control, and for this tutorial, I will use an Archon. While much of the tutorial is unit independent, when we get to attacking, we will use the Archon attack for damage dealing, and other units don't have that.
So, Create an Archon for Player 1 in the center of the map. Also, create a circle region with the radius of 0.25 named CameraView
And then he said: Let there be Triggers
So, we got our Archon and our small area, Lets get crackin. Open up the Trigger editor and delete that pesky Melee Initialization trigger. Let's create a global variable that is of type Unit. I'm going to name it Player, and set it to our Archon. Also, I'm a fan of organization, so lets create a new folder in your Trigger Editor and name it Init. In this folder, we will put all of our initialization triggers.
Create a new Trigger named Init3ps. The Event will be (gasp) Map Initialization. For the actions, we have:
And run the map. You should now be looking at your Archon in 3rd Person mode! YAY!!!!! WOOP!!!
Tasty Trembling Triggers Rotating Round Rhombuses
Now we are going to have some fun with Movement. And by fun, I mean actually do it. Again, I like organization, so we are going to create TWO folders this time, One named 'Update' and the other named 'Movement'
Inside of Update, we will make a new Trigger named UpdateCamera. This trigger will keep the camera bounds correct while we move our unit, since the camera bounds will not follow a moving region for some reason. TBH, it feels like a bug, so I made this in a separate trigger from other update functions, so that if they fix the bug, we can quickly delete this part.
Create a Trigger in the Movement Folder named MoveForwardKeyDown. This is when you press the W key, you move forward. This is code roughly based on someone else's project, but I don't remember who. This is the most involved trigger here. The Move Order is fairly specific, and you need to make sure you use the function IssueOrderTargetingPoint
Finally, we need to break this loop when we lift up the W key, so create a new Trigger named MoveForwardKeyUp. This one is pretty simple.
Triggering a move is great, now lets Trigger a WARRRRRR
Right, so we have movement and looking done, lets do some Awesome ATTACKING! RAAAAHHH ARCHON ZAP!!! Ahem.
Anyway, Head on back over to the terrain editor, and place some Zerglings for Player 2. We need something to Zap of course! We also need a Circle region that has a radius of 5 named 'ArchonAttackRange'. Zerglings. Lol
After that, Take a quick hop skip and a jump over into the Trigger editor, and create a new folder named 'Attack'. If you can't tell, I REALLY like folders. Organization is great. Anyway, off that tangent. This process will be another few triggers, because we need to set up an attack radius, get every zergling in that radius, and then pick one to zap, preferably one that is close to us. WE CAN DO IT!
So, The first trigger we are going to make is the one that attaches the Attack Radius region to our Archon. In the Attack folder, create a new Trigger, 'AttachRadiusToPlayer'
Next, Create a new trigger named 'Attack'. This trigger is in quite a few parts, as it is pretty involved, and will use local variables (it makes things easier in the long run).
So, the first part is simple, make the event when player 1 presses left mouse.
Then, press Ctrl + B, or create a New Variable named 'TargetGroup'.
Now we have all of our units in that region we attached to our Archon. Lets pick one to destroy. Create another variable named 'Target'. THIS IS IMPORTANT: Your target variable MUST MUST MUST come after your Target Group variable. TargetGroup needs to initialize first.
Now that we have our targets, Lets do something about it. Play the attack animation and if there is actually zerglings in our radius fire off a Zap!
Final Attack Trigger Code:
Run the map, it works now!
That's it for this tutorial. You may notice that the Archon will auto attack zerglings. Just go into the Data Editor and remove it's Attack ability, since we are making attacks ourselves. Make sure you don't remove it's Move ability though, cause we need that. Thanks for Reading.
0
http://dl.dropbox.com/u/1940586/ZERGLINGZAP.SC2Map
There is ZerglingZap so far.
0
Hi Hi. I love the Galaxy Editor, it's pretty legit. Also, I'm new here, and playing around with the Galaxy Editor. Also, about me, I'm was a programmer for the Empires hl2 mod, so SC2 is alot more...visual.
I maed a map: Zergling Zap! It's a 3rd person action game where you zap zerglings. Really, it's an experiment in 3rd person movement.
I'll probably release the triggers that do the controls. It's pretty crappy, and wont work in Multiplayer (I'm using a few GameTimeElasped timers at around .0001 seconds...not gonna fly over network). However, it's fun.