Skip to content
User Avatar
#2721
Auto-translated
Here is a snippet from my map:
Trigger(OBJECT_TOUCH_TRIGGER, "monum1", "monumtext");
Trigger(OBJECT_TOUCH_TRIGGER, "monum2", "monumtext");
Trigger(OBJECT_TOUCH_TRIGGER, "monum3", "monumtext");
Trigger(OBJECT_TOUCH_TRIGGER, "monum4", "monumtext");

function monumtext (hero, obj)
if obj == 'monum1' then
MessageBox(mpath.. 'monum1.txt');
elseif obj == 'monum2' then
MessageBox(mpath.. 'monum2.txt');
elseif obj == 'monum3' then
MessageBox(mpath.. 'monum3.txt');
elseif obj == 'monum4' then
MessageBox(mpath.. 'monum4.txt');
end;
end;
The object_touch trigger always passes 2 parameters to the function (it doesn't matter if you use them or not): the name of the hero who touched the object and the name of the object that was touched. Therefore, you should write Trigger(OBJECT_TOUCH_TRIGGER, 'object name', 'function'), without any parameters in the parentheses.