User Tools

Site Tools


lua:scripting:examples:conservingvnums

In cases where multiple triggers are used for the same mob/object/area, it is possible to use a single prog for all the triggers. In the prog you can then have trigger specific code based on trigtype argument.

OBJPrograms for [31404]:
 Number Vnum Trigger Phrase
 ------ ---- ------- ------
[    0] 31400    drop 100
[    1] 31400     eat 100
if trigtype=="eat" then
  echo("You can't eat me!")
  return false
elseif trigtype=="drop" then
  echo("You can drop me.")
  return true
end
eat cab
You can't eat me!

drop cab
You can drop me.
You drop Corned Beef and Cabbage.

If needed this could be taken one step further with the same prog being used for multiple mobs/objects/areas with vnum or name specific code sections.

lua/scripting/examples/conservingvnums.txt · Last modified: 2014/12/24 05:46 by vodur