Jesus4Lyf
Good Idea™
- Reaction score
- 396
Remove materials which have been copied with lack of author permission, or this thread will have to be deleted. It's copyright infringement.
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
If you search _GetTriggeringUnit you won't find anything. Need to search GetTriggerUnit instead.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
RemoveLocation="Remove Location"
RemoveLocation="Remove ",~Location
RemoveLocationHint=
CreateTrackable="Remove Location"
CreateTrackable="Remove ",~Location
CreateTrackableHint=
CreateTrackable="Create Trackable"
CreateTrackable="Remove ",~Location
CreateTrackableHint=
CreateTrackable="Remove Location"
CreateTrackable="Create ",~Trackable
CreateTrackableHint=
CreateTrackable="Remove Location"
CreateTrackable="Create ",~Trackable
CreateTrackableHint=
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
Trigger Database Error
[TriggerCalls] - CreateTrackable
Data section and text section have differing number of paramenters (2,1)
CreateTrackable="Create Location"
CreateTrackable="Create a trackable with the model ",~modelfile," at (",~real,", ",~real,") facing ",~real," degrees"
CreateTrackableHint=
// returns trackable
CreateTrackable="Create Trackable"
CreateTrackable="Create a Trackable with the model ",~modelfile," at (",~real,", ",~real,") facing ",~real," degrees"
CreateTrackableHint="Creates a trackable."
Trigger Database Error
[TriggerCalls] - CreateTrackable
Data section and text section have differing number of paramenters (2,4)
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
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:
It's syntax is: Function=0/1 Compatibility,0/1 Event Usable,Return TypeCode:GetTriggerUnit=0,0,unit _GetTriggerUnit_Defaults= _GetTriggerUnit_Category=TC_EVENTRESPONSE So, GetTriggerUnit=0,0,unit
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:
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!Code:GetTriggerTrackable=1,0,trackable _GetTriggerTrackable_Defaults= _GetTriggerTrackable_Category=TC_EVENTRESPONSE
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
CreateTrackable="Create Trackable"
CreateTrackable="Create a trackable with the model ",~modelfile," at (",~real,", ",~real,") facing ",~real," degrees"
CreateTrackableHint=
GetTriggerTrackable=1,0,trackable
_GetTriggerTrackable_Defaults=
_GetTriggerTrackable_Category=TC_EVENTRESPONSE
GetTriggerTrackable=1,0,trackable
_GetTriggerTrackable_Defaults=
_GetTriggerTrackable_Category=TC_EVENTRESPONSE
GetTriggerTrackableEvent="Trackable gotten"
GetTriggerTrackableEvent=~Trackable," gotten"
GetTriggerTrackableEventHint="Use 'Event Response - Trackable gotten' to refer to the trackable that is gotten."
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: