Auto-translated
I don't understand this, but it's strange that after the battle, the creature speaks a text, but without the battle, it doesn't. Can you help?
There is a solution. If you are talking about a group of creatures with a flag, I haven't checked, but if it's a single creature, it should work.
Let's get to the point.
First, give the creature a name. "Name" is the script name that will be used.
To interact with objects and creatures, you need to use
SetObjectEnabled("Name",nil); this can be written anywhere.
function DevilF()
MessageBox("/Maps/SingleMissions/Test_Skriptov/Devil.txt"); - this command displays a message. "Test_Skriptov" is your map, and "Devil" is the text file.
AddHeroCreatures("Christian", 3, 20); "Christian" is the script name of the hero.
RemoveObject("Devil"); this removes the object if you want the action to be one-time.
end;
Trigger(OBJECT_TOUCH_TRIGGER, "Devil", "DevilF");
and here is the code:
function DevilF()
MessageBox("/Maps/SingleMissions/Test_Skriptov/Devil.txt");
AddHeroCreatures("Christian", 3, 20);
RemoveObject("Devil");
end;
Trigger(OBJECT_TOUCH_TRIGGER, "Devil", "DevilF");
It worked for me. I don't know if there are other ways. If you want the creature not to be removed, you can do this:
function DevilF()
Trigger(OBJECT_TOUCH_TRIGGER, "Devil", nil); this command is used so that the actions are no longer triggered
MessageBox("/Maps/SingleMissions/Test_Skriptov/Devil.txt");
AddHeroCreatures("Christian", 3, 20);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "Devil", "DevilF");