How to: Modify the World Editor's Trigger Editor

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
in ausfailia, copyright is free and automatic

probably same in other countries too
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Awesome tutorial :thup:

Just need some help here.. I don't really understand what a trackable is...

And, how do we create TriggerString for this?

Code:
CreateTrackable=1,modelfile,real,real,real
_CreateTrackable_Defaults="Abilities\Spells\Other\TalkToMe\TalkToMe.mdl",0,0,RealUnitFacing
_CreateTrackable_Limits=_,_,_,_,_,_,0,360
_CreateTrackable_Category=TC_TRACKABLE

And also, this part in your tutorial is wrong.
Now, let's take another break. This is a lot to soak in

Now, we've learned Actions, Conditions, Variables, and Events. Wait! We need to get things like Triggering Trackable! Because there is no function for GetTriggeringTrackable in GUI! So, we need to figure out how we're going to set our new variable to the Trackable that's clicked. We can't do it without a bit of JASS unless we create a new function! Let's get started.

For anyone who doesn't know, there's a function called Triggering Unit, correct? So, we find _GetTriggeringUnit

We get:

Code:
GetTriggerUnit=0,0,unit
_GetTriggerUnit_Defaults=
_GetTriggerUnit_Category=TC_EVENTRESPONSE

If you search _GetTriggeringUnit you won't find anything. Need to search GetTriggerUnit instead.
 

Sevion

The DIY Ninja
Reaction score
424
Well, if you take a look at our first example of TriggerString:

Code:
RemoveLocation="Remove Location"
RemoveLocation="Remove ",~Location
RemoveLocationHint=

First off we need to change the name. Our function name is CreateTrackable. So:

Code:
CreateTrackable="Remove Location"
CreateTrackable="Remove ",~Location
CreateTrackableHint=

Next, we have the string to display after the category. We want it to display "Trackable - Create Trackable".

Recall that the string in the first line defines this. So we change it from Remove Location to Create Trackable.

Code:
CreateTrackable="Create Trackable"
CreateTrackable="Remove ",~Location
CreateTrackableHint=

Next, is the text inside of the box under the drop-down selection box. Recall that the second line defines this and that "," signifies concatenate and "~" signifies variable. We simply change it to "Create ",~Trackable

Code:
CreateTrackable="Remove Location"
CreateTrackable="Create ",~Trackable
CreateTrackableHint=

Lastly, we have the optional Hint to display in gray at the bottom of the dialog. Recall that the final line defines this. You can put whatever you wish in here.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Hmmm okay. But still.. what is a trackable.. and what does it do?

Edit: Okay I put this into the [TriggerCallStrings] and they still gave me the error.

Code:
CreateTrackable="Remove Location"
CreateTrackable="Create ",~Trackable
CreateTrackableHint=

If this was meant for action string, then here in your guide it said that I should put this, in the [TriggerCalls]

Code:
CreateTrackable=1,modelfile,real,real,real
_CreateTrackable_Defaults="Abilities\Spells\Other\TalkToMe\TalkToMe.mdl",0,0,RealUnitFacing
_CreateTrackable_Limits=_,_,_,_,_,_,0,360
_CreateTrackable_Category=TC_TRACKABLE

Little confused here o.o
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Code:
Trigger Database Error

[TriggerCalls] - CreateTrackable

Data section and text section have differing number of paramenters (2,1)
 

Sevion

The DIY Ninja
Reaction score
424
Oh, I'm sorry. CreateTrackable takes String (modelfile), X, Y, and Facing (all reals).

Code:
CreateTrackable="Create Location"
CreateTrackable="Create a trackable with the model ",~modelfile," at (",~real,", ",~real,") facing ",~real," degrees"
CreateTrackableHint=

Sorry, it's been a while since I've done this :p

Remember, TriggerActions/Calls and their string counterparts need to have the same arguments.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Okay thanks :)

Edit:

So I entered this
Code:
// returns trackable
CreateTrackable="Create Trackable"
CreateTrackable="Create a Trackable with the model ",~modelfile," at (",~real,", ",~real,") facing ",~real," degrees"
CreateTrackableHint="Creates a trackable."

And I get this error

Code:
Trigger Database Error

[TriggerCalls] - CreateTrackable

Data section and text section have differing number of paramenters (2,4)
 

Sevion

The DIY Ninja
Reaction score
424
If I remember correctly, the TriggerCall should have the return type after the Version and Usable-In-Events part.

Code:
CreateTrackable=1,0,trackable,modelfile,real,real,real
_CreateTrackable_Defaults="Abilities\Spells\Other\TalkToMe\TalkToMe.mdl",0,0,RealUnitFacing
_CreateTrackable_Limits=_,_,_,_,_,_,0,360
_CreateTrackable_Category=TC_TRACKABLE

Reference:

Now, we've learned Actions, Conditions, Variables, and Events. Wait! We need to get things like Triggering Trackable! Because there is no function for GetTriggeringTrackable in GUI! So, we need to figure out how we're going to set our new variable to the Trackable that's clicked. We can't do it without a bit of JASS unless we create a new function! Let's get started.

For anyone who doesn't know, there's a function called Triggering Unit, correct? So, we find _GetTriggeringUnit

We get:

Code:
GetTriggerUnit=0,0,unit
_GetTriggerUnit_Defaults=
_GetTriggerUnit_Category=TC_EVENTRESPONSE
So, GetTriggerUnit=0,0,unit

It's syntax is: Function=0/1 Compatibility,0/1 Event Usable,Return Type

So, GetTriggerUnit is the JASS function, 0 means it works for ROC, 0 means it can't be used in Events, and unit is the type it returns.

So ours goes:

Code:
GetTriggerTrackable=1,0,trackable
_GetTriggerTrackable_Defaults=
_GetTriggerTrackable_Category=TC_EVENTRESPONSE
And we've already leanred about Defaults and Categories. So, we have when the trackable is clicked or moused over and the function to get that trackable. WAIT! We need trackables in order for this to fire! So what do we do? We add an action to create trackables!
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
So this is supposed to be in trigger actions?
Code:
CreateTrackable=1,0,trackable,modelfile,real,real,real_CreateTrackable_Defaults="Abilities\Spells\Other\TalkToMe\TalkToMe.mdl",0,0,RealUnitFacing
_CreateTrackable_Limits=_,_,_,_,_,_,0,360
_CreateTrackable_Category=TC_TRACKABLE

And this in the trigger action strings?

Code:
CreateTrackable="Create Trackable"
CreateTrackable="Create a trackable with the model ",~modelfile," at (",~real,", ",~real,") facing ",~real," degrees"
CreateTrackableHint=

And then this

Code:
GetTriggerTrackable=1,0,trackable
_GetTriggerTrackable_Defaults=
_GetTriggerTrackable_Category=TC_EVENTRESPONSE

is supposed to be in trigger calls?

So what about the Trigger Call Strings? Because I saw the examples there, and I still have no idea what a trackable does. o.o
 

Sevion

The DIY Ninja
Reaction score
424
No no. The first two go into the Calls section.

You also need a string set for the GetTriggerTrackable.

A trackable detects mouse clicks.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Okay I'm very lost. I have no idea what strings I should display for the trackables because I don't know how they work. Trackabled hit/tracked. I also have no idea what I'm missing, or am doing wrong. Am I supposed to have 2 categories?

Code:
GetTriggerTrackable=1,0,trackable
_GetTriggerTrackable_Defaults=
_GetTriggerTrackable_Category=TC_EVENTRESPONSE

Does this go into TriggerEvents?

Can you show me how the string should be like? I tried making my own:

Code:
GetTriggerTrackableEvent="Trackable gotten"
GetTriggerTrackableEvent=~Trackable," gotten"
GetTriggerTrackableEventHint="Use 'Event Response - Trackable gotten' to refer to the trackable that is gotten."

Doesn't really make sense to me.
 

Sevion

The DIY Ninja
Reaction score
424
Both are Calls. Calls return something.

Reference:

Now we remember that we need to move it to [TriggerCalls] because we can't set a variable to an action. We need to set it to a function call. So move it to [TriggerCalls] Now, if you look the syntax is slightly different. So we modify it a bit to match syntax and we get:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top