Staredit Network > Forums > SC2 Assistance > Topic: Issue Order: Checkpoints and More
Issue Order: Checkpoints and More
Dec 28 2012, 9:03 pm
By: LoveLess  

Dec 28 2012, 9:03 pm LoveLess Post #1

Let me show you how to hump without making love.

Basically, I will have roughly 30 points on my map that will be used as checkpoints. Each checkpoint will be used by opposing teams, just going in opposite directions and attacking anything that they come across (using attack point). Note that I had this working before, but now I just want to make them neat/more efficient. All I did was break them :rolleyes:

The second part of the topic is that I want to set up a priority system for these units so that they attack units in a custom "threat" order that I had made. This worked before, but back then I couldn't get them to stop attacking. Now I cannot get them to start :rolleyes:

Collapsable Box


As you can see, it is a freaking mess and very inefficient. What I am asking is how do I make all of these into arrays so I can do:

When triggering unit==creep, owned by P13 or P14, enters point X(his custom value): Owner==13, then X+1, else Owner==14, then X-1, finally ordering that triggering unit to point X (the new custom value).

The other part is that when the triggering unit is either a certain distance away or the duration ends, they leave him alone again and go back to attacking the point they were told to.

Post has been edited 1 time(s), last time on Dec 28 2012, 9:12 pm by LoveLess.



None.

Dec 28 2012, 10:52 pm Roy Post #2

An artist's depiction of an Extended Unit Death

Here's some optimizations I went through; let me know if you want me to focus on anything I may have skimmed.

Creep Checkpoints
Creep Protect
Creep Orders

Now, as for why it's not working, I don't see anything inherently wrong with your code. Could you describe the issue in more detail?

Post has been edited 4 time(s), last time on Dec 29 2012, 12:42 am by Roy.




Dec 29 2012, 12:14 am LoveLess Post #3

Let me show you how to hump without making love.

Thanks Roy, that is a lot cleaner and exactly what I was looking for. However, they are still experiencing the same issue.

The issue is that they are just not taking the orders, yet they have with these commands before. Here is the spawning trigger:

Collapsable Box


I decided to force them to move to the next point in the series by force, but once they reach it, the trigger runs: They just don't go anywhere after that. I used an error message to make sure I know it went off, but that doesn't work either. It seems like they don't like their custom value.

Post has been edited 1 time(s), last time on Dec 29 2012, 12:38 am by LoveLess.



None.

Dec 29 2012, 12:44 am Roy Post #4

An artist's depiction of an Extended Unit Death

The problem is either the custom value or the unit group. You can do some debug messages like printing out the number of units in the unit group or printing out the units' custom values to see what the issue is. From the snippets you've provided, I'm as mystified as you are as to why it isn't working.




Dec 29 2012, 1:17 am LoveLess Post #5

Let me show you how to hump without making love.

Quote from Roy
The problem is either the custom value or the unit group. You can do some debug messages like printing out the number of units in the unit group or printing out the units' custom values to see what the issue is. From the snippets you've provided, I'm as mystified as you are as to why it isn't working.
It appears to be some kind of error in using Pick Units and Ordering the Picked units, it just doesn't want to do it. So I changed those scenarios by just using the triggering unit instead, cutting out the middleman and I will handle units that stray off or lose their attack order the same way I am trying to do Creep Protect. So the checkpoints work now, just a different way than originally planned, oh well. Still far more efficient.

Now the problem lies within Creep Protect. When it runs, I get this spammed multiple times per second:

00:02:31.00 Scri: Trigger Error in 'gt_CreepProtectTrigger_Func': Could not get 'p2' from parameter in 'DistanceBetweenPoints' (value: 0) Near line 91 in gf_CreepProtectFunction() in MapScript.galaxy

They also do not move or any such thing. They ignore the order and continue as normal, as if the trigger didn't exist. To clarify, the intended effect of the trigger:

When a unit other than a "Creep" is attacked, I want all nearby "Creep" and "Tower" to attack the attacker(s) as long as they stay within range and/or continue attacking. Note that the trigger is not the final values to reflect such, but I can do that on my own, I just need them to start attacking in the first place :-(

Post has been edited 1 time(s), last time on Dec 29 2012, 1:28 am by LoveLess.



None.

Dec 29 2012, 4:02 am Roy Post #6

An artist's depiction of an Extended Unit Death

Double-check to make sure you aren't using a function where you shouldn't be (e.g., using "Triggering Unit" on a trigger that doesn't have an event involving a unit).

The trigger seems to be hitting some invalid parameter, and the trigger just stops altogether when that happens. I haven't had to debug like this before, but I assume you can look at the script code on the given line number to see exactly which line is causing the problem.




Dec 29 2012, 5:47 am LoveLess Post #7

Let me show you how to hump without making love.

The problem lies in the Picked Unit triggers. It doesn't like them when dealing with custom values. I reworked it all using:

Unit Group - For each unit Any Unit for some reason in Creep Group do (Actions)
Actions
Unit - Set (Unit 1 from Creep Group) custom value 0 to ((Custom value 0 of (Unit 1 from Creep Group)) - 1000.0)
Unit - Order (Unit 1 from Creep Group) to ( Attack targeting Checkpoint[(Round((Custom value 0 of (Unit 1 from Creep Group))))]) (Replace Existing Orders)


And now it works like a charm. One last question: How can I create a static point? I want to get the location of where the offense was made and for it to not be refreshed, meaning that if the units are moving, the point doesn't move with them. Everything I have tried drags the point along with them.



None.

Dec 29 2012, 8:07 am Roy Post #8

An artist's depiction of an Extended Unit Death

It's odd, because "Picked Unit" should be working in the way you've been using it. I guess it's a bug in the editor that Blizzard hasn't caught yet.

If you use a point variable, it will store whatever value the position is when you use the "Set Variable" action. It shouldn't drag the point along unless you set it multiple times. (I just tested and confirmed that this is the behavior.)

Post has been edited 1 time(s), last time on Dec 29 2012, 8:19 am by Roy.




Dec 29 2012, 10:56 pm LoveLess Post #9

Let me show you how to hump without making love.

Here is what I am using currently and I have also tried recording the X/Y through Real variables independently:

Creep Protect Function
Options: Action
Return Type: (None)
Parameters
Creep Player = 0 <Integer>
Transferred Unit = No Unit <Unit>
Grammar Text: Creep Protect Function(Creep Player, Transferred Unit)
Hint Text: (None)
Custom Script Code
Local Variables
Creep Group = (Empty unit group) <Unit Group>
Any Unit for some reason = Any Unit <Unit>
Untitled Variable 001 = No Point <Point>
Actions
Unit Group - Add all units in (Creep, Tower, and None units in (Region((Position of Transferred Unit), 7.0)) having alliance Enemy with player (Owner of Transferred Unit) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) to Creep Group
Variable - Set Untitled Variable 001 = (Center of Creep Group)
Unit Group - For each unit Any Unit for some reason in Creep Group do (Actions)
Actions
Unit - Set (Unit 1 from Creep Group) custom value 0 to ((Custom value 0 of (Unit 1 from Creep Group)) + 1000.0)
Unit - Order all units in Creep Group to ( Attack targeting Transferred Unit) (Replace Existing Orders)
General - Wait for (Conditions), checking every 1.0 Real Time seconds, for no longer than 6.0 seconds
Conditions
(Distance between (Position of Transferred Unit) and Untitled Variable 001) > 3.0
Unit Group - For each unit Any Unit for some reason in Creep Group do (Actions)
Actions
Unit - Set (Unit 1 from Creep Group) custom value 0 to ((Custom value 0 of (Unit 1 from Creep Group)) - 1000.0)
Unit - Order (Unit 1 from Creep Group) to ( Attack targeting Checkpoint[(Round((Custom value 0 of (Unit 1 from Creep Group))))]) (Replace Existing Orders)
Unit Group - Remove all units from Creep Group


The only part that isn't working is that it doesn't detect when you get further away from the triggering point. Any alternative methods are welcome.



None.

Dec 30 2012, 1:55 am Roy Post #10

An artist's depiction of an Extended Unit Death

Should be working; you have it set up the way I'd go about it. Debug this by changing the "Wait For Conditions" to a while loop and invert the comparison to be <= 3.0, and then in the loop print out the position of the unit, the point, and the distance.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: lil-Inferno, RIVE, Zycorax