Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to Ment
User Avatar
16 years ago
Auto-translated
Ment
Okay, I figured it out! Turns out I'm quite the idiot! :) I was creating text files in Notepad, but I should have been using the game's editor. They probably use different encodings.

Added 2 minutes ago
It's not possible, it's a certainty.
So, I'm just asking, did it work for everyone? :)
By the way, I use Notepad, and you need to set the encoding to UTF-8. ;)
Also, is there a script editor? Or are you already aware of its existence?
Here's a link: http://hmm5.sklabs.ru/
User Avatar
16 years ago
Auto-translated
Froska
By the way, I use Notepad, and you need to set the encoding to UTF-8 there.

Oh, why make it so complicated... just use an editor. I created the text in the CustomGoal tab, then deleted the line and saved it. You might find it easier to use Notepad, but beginners will get confused.
In reply to Ser9K
User Avatar
16 years ago
Auto-translated
Ser9K
Oh, why make it so complicated... just use the editor and all that. I created the text in the CustomGoal tab, then deleted the line and saved it. Of course, it's easier for you to use Notepad, but beginners will get confused.
That's also true. It's best to use the script editor, which I linked to.
By the way, be careful with this editor. It can mess up the entire map or changes. Make backups of the map more often.
User Avatar
16 years ago
Auto-translated
Froska, regarding the link... Could you provide the full link so I can download it right away? There's a lot of information there, but I can't find the file anywhere. :)
P.S. I'm accessing the site from my phone. I don't have any other option.
In reply to Ment
User Avatar
16 years ago
Auto-translated
Ment
Froska, regarding the link... Could you provide the full link so I can download it right away? There's a lot of information there, but I can't find the file anywhere. :)
P.S. I'm accessing the site from my phone. I don't have any other option.

Well, the link is right there.
Here, since you need it
User Avatar
16 years ago
Auto-translated
How do you create text files in the editor? Is it possible to edit the script text not in the editor, but in Notepad?
User Avatar
16 years ago
Auto-translated
How do you create text files in the editor?
You can create text files in Notepad and then put them in an archive.
User Avatar
16 years ago
Auto-translated
Some objects on the map have a "Scripts" tab in their parameters. Can scripts be written there, or is it only possible to do so in "Map Properties"?
User Avatar
16 years ago
Auto-translated
it is possible...
16 years ago
Auto-translated
I recently downloaded a manual from the author: ogo. And I realized that the first thing he teaches is exactly what I need. But for some reason, the script doesn't work. I named the region the same way. I can't figure out what the problem is. I enter the region, and nothing is displayed...

Here is my script.

function kamillaF()
Trigger (REGION_AND_STOP_TRIGGER, "kamilla", nil );
MessageBox ("/Maps/SingleMissions/Island_Triads/text1.txt");
end;
User Avatar
16 years ago
Auto-translated
Where is (!?!) - Trigger( REGION_AND_STOP_TRIGGER, "kamilla", "function name (in your case, kamillaF)" ); which should be placed after end; or at the end of the script. The manual from ogo is good, but first, read the manual from the developers on scripting functions, where they describe everything in detail. The manual for Hammers of Fate is in Russian.
16 years ago
Auto-translated
Ser9K, I don't really want to delve into studying scripts. I just want to understand what my mistake is. Could you please edit my script? =)
P.S. I also wanted to add (SetPlayerStartResources 1,0,0,0,0,0,0,0); but I don't know how to do it anymore..

function kamillaF()
Trigger(REGION_AND_STOP_TRIGGER, "kamilla", nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text1.txt");
Trigger(REGION_AND_STOP_TRIGGER, "kamilla", "kamillaF");
end;
function aF()
Trigger(REGION_AND_STOP_TRIGGER, "a1", nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text2.txt");
Trigger(REGION_AND_STOP_TRIGGER, "a1", "aF");
end;
In reply to Valeonos
User Avatar
16 years ago
Auto-translated
Valeonos
Ser9K, I don't really want to delve into studying scripts. I just want to understand what my mistake is. Can you edit my script, please? =)
P.S. I also wanted to add (SetPlayerStartResources 1,0,0,0,0,0,0,0); but I don't know how to do it anymore..

function kamillaF()
Trigger(REGION_AND_STOP_TRIGGER, "kamilla", nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text1.txt");
Trigger(REGION_AND_STOP_TRIGGER, "kamilla", "kamillaF");
end;
function aF()
Trigger(REGION_AND_STOP_TRIGGER, "a1", nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text2.txt");
Trigger(REGION_AND_STOP_TRIGGER, "a1", "aF");
end;
The script will be approximately like this:

SetPlayerStartResources(PLAYER_1,0,0,0,0,0,0,0);
--
function kamillaF()
Trigger(REGION_AND_STOP_TRIGGER, "kamilla", nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text1.txt");
end;
--
Trigger(REGION_AND_STOP_TRIGGER, "kamilla", "kamillaF");
--
function aF()
Trigger(REGION_AND_STOP_TRIGGER, "a1", nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text2.txt");
end;
--
Trigger(REGION_AND_STOP_TRIGGER, "a1", "aF");
--
User Avatar
16 years ago
Auto-translated
Try to remove the spaces between words and parentheses.

Statistics

Welcome our newest member: recijeb