I haven't used the parameters of triggeraction yet, but I think this is how they would work. Let's say you want to pass a damage qand type value with this. You would call triggeraction similar to this:
NPC Code:
triggeraction x,y,damaged,damage,type;
triggeraction, in this case, has 2 parameters. (Parameters are anything after the action type, in this case "damaged". It's a standard programming term, look it up if you're still confused.)All parameters are strings, and however many parameters are passed determines the strings. If triggeraction passes 5 parameters you'd have variables from #p(0) to #p(4). If it passed 10, you'd have from #p(0) to #p(9). In this case we're passing 2, so there's #p(0) and #p(1).
You must always pass 1 parameter, or your script will not run! Of course this paramater may be empty, as in triggeraction x,y,action,; (notice nothing between the comma and semicolon.)
In this case, the parameter #p(0) contains the damage amount, and #p(1) contains the type of weapon (ie freezing, burning, shocking, normal, whatever). Here's how the recieving NPC uses this:
NPC Code:
if (actiondamaged) {
hearts -= strtofloat(#p(0));
}
If an NPC was weak to freezing weapons, it could have this:
NPC Code:
if (actiondamaged) {
if (strequals(#p(1),freezing) {
hearts -= 2*strtofloat(#p(0));
} else {
hearts -= srtofloat(#p(0));
}
}
And so on. Hope this helped.
[Edit: Added some code tags to make the script snippets look a little better.]