Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [EUD Editor2] Detecting build queue tutorial
[EUD Editor2] Detecting build queue tutorial
Jul 27 2020, 9:01 pm
By: SkywinDragoon  

Jul 27 2020, 9:01 pm SkywinDragoon Post #1



This is using EUD Editor 2. If you don't have access to it yet, you should download EUD Editor 2 and ready it for use.

I want to make Protoss Dragoon (because it is my favorite unit) to produce Marine, and hopefully the trigger detects it and convert it into skill.

First of all, you will go to Firegraft to set up buttons.



You can click on the button list and press Ctrl + C to copy the button. Note that you must click on the string inside the button list.



Then you paste it on the button set of Protoss Dragoon. I adjusted few elements so the button is positioned properly.



I also changed the string "Train Marine" so it will tell exactly what this button is going to do.

After you are done with the Dragoon's button set, you have to make those buttons actually push Marine into Dragoon's build queue.

Let's tinker with the requirements, and marine's data.



This will alter the Marine's requirements to produce. It was originally written as "Current unit is Terran Barracks..." and so.
I will just check "Always Allow" for sake of convenience.


This is DatEdit. In here, you can to adjust Marine's supply requirement. I made it to 0 so it won't require any supply.


Also don't forget to do this! We all know this, but we always forget. (This is SCMdraft2 by the way)

Okay, at this point, Dragoon will be able to push Marine into his queue, but won't be able to actually produce marines, because Dragoon isn't building or Reaver/Carrier that can produce units.
The marine will be stuck indefinitely. And if you press the button five times, the queue will be full, and you won't be able to press it anymore.

What we'll gonna do is make trigger know Marine is in the Dragoon's queue, and do something about it.


Go to the Trigger Editor. You will see "Classic View", but you may want to change it into "Advanced View".


Load Function to import built-in functions. There are bunch of code that are commonly used, so people made "Functions" to use it frequently across different maps. It is same as export/importing triggers, but it is for EUD.
We will import BuildCheck.tfn which detects the build queue, and BuildReset.tfn which resets the build queue.


Select those two functions and import.


You will see actually three functions are imported but actually need all those three because BuildReset.tfn won't run without BuildResetEPD.tfn.

Now make New Global Variable by clicking the button I indicated.
This "Variable" will track the index of the unit (out of 1700 units) the trigger will keep track on its build queue.

You will notice, not every single dragoon won't be using the skill we just made. The one dragoon whose index is stored will be the only dragoon who is able to use the skill.



I will name the Global Variable "Hero". From now on when the trigger says "Hero" it means the index of the Dragoon that has to do with build queue.


Now we will make "onPluginStart" section. The finished trigger will look like this in this section.
I am using this part just for the sake of the simplicity of this tutorial.
This "onPluginStart" will only happen once, at the beginning of the game.
What I want to do is make the "Hero" variable store the index of the Dragoon.


The first part of the action is called "SetNextUnitPtr"
The variable you set in this action will hold the very next unit created after this action.
So what we want to do is add "Create Unit" action to create Dragoon.
This dragoon will be our hero using "the Lamest Skill Ever [L]".

The next part is for "beforeTriggerExec" this part is executed every trigger cycle, before executing the triggers in SCM2.
You can do this in "afterTriggerExec" as well, the only difference is they will execute after the executing the triggers in SCM2.
So far we don't have any triggers in SCM2, so either way is fine.



This part is complicated, so be sure to concentrate!

The first thing I added is ACTION called "EUD Turbo". This is same as turbo trigger (that involves lots of Wait(0); you know)
but speed is doubled. It will run once every frame of the game, which is 24 times per second.
I just added this because otherwise it will respond slowly. (You could just add classic turbo trigger instead of this)

The second thing you will see is IF STATEMENT. You can add one by clicking IF button on the left. Each IF STATEMENT acts just like a normal trigger.
except they don't have "Player" section. So I will avoid using Current Player because it won't do anything at all.

In the condition of the IF STATEMENT, you will see FUNCTION called "BuildCheck". FUNCTIONS can be added by using "함수(F)" button on the left side.
This function accepts only one variable, which will be "Hero". This basically checks the build queue of the unit "Hero", which is the Dragoon we will create when the game starts.

The very first action of the IF STATEMENT is FUNCTION called "BuildReset" This will reset whatever the unit has in its build queue.
Note that this will empty the whole queue. If your trigger is slow, this might be an issue. The issue would be like :"I Pressed the button three times but only happens once! "
But for now, I use EUD turbo that probably shouldn't matter.

The rest of the trigger could be whatever you want to make happen next. It's up to you.
What I did here is :
1. Move a location to the P1 Dragoon
2. Create P1 Carrier
3. Kill P1 Carrier
4. Kill P2 Zerglings in the moved location (kill zerglings nearby the dragoon)




You are done with the trigger. now compile it using either of these buttons. Those will practically do the same.

Now let's see what I just made....



Well that was lame.

The lamest skill ever!

I will attach files used in this tutorial so you can look into this.

Attachments:
BuildQueue.zip
Hits: 0 Size: 210.53kb

Post has been edited 1 time(s), last time on Jul 27 2020, 9:13 pm by SkywinDragoon.



None.

Jul 27 2020, 10:32 pm Ultraviolet Post #2



Cool tutorial, thanks for posting! I can definitely see this information coming in handy at some point for my projects.




Jul 28 2020, 9:09 am Oh_Man Post #3

Find Me On Discord (Brood War UMS Community & Staredit Network)

Dude, amazing, this is exactly what I needed. And a great resource for everyone wanting to learn this game-changing EUD feature. With this shuttle menus, dropship menus, and unit producing buildings are redundant!

Mods, give him minerals!

Would you be able to do a tutorial on detecting the cursor and being able to trigger effects off of the cursor, such as casting spells or clicking on text menus? That's another big game changeover because without EUDs the only equivalent is Dark Swarm or Disruption Web.




Jul 28 2020, 2:11 pm Ultraviolet Post #4



Can you crosspost your tutorial here so this topic doesn't get lost over time? Nice to have everything consolidated in one thread.




Jul 28 2020, 5:06 pm MTiger156 Post #5

Veteran Mapper

Here's another suggestion that somewhat ties with the initial example:
Mid-game changing of a unit's buttons?
By this, I mean changing the button set entirely via triggers, nothing to do with how Build / Advanced Build sub-menus work.



"It takes far more than a simple ideology to map amazing things. Mapping requires a strong passion for SC as well as an even stronger devotion to your work. Avoid instant gratification. Set directions/goals for the map, and stick to them. Take pride in the work, be patient with it, and never settle for less."
-Tiger

Jul 29 2020, 8:54 am Sie_Sayoka Post #6



Quote from Oh_Man
Dude, amazing, this is exactly what I needed. And a great resource for everyone wanting to learn this game-changing EUD feature. With this shuttle menus, dropship menus, and unit producing buildings are redundant!

Mods, give him minerals!

Would you be able to do a tutorial on detecting the cursor and being able to trigger effects off of the cursor, such as casting spells or clicking on text menus? That's another big game changeover because without EUDs the only equivalent is Dark Swarm or Disruption Web.
MSQC or order coordinate detection can detect the location of the cursor or right click respectively. Both have been posted about in the documentation thread.



None.

Jul 29 2020, 11:02 am Oh_Man Post #7

Find Me On Discord (Brood War UMS Community & Staredit Network)

Oh nice dude. I think I've got enough new techniques to try out now. Time to commit to my next project. :D




Aug 1 2020, 3:34 am Oh_Man Post #8

Find Me On Discord (Brood War UMS Community & Staredit Network)

Another tutorial that would be cool is how you can detect and display the player's username.

And how to make in-game music that is unaffected by lag.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:17 am]
O)FaRTy1billion[MM] -- imagine having minerals
[05:44 pm]
Dem0n -- ya I'm below 3100 smh
[2020-8-02. : 2:22 pm]
Wing Zero -- Ya
[2020-8-02. : 1:12 pm]
Voyager7456 -- seriously
[2020-8-02. : 12:56 pm]
lil-Inferno -- can these boxes fuccing give me some fuccing minerals already
[2020-8-02. : 12:56 pm]
lil-Inferno -- :wob:
[2020-8-02. : 12:22 pm]
Ultraviolet -- :wob:
[2020-8-01. : 8:55 pm]
MTiger156 -- :wob:
[2020-8-01. : 8:17 pm]
UndeadStar -- :wob:
[2020-7-30. : 9:53 am]
Ultraviolet -- C(a)HeK C(a)HeK
C(a)HeK shouted: Ultraviolet https://www.youtube.com/watch?v=yuH9cAvfOHA
Awesome! Unfortunately the Mercenaries video is just for normal Mercenaries not the 2020 version I made. But I watched the Mercs III video all the way through, it was a lot of fun to watch. He had some good feedback, I agreed with all of it.
Please log in to shout.


Members Online: jun3hong, Roy, C(a)HeK