Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to Рыцарь Бездны
User Avatar
14 years ago
Auto-translated
Knight of the Abyss
You're helping me out again. The second option works great. Now I want to make it so that when you enter a zone, a message is displayed, then the monster plays a death animation, it disappears, and another one appears in its place. (Let's say a group of peasants is standing in front, then they die, and a group of skeletons appears in their place). Can you suggest a way to do this? (I can only get the message to display).
When entering the zone, a stop-zone trigger is activated, you display a message, and when you click "OK" in the message (transition to a new function), the creature is given a death animation (a battle animation was recently discussed - like peasants poking with pitchforks [PlayObjectAnimation("Creature Name", "animation type", animation loop);], here you just need to put something like "death" or "ded" in the player's resources, or in the extended editor, there are all types of creature animations, either in scene creation mode or somewhere else. You can also view them in the game's resources in the creature's xdb files - they are all there too. And instead of a looping animation, you need to set a one-time animation, otherwise it will be something like a "roly-poly" toy. After the death animation, delete the creature, immediately play an effect at the coordinates where the peasant was, for example, "raise dead spell effect." Create a monster (crtktnf) in that place at the coordinates where the old one was, and play an animation, either of joy or disappointment - anything.
In reply to Dyrman
User Avatar
14 years ago
Auto-translated
Death animation: PlayObjectAnimation ("monster", "death", ONESHOT_STILL);
User Avatar
14 years ago
Auto-translated
Is there a script that sets the maximum number of movement points? It must exceed the nominal value. For example, a standard value of 2500 would become 5000, but the green bar wouldn't fill up immediately, meaning that the unit would move only halfway, even though it actually has more movement points.
User Avatar
14 years ago
Auto-translated
I would try it with a mod, Dyrman.
In reply to Ment
User Avatar
14 years ago
Auto-translated
Ment
I would try it with a mod, Dyrman.
No, you can't change the checksum :( But that's not the only issue. It's also that not everyone needs it.
I've already come up with a way to do it through the seat, but I'd still like a proper solution :( ChangeStat no longer sets a specific value :( I couldn't find anything else in the depths of the documentation...
User Avatar
14 years ago
Auto-translated
If both players have this map with the mod, then the checksum will also be correct. Otherwise, it won't work. Unless you meet the hero with a script in the stable and remove the message about changing horses, but that's a bit of a workaround).
In reply to Ment
User Avatar
14 years ago
Auto-translated
Ment
If both players have this map with the mod, then the checksum will also be correct. Otherwise, it won't work. Unless you use a script to have the hero meet at the stables and remove the message about changing horses, but that's a bit of a workaround.
Well, the mod affects everyone, meaning all the heroes... Even if it affects the maps, it's not critical. It will have a rather negative impact on all the characters in our Might and Magic: I wanted to have one outstanding hero, but in the end, they all... Sigh, everything in Russia is done through trial and error. I'm going to follow Russia's well-trodden path...
User Avatar
14 years ago
Auto-translated
Is it possible to create a region using scripts?
In reply to Dyrman
User Avatar
14 years ago
Auto-translated
Dyrman
Is it possible to create a region using scripts?
Definitely not.
User Avatar
14 years ago
Auto-translated
Play2DSound(soundname)

instead of soundname, you need to specify the path to the sound file.
Question: what file format? Which folder should the file be placed in so that the path can be specified?

Added 1 hour 6 minutes ago
function firststepsF1(heroname)
if heroname == "biara"
then MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),GetMapDataPath().."firststeps1.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", nil);
else sleep(1)
end;
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", "firststepsF1")


that damn trigger isn't being called. I step on the region and nothing happens.
I'm already tired. It gives an error about attempting to make nil.
The hero is Biara.
The region...
I did everything correctly, didn't I?
In reply to RedHeavenHero
User Avatar
14 years ago
Auto-translated
RedHeavenHero
Definitely not.
There is a command called RegionToPoint, but it creates a point-based region. And I'm not sure if that's what you want.

else sleep(1); try it like this. And it's possible that something is wrong with MessageBoxForPlayers. Yes, remove the empty line between end and Trigger.
User Avatar
14 years ago
Auto-translated
now this appears: Warning: console script commands are not allowed
it doesn't work
function firststepsF1(heroname)
if heroname == "biara"
then MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),GetMapDataPath().."firststeps1.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", nil);
else sleep(1);
end;
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", "firststepsF1")
14 years ago
Auto-translated
function firststepsF1 (heroname)
if heroname == "Biara" then
MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()), GetMapDataPath().."firststeps1.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", nil);
end;
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", "firststepsF1");
Maybe this is it. There were a few grammatical errors here.
In reply to Его Высокопреосвященство
User Avatar
14 years ago
Auto-translated
His Excellency
Maybe. There were a few grammatical errors.
and where else.
So the trigger works, but it says the text is empty. I tried Unicode, ANSI, and UTF-8 encodings. Nothing works.
function firststepsF1(heroname)
MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),GetMapDataPath().."firststeps1.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "firststeps1", "firststepsF1")
User Avatar
14 years ago
Auto-translated
Help me write a script so that when a random hero of the first player reaches, say, level 5, a message is displayed.

Statistics

Welcome our newest member: recijeb