Ok... my last post probably wasn't that clear. Sorry.
There are two ways to do this. Either you can just put your script commands in the send box in the trigger or you can make a script that contains those commands in a function that you can 'call' from the send box.
For the first way you would just use the Note or ColourNote functions.
To use these functions simply put:
Note("Whateveryouwanttosay") or ColourNote("textcolor", "backgroundcolor", "whateveryouwanttosay")
Into the send box of the function and select the "script" option from the "send" drop down menu.
For example:
CODE
Note("Someone just snapped you!!!!")
Note("THEFT!!!!!!THEFT!!!!!!THEFT!!!!!")
This would show:
CODE
Someone just snapped you!!!!
THEFT!!!!!!THEFT!!!!!!THEFT!!!!!
or something to that effect.
If you want to include a variable value in your Note() or ColourNote() functions than just use the GetVariable("varname") function.
For example:
Note(GetVariable("target"), " just attacked you!!")
This would show:
Irion just attacked you!!
this is the second wayThe scripting thing is making a shortcut function that you can
call (which is to say used) from any trigger or alias.
CODE
enemyw {
alert = function(a)
Note("******* ",GetVariable("target"), " has ", a, "********")
Note("******* ",GetVariable("target"), " has ", a, "********")
Note("******* ",GetVariable("target"), " has ", a, "********")
end
}
this goes in the script file, you can see where your script file is by doing SHIFT + CTRL + 6
then create a new script file. it should open in the mush editor. paste in the above uh...Group of vars and functions? What is this called in lua anyway Soludra? Or is it just a block of script for purposes of organization and encapsulation?
Explanation of the above: (important terms in
bold)
Alert is the name of the function. This is what you call when you want the function to run.
You call this function by sending enemyw.alert("enemyname") to script.
The part with the enemyname inserted is called the functions
arguments.
Anyway you can now access the function alert by typing:
CODE
enemyw.alert(%1)
This should give the output:
CODE
******* Irion has sipped health ********
******* Irion has sipped health ********
******* Irion has sipped health ********
Into the send box of the trigger. and selecting the send to script option.
This will cause the trigger to access the script file and substituted whatever you put in for the arguments to wherever the 'a' is located into the function. This 'a' is a
local variable and has no power outside of its function. For example, you couldn't access 'a' from a trigger, it has no stored value except while the function is being run.
Does that answer your question?
Also, note that the two methods are substitutes for each other, so you can do whichever you want. Just the second way has less typing for every trigger you want to make.