Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
Jewily, wow! This is a very useful feature. However, I just tested it and found a strange quirk: it seems to have incorrect resource IDs... Even when spawning a resource by name, it spawns a completely different one.
User Avatar
Auto-translated
I apologize, I didn't notice that. Here it is.
0 - crystal
1 - gem
2 - gold
3 - mercury
4 - ore
5 - sulfur
6 - wood
7 - UNKNOWN
8 - campfire
9 - treasure chest
10 - sea chest
11 - floatsome
12 - UNKNOWN
13 - shipwrecked peasant


Не уходи безропотно во тьму,
Будь яростней пред ночью всех ночей,
Не дай погаснуть свету своему!

Хоть мудрый знает – не осилишь тьму
Во мгле словами не зажжёшь лучей –
Не уходи безропотно во тьму.


                                                                                       
User Avatar
Auto-translated
Could you please explain how bots interact with the Tear of Ashera? Specifically, how does the functionality of finding it work for them? How many map fragments do they need to find to determine its location? Or do they not need the map at all?
In reply to Азгалор
Auto-translated
And could you please tell me, Hottabych? Your manuals don't mention the most important thing – how to delete it completely now? I created a hero. I drew an icon. I didn't like it, so I tried to redraw it, but it didn't work; the icon remained the same. I rewrote the icon files in the MapObjects folder, and they stopped displaying altogether. I deleted them completely, along with the xdb files, and tried to create new icons with the same names. But the new icons and xdb files didn't appear in the MapObjects folder. Is it possible to change the textures, and is it possible to delete this hero at all? If not, wouldn't it be more reasonable to simply put the textures in the Data folder and create objects on the map, so that they can be changed at any time?
User Avatar
Auto-translated
Martha, you can change it; you just didn't understand how. To revert the texture changes, delete its xdb and dds files from the map archive (from data). To export it again, repeat the procedure. The files will reappear in data. If they don't appear, make sure you deleted the old files for this texture (from data), and in the editor, you clicked Resource=>CloseMOD.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
Auto-translated
Hottabych, you are right, CloseMOD, that's the problem. Since I haven't created any new mods, it didn't even occur to me that it was open again. Everything has been added, thank you.
User Avatar
Auto-translated
Each time a map is opened, it leaves a cache in the Folder/Editor/H5Mods/ directory, which remains open in the editor until you click CloseMOD. Essentially, until the next map is opened, all the "missing" files are stored there.

Therefore, in case of any crash, instead of immediately opening a map and checking what has been saved, you should separately copy all the files from /Editor/H5Mods/MapName/.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
Auto-translated
Hottabych, I have a question. Although the textures can now be changed, I noticed that the old textures remain in the Browse Object Link list.
That is, the textures themselves are probably not there, but their names are.
Is there a way to remove them from there – for example, by deleting the character and creating it from scratch, or something simpler? If I can't remove them, my list will eventually become incredibly long, and most of those textures will be non-functional.
User Avatar
Auto-translated
Hello. I wrote the following script:
MainHero = "TestHero";
FirstQuestion = 0;

function TestQuestion( MainHero )
if MainHero == "TestHero" then
if ( GetHeroStat("TestHero", STAT_MOVE_POINTS) <= 99 ) then
if FirstQuestion == 0 then
FirstQuestion = 1;
MessageBox(GetMapDataPath().."TestQuestionInfo.txt");
end;
QuestionBox({GetMapDataPath().."TestWork.txt"; TestWork_mp=100*GetHeroLevel("TestHero")}, "RunRun");
end;
end;
end;

function RunRun()
if GetHeroStat("TestHero", STAT_MANA_POINTS) >= 8 then
ChangeHeroStat("TestHero", STAT_MOVE_POINTS, 100*GetHeroLevel("TestHero"));
ChangeHeroStat("TestHero", STAT_MANA_POINTS, -8);
elseif GetHeroStat("TestHero", STAT_MANA_POINTS) < 8 then
MessageBox(GetMapDataPath().."TestWorkNoMana.txt");
end;
end;

Trigger( NEW_DAY_TRIGGER, "TestQuestion" );

If I agree in the QuestionBox, everything works and there are no errors, but for some reason, if I refuse (i.e., choose the Cancel answer), the console gives me the following error:
"(Script) Error: '=' expected;
last token read: '/ at line 1 in string "DoStringScript"
Script failed, unknown error"

Why is this happening? This isn't the complete script because only one function is automatically launched (another one, I'm launching this one manually), but could the problem be here?

Line 1 in this script looks like this, and it definitely shouldn't be causing an error:
---------------;;;;;;;;;;;;;;;===============

In reply to Азгалор
User Avatar
Auto-translated
Azgalor
Hello.


Why is this happening? This isn't a complete script because only one function is automatically launched (the other one I launch manually), but could the problem be specifically here?

Line 1 in this script looks like this, and it definitely shouldn't be causing any issues:
---------------;;;;;;;;;;;;;;;===============

It might not be immediately obvious, but let's think about it:
If you're getting an error when the action is declined, then the error is in the function that's called when the action is declined. You don't have one. Try adding 'nil' as the last argument in QBox.


Не уходи безропотно во тьму,
Будь яростней пред ночью всех ночей,
Не дай погаснуть свету своему!

Хоть мудрый знает – не осилишь тьму
Во мгле словами не зажжёшь лучей –
Не уходи безропотно во тьму.


                                                                                       
In reply to Jewily
User Avatar
Auto-translated
Jewily
It might not be immediately obvious, but let's think about it:
If you're getting an error when the condition fails, it means the error is in the function that's being called when the condition fails. You don't have that. Try adding `nil` as the last argument in `QBox`.

The error is gone! Thank you very much It's strange; I based it on a `QB` from a developer map with Frida, where she's asked whether to pass through the dwarf garrison. I also looked through the ToE maps, and in the very first map of the campaign, there's also a `QB` without an argument for the failure condition. Or maybe the game is complaining about the third argument because I'm using a variable-transmitter in the text file ``?

In reply to Азгалор
User Avatar
Auto-translated
Azgalor

The error is gone) Thank you very much It's strange, I used the QB from the developer's map with Frida as a basis, where she is asked whether to pass through the dwarf garrison. I also looked through the ToE maps, and in the very first map of the campaign, there is also a QB without an argument for refusal. Or maybe the game is complaining about the third argument because I'm using a variable-transmitter in the text file ""?

To be honest, I haven't analyzed it in such detail, but I had similar errors, and you're probably right: they occur when passing variables to a file. (I opened the script of my map, and there are quite a few messages without refusal functions, but none of them pass data). But, in the case of MessageBox, nothing ever broke for me.


Не уходи безропотно во тьму,
Будь яростней пред ночью всех ночей,
Не дай погаснуть свету своему!

Хоть мудрый знает – не осилишь тьму
Во мгле словами не зажжёшь лучей –
Не уходи безропотно во тьму.


                                                                                       
In reply to Jewily
Auto-translated
Gentlemen, I have a question. Is it possible to add custom music to your character that isn't already in the game? I can't seem to get it to work. The editor creates the xdb file correctly when I try to specify my own file in ogg format, but the music doesn't play in the game. Has anyone tried doing this? Maybe the ogg file needs to be placed in a specific folder?

Statistics