Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
10 years ago
Auto-translated
PlayDialogScene -- function to launch the video.
After completing the task, set a trigger: Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER,...
In general, it's not difficult; it's largely similar to the region-based method from the neighboring topic.
How do I insert my own voiceover? I have the necessary format, but I can't insert it into the dialog scene. Thank you in advance!
You need to export the sound as a resource into the game. And in the video, insert this sound (or sounds). In general, it's not a trivial task; you can get a partial understanding of it here: http://psatkha.narod.ru/tutorial_ru.html. I'm not sure if it's worth the effort; it's practically impossible to adequately voice over videos at home, and then you have to struggle and learn how to insert them.
In reply to Ment
User Avatar
10 years ago
Auto-translated
function Objective() StartDialogScene("/DialogScenes03/New Object03/DialogScene.xdb#xpointer(/DialogScene)"); end; Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER,"obj1","Objective"); What's wrong with this code? :confused: It completes the mission, but doesn't play the cutscene.
User Avatar
10 years ago
Auto-translated
the mission is completed, but the video doesn't play.
I think it works like this: it first completes the mission and then plays the video. These things have a higher priority than scripts and are executed first. You need to make it so that the task doesn't complete the mission, play the video, wait a bit (using the sleep function), and then complete the mission using the script function Win() (I think it's with a capital letter, but I'm not sure, check me).
In reply to Ment
User Avatar
10 years ago
Auto-translated
function Objective()
StartDialogScene("/DialogScenes03/New Object03/DialogScene.xdb#xpointer(/DialogScene)");
sleep(20)
Win()
end;

Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER,"obj1","Objective");
It doesn't work. The quest is completed, but the cutscene doesn't play. And I have two questions:
1) How do I make it so that after completing the quest, a cutscene plays, and I can continue playing and completing other quests?
2) How do I make it so that after completing the quest, a cutscene plays, and I win?
These two things are really bothering me:confused:
User Avatar
10 years ago
Auto-translated
How do I make it so that after completing a quest, a cutscene plays, and I can continue playing and completing other quests?
Don't write win.
How do I make it so that after completing a quest, a cutscene plays, and I win?
Write win ;)
I don't know why it's not working. There could be many potential errors – this could be due to uppercase/lowercase letters (the game perceives them differently), or slashes in StartDialogScene (I'm not sure if this is the right direction to look). What does the console say?
In reply to Ment
User Avatar
10 years ago
Auto-translated
The code was working, but for some reason, the task name didn't exist. Or rather, it was written in the Properties Tree, and the same was written in the script, but the console said that the task didn't exist. In the end, I copied the task name from the code, put it in the Properties Tree, and everything worked :D (perhaps the code was written in English, and the Properties Tree was written in American English, or vice versa).
Thank you very much; there are no more limits to creativity now.
User Avatar
10 years ago
Auto-translated
Could you please advise on how to create a hero commander specialization that grants +1 to defense and attack for every 2 levels for a specific creature? I couldn't find the original files for commander specializations, so I assume it needs to be implemented through a script.
In reply to xv13
10 years ago
Auto-translated
Could you please provide information on how to configure mission objectives using scripts?
User Avatar
10 years ago
Auto-translated
Oh, wise experts, please tell me how to display a message to the player on the FIRST day of the game? I tried to do it using:
Trigger(NEW_DAY_TRIGGER, "new_day" );
function new_day()
if GetDate(DAY) == 1 then
MessageBoxForPlayers(PLAYER_1,GetMapDataPath().."hello.txt");
end;
end;
But, unfortunately, it doesn't work =( When I change the day to the second, the message is displayed.
User Avatar
10 years ago
Auto-translated
Because the trigger activates when a certain event occurs. And the first day of the game doesn't "arrive," but rather starts from the very beginning. You just need to
MessageBoxForPlayers(PLAYER_1,GetMapDataPath().."hello.txt");
and that's it.
User Avatar
10 years ago
Auto-translated
function kill_army() a=14 while a>13 do MakeHeroInteractWithObject('Arantir','altar1') sleep(2) a=1 for i=1,119 do a=a+GetHeroCreatures('Arantir',i) end if a>12 then do StartAdvMapDialog(2) sleep(2) end end end StartAdvMapDialog(3) ``` Here's a snippet of a function, and I want the following to happen:
The hero is offered to sacrifice his army at the altar.
Then, a check is performed on the number of creatures in the hero's army.
If there are more than 12, dialog(2) is triggered.
If not, dialog(3) is triggered.
The problem is that the hero only starts interacting with the altar, and the program has already managed to count his army and, after the sacrifice, shows dialog(2). How can I make the check for the number of creatures run after the hero sacrifices his army?
User Avatar
10 years ago
Auto-translated
Medyan, you described everything rather vaguely. If you need
if there are more than 12, then a dialog is triggered (2); if not, then dialog (3)
, then the code should be
if a>12 then
StartAdvMapDialog(2)
else
StartAdvMapDialog(3)
end
. If the check for the number of creatures should be performed after interacting with the altar, then it should be written in the handler for clicking on the altar.
10 years ago
Auto-translated
I need help creating a script that will grant all the skills available in the game. I saw something like this in the map "Elven Song"; if you type @gsall skillsall artefacts, the main hero receives all skills and artefacts. However, I only need the skills. I can't open the map in the editor because it's not in the map folder. And yes, people still play Heroes 5 in 2016. Also, if possible, can this script be made to work on all maps? I mean, through @DoFile. Although then I would have to edit the script file every time, because Heroes has different script names... But the commands like add_skill and others work on the selected hero, so I want to make the script work on the selected hero. I hope this is possible. In any case, thank you in advance for your help; I will be waiting for a response.
In reply to xxxRustamxxx
User Avatar
10 years ago
Auto-translated
xxxRustamxxx
I need help with creating a script that will grant all the skills available in the game. I've seen this in the "Elven Song" map; if you type @gsall skillsall artefacts, the main hero receives all skills and artifacts. But I only need the skills. I can't open the map in the editor because it's not in the maps folder. And yes, people still play Heroes 5 in 2016. Also, if possible, can this script be made to work on all maps? I mean, through @DoFile. Although then I would have to edit the script file every time, because Heroes has different script names... Well, the add_skill command and others work on the selected hero, so I want to make the script work on the selected hero. I hope this is possible. In any case, thank you in advance for your help; I will be waiting for a response.
You can do it like this:
for i=1,3 do
for j=1,220 do
consoleCmd('add_skill ' .. j)
end
end
This will grant all skills to the selected hero. You can save the script to a file and call it using doFile.
10 years ago
Auto-translated
Thank you very much! I just had an idea for a map. The map I want to create is called "Elrath's Revenge." The plot: During a council of gods, it was discovered that the number of people who worship Elrath is dwindling. If this continues, Elrath will be completely forgotten, and he will no longer be a god! Elrath is very unhappy about this and decides to descend to the mortal realm in the form of an archangel named Ratiel. But as soon as he descends, he sees something terrible... Demons are capturing Elrath's subjects, his people, and taking them to Sheol. Why and for what purpose, Elrath himself must find out...
P.S. A script is needed for the main character; he's basically a GOD and should be able to do everything. I wanted to create a map with NCF creatures. Elrath's army will have 10 Guardian Angels and 15 regular angels. I think the idea is good, but it will be very difficult to implement. I already tried to give the hero an angel model and inserted an animation set for him, but he doesn't use the animations I assigned to him. He just does everything in a T-pose...

Added 1 minute ago
I actually want to make a campaign; this is just the first mission, the "War of the Gods" campaign. I'm not sure if I have enough patience....

Statistics

Welcome our newest member: recijeb