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:
Post has been edited 1 time(s), last time on Jul 27 2020, 9:13 pm by SkywinDragoon.
None.