PlayObjectAnimation('your assigned script name for the object',
'animation name',
the third parameter - IDLE, if you want the animation to loop,
ONESHOT - to play it once,
ONESHOT_STILL - to make the creature stay in the final frame of the animation)
Posts from Current questions and answers regarding the map editor.
Auto-translated
P.S. It would also be nice to know the delay command, so that a looped action repeats every few seconds, for example.
Thank you both very much, I figured it out. I would also like to ask: Do you know of a script that would remove the faction skirt from creatures?
P.S. It would also be nice to know the delay command, so that a looped action would repeat every few seconds, for example.
First, you need to write the command SetObjectEnabled("object name", nil) - This is essential!
Next, enter the command SetMonsterSelectionType("object name", 0)
Added 30 seconds later
The delay command, as I understand it, is sleep(number).
PlayObjectAnimation("SlaveGob_1", "attack00", IDLE);
sleep(2)
But instead of waiting for two seconds (which are seconds, right?), this goblin, as if ignoring the bottom line, gets stuck in a loop with the animation without any visible delays. I need it to hit the ore, wait two seconds, and then hit it again, repeating the cycle endlessly.
I have a strange problem with delays. I write the following in the scripts:
PlayObjectAnimation("SlaveGob_1", "attack00", IDLE);
sleep (2)
But instead of waiting for two seconds (aren't those seconds?), this goblin, as if ignoring the bottom line, loops the animation without any visible delays. I need it to hit the ore, wait two seconds, and then hit it again, and so on, in a cycle endlessly.
Let's assume we create a separate function for the animation:
function goblin()
PlayObjectAnimation("SlaveGob_1", "attack00", IDLE);
sleep (2)
end
startThread(goblin)
But instead of waiting for two seconds (aren't those seconds?),
function goblin()
PlayObjectAnimation("SlaveGob_1", "attack00", IDLE);
sleep (2)
end
startThread(goblin)
function goblin()
while (true) do
PlayObjectAnimation("SlaveGob_1", "attack00", IDLE);
sleep (2)
end
end
startThread(goblin)
I'm trying to figure them out now, and I'm doing everything exactly as written in the Ogo manual, but in the game, when entering a region, nothing happens; the hero doesn't even stop.
function CyclopsFrontF ()
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "CyclopsFront", nil);
MessageBox ("\Maps\Multiplayer\OrcTown\CyclopsFrontF.txt");
end;
I've tried everything I can think of. I've re-uploaded the text document (which, by the way, is in Unicode format, so everything should be fine) to the map archive many times, and I've changed the slashes (sometimes \, sometimes /). I found a solution to the problem here (they said it's better to write GetMapDataPath().."Deadst.txt", but I didn't understand what the two dots after the parentheses mean, whether something needs to be written there, etc.) - nothing helped.
Maybe the problem is that I have a Multiplayer map, and half of the scripts can't be used there?
P.S. And what should be written in the goblin functionalities that you provide as an example here? Or can I just upload an empty file, and it will work?
I'm trying to figure it out now, and I'm doing everything exactly as written in the Ogo manual, but in the game, when entering a region, nothing happens; the hero doesn't even stop.
Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'REGION_NAME', 'FUNCTION_NAME');
has been executed. If this hasn't happened, either this function is written with an error, or any other line of code before this function is written with an error (the code completely stops executing if even one major error is made). There are methods to check this (print, first of all). Multiplayer can also be a problem. And make sure the slashes are correct. In the manual, in my signature, I described many of these things.
And what, by the way, needs to be entered in the goblin functionalities that you provide here as an example? Or can I just throw in an empty file, and it will work?
And also, as I also wrote in my first comment, is it possible to attach a creature model from a mod to a hero. They are simply not visible; there are only vanilla models, there are even models from the campaign videos, but there are no custom models from NCF, I checked the neutral section.
P.S. By "function," I meant that the archive with the map should contain text documents with some kind of artistic text (as in the case of MessageBox), or, perhaps, I don't know, I just assumed, in the form of script snippets, and this text document performs the function, I apologize for the tautology.
By "function," I meant that the map archive should contain text documents with some kind of narrative text (like in the case of MessageBox), or perhaps, I don't know, just pieces of script, and this text document performs the function, excuse the tautology, of a function.
Almost all game resources are in data/data.pak. Everything you put inside the map will also be added to the resources. The root of the map is the path "/". That is, if something is inside the map in the folder foobar, it will be accessible as "/foobar/...". If the editor doesn't allow you to edit the path somewhere, you can always open map.xdb in a text editor and change the path manually (at your own risk).
P.S. The map file is in the archive.
function goblin()
while (true) do
PlayObjectAnimation("SlaveGob_1", "attack00", IDLE);
sleep (0.5)
end
end
startThread(goblin)
I insert it into the map script and go to test it. I launch the map, it loads, and when I'm actually in the game, it freezes completely. At the same time, I can hear sounds of hooves, clanking armor, and so on. Can you tell me what I did wrong? I can't figure it out.
I also have another problem: on a different computer, when I'm using the editor, the properties function doesn't work. I don't know if everything else is broken, but when I was creating a custom hero based on one of the existing templates, I changed his special ability, biography, appearance, description, and everything else. All of this was saved, and I could even see the new skin in the editor, but when I entered the map in the game, I was presented with a completely vanilla hero. It was Nura with her vanilla biography, specialization, icon, and model, but it should have been a completely different hero. This isn't critical, but maybe there's a fix for this bug, because it's inconvenient for testing.
Option 1:
PlayObjectAnimation("SlaveGob_1", "attack00", IDLE);Option 2:
function goblin()
while (true) do
PlayObjectAnimation("SlaveGob_1", "attack00", ONESHOT);
sleep (10)
end
end
startThread(goblin)Added 24 minutes later
I also have another problem: when I'm using the editor on another computer, the properties don't seem to work. I'm not sure if everything else is broken, but when I was creating a custom hero based on one of the existing templates, I changed his special ability, biography, appearance, description, and everything else. All of this was saved, and the new skin was even visible in the editor, but when I entered the map directly in the game, I was presented with a completely vanilla hero. It was Nura with her vanilla biography, specialization, icon, and model, but it should have been a completely different hero. This isn't critical, but maybe a fix can be found for this bug, as it's inconvenient for testing.