Can someone please help me with my problem, I have no idea why its not working. All I 'd like to do, is tell all the units belonging to a player to attack one thing or "A-move" towards a point. I used the following:
Trigger - Run Units Attack (Ignore Conditions, Don't Wait until it finishes)
AND NOTHING HAPPENS. Not only that, but I can't select the point I've created. When I try to select the unit way point the list is blank. I'm super frustrated. I even tried to trigger an event on an object (since I can't use my point), all the units just stay still.
I've even tried the following:
WTF
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Actions
Unit - Order Zealot [47.80, 73.29] to ( Attack targeting Rocks - 2x6 Vertical [38.00, 84.00]) (Replace Existing Orders)
but I get the following error when I load up the map:
Scri: Trigger Error in 'gt_WTF_Func': The ability command 'attack(0)' is missing a target? Near line 68 in gt_WTF_Func() in MapScript.Galaxy
Why doesn't any of this work?
Can anybody, please help me, I'm super desperate to get this done, it's for a school assignment, I'm really hoping this forum isn't dead.
For the link you provided, is that all there is to the trigger? If so I am not surprised it does not work. You have declared the two variables "unit waypoint" and "unit owner" in the "variables" section but have not given the variables a value.
When you declare a variable in SC2 triggers it is given a default value. For integers they default to 0 and for points it defaults to "no point" which is a nonexistent point on the map.
With that in mind, look over the code you wrote.
The 1st line says to pick each unit in (any units) owned by player 0. Usually player zero is for neutral things on the map like minerals, vespene guysers, neutral supply depots, destructable rocks, etc. Human players are usually listed from 1 onwards. The last line tells the units to attack "no point". So what this code does is command all the minerals and vespene guysers to attack a non existent location.
If you added these lines to the start of the actions list
Then that would tell the function to send all of the first human players units on attack move towards the centre of the map.
I'm assuming this is a high school or university introduction to programming course? Is the teacher getting students to do stuff in the SC2 editor or did they give you enough freedom to demonstrate programming ability in whatever medium you chose? Either way that is really cool. I wish I had ever gotten assignments which were so flexible or interesting.
PS. I'm just assuming that the human player is player 1. This is usually the case but can be changed around, so make sure to set the variable to the correct value.
Why are you using a old-styled to execute a single trigger in GUI?
Just create a function with those parameters and call it... Would make a lot more sense and you can 'set the variable' to the parameters of the function.
Edit: Added a demo map for better understandable. :)
Thanks guys! I'm happy that this forum is still active!
I ended up fixing it up, as mentioned there were no triggers but I had been told that adding "Trigger - Run Units Attack (Ignore Conditions, Don't Wait until it finishes)" would make this run... Which it didn't so anyway, I just used a timer and came up with this:
Its for an application to a programming course, and I've decided to use the sc2 map editor a go. I've got one more question to ask the forum, I'll probably have to make a new thread.
Can someone please help me with my problem, I have no idea why its not working. All I 'd like to do, is tell all the units belonging to a player to attack one thing or "A-move" towards a point. I used the following:
http://prntscr.com/2gpe9m
and added a trigger
Trigger - Run Units Attack (Ignore Conditions, Don't Wait until it finishes)
AND NOTHING HAPPENS. Not only that, but I can't select the point I've created. When I try to select the unit way point the list is blank. I'm super frustrated. I even tried to trigger an event on an object (since I can't use my point), all the units just stay still.
I've even tried the following:
WTF
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Actions
Unit - Order Zealot [47.80, 73.29] to ( Attack targeting Rocks - 2x6 Vertical [38.00, 84.00]) (Replace Existing Orders)
but I get the following error when I load up the map:
Scri: Trigger Error in 'gt_WTF_Func': The ability command 'attack(0)' is missing a target? Near line 68 in gt_WTF_Func() in MapScript.Galaxy
Why doesn't any of this work?
Can anybody, please help me, I'm super desperate to get this done, it's for a school assignment, I'm really hoping this forum isn't dead.
Thank you
@vic9050: Go
For the link you provided, is that all there is to the trigger? If so I am not surprised it does not work. You have declared the two variables "unit waypoint" and "unit owner" in the "variables" section but have not given the variables a value.
When you declare a variable in SC2 triggers it is given a default value. For integers they default to 0 and for points it defaults to "no point" which is a nonexistent point on the map.
With that in mind, look over the code you wrote.
The 1st line says to pick each unit in (any units) owned by player 0. Usually player zero is for neutral things on the map like minerals, vespene guysers, neutral supply depots, destructable rocks, etc. Human players are usually listed from 1 onwards. The last line tells the units to attack "no point". So what this code does is command all the minerals and vespene guysers to attack a non existent location.
If you added these lines to the start of the actions list
Then that would tell the function to send all of the first human players units on attack move towards the centre of the map.
I'm assuming this is a high school or university introduction to programming course? Is the teacher getting students to do stuff in the SC2 editor or did they give you enough freedom to demonstrate programming ability in whatever medium you chose? Either way that is really cool. I wish I had ever gotten assignments which were so flexible or interesting.
PS. I'm just assuming that the human player is player 1. This is usually the case but can be changed around, so make sure to set the variable to the correct value.
Why are you using a old-styled to execute a single trigger in GUI?
Just create a function with those parameters and call it... Would make a lot more sense and you can 'set the variable' to the parameters of the function.
Edit: Added a demo map for better understandable. :)
Thanks guys! I'm happy that this forum is still active!
I ended up fixing it up, as mentioned there were no triggers but I had been told that adding "Trigger - Run Units Attack (Ignore Conditions, Don't Wait until it finishes)" would make this run... Which it didn't so anyway, I just used a timer and came up with this:
(in case that didn't work link http:prntscr.com/7fuicb)
and its working like a charm.
Thank you very much for the quick answers.
Its for an application to a programming course, and I've decided to use the sc2 map editor a go. I've got one more question to ask the forum, I'll probably have to make a new thread.