Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
Good day. Could you please tell me how to make it so that a dialogue is only triggered for the player who activated it? I'm playing as the second player, I skip my turn, and the dialogue for the first player is triggered (the bot entered the dialogue zone).
User Avatar
Auto-translated
function Dialog(hero) if GetObjectOwner(hero) == player number then CODE end; end
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
Auto-translated

I created a function, but it doesn't seem to be working. What's the error?

function Dialog2(hero)
if GetObjectOwner(hero) == 2 then
StartAdvMapDialog(1);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "DialogeNA2", nil)

end;
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "DialogeNA2", "Dialog2");

--

User Avatar
Auto-translated
After Dialog2, a space is not needed. What is the console complaining about?
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
Auto-translated
The console doesn't report any errors; the only message is: "[Hint] Syntax checked" and the date.
User Avatar
Auto-translated
I'm not talking about the log editor. I'm talking about the in-game console!
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
Auto-translated

Console, playing as a player who should have a dialogue:

GiveTurnToNextPlayers before: C WWW N N N N

GiveTurnToNextPlayers after: W C W W N N N N

Al builds town building Graveyard in town Nergal-Sham at(30, 120, 0)

GiveTurnToNextPlayers before: W C W W N N N

GiveTurnToNextPlayers after: W C W N N N

Al builds town building Shield Hall town Svedlund (58, 23, 0)

Al hired hero Svea in town Svedlund for 2500 gold.

Hero Army: CREATURE_DEFENDER - 24, CREATURE_AXE_FIGHTER - 9,

GiveTurnToNextPlayers before: WW C W N N N N

GiveTurnToNextPlayers after: W W W C N N N N



Added 1 minute ago

Console, playing as any other player:

Added map: /Maps/SingleMissions/SS2/map.xab#xpointer(/AdvmapDesc)

Added map: /Maps/SingleMissions/SXL1/map.xdb#xpointer(/AdvMapDesc)

Added map: /Maps/SingieMissions/SecretMap/map.xdb#xpointer(/AdvMapDesc)

Custom game map list constructed in 0.0402976 seconds

Custom game map tags collected in 0.0414282 seconds

Added map: /Maps/RMG/1109-2359-8362-5763/map.xdb#xpointer(/AdvMapDesc)

Added map: /Maps/RMG/8941-6631-1275-6871/map.xdb#xpointer(/AdvMapDesc)

Custom game map list constructed in 0.0414764 seconds Total: custom game map list (63 maps) constructed in 0.128033 seconds

Random mode: generated seed = 1054432040

- as I said - nothing happens

User Avatar
Auto-translated
There should be no space after the function name and before the parentheses. The same applies to the trigger.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
Auto-translated

I don't understand anything at all. I fixed the spaces, and then the console gave an error:

“[Script warning!] Value was NIL when getting global with name Trigge’ (Script) ERROR: attempt to call a nil value”

I added the letter “r” to “Trigge” in the script. The error disappeared, and there are no new messages in the console, but the dialogue is still displayed the same way.

Auto-translated
Whenever I click "edit script" (in map properties), the map editor crashes. I've tried several times, and it still crashes. What should I do?
User Avatar
Auto-translated
Unfortunately, it's impossible to work in it. I used to do it like this: I would open the script editor, quickly type one character, and close everything as fast as possible before it crashed, including the map editor. This is how I created the script file itself, a quick method. Then, I could edit it (the .lua file) using Notepad directly within the map archive. There's also a fan-made script editor; you can search for it online.
 

К А
Стикеры GBF в Telegram
User Avatar
Auto-translated
Hello, is it possible to implement a feature where, upon touching an object, the hero's entire army disappears, leaving only a small portion of the creatures? For example, if a hero has 55 archers, 7 griffins, and 22 peasants, touching the object would leave the hero with only 3 peasants. However, the hero's army is initially unknown; he has been gathering it for weeks, the creatures' upgrades are unknown, and the quantity is also unknown, but after touching the object, he will only have a couple of warriors left. I would be very grateful for any help. (I couldn't come up with anything myself in 2 hours).
User Avatar
Auto-translated
AddHeroCreature("Name", 1, 1)
for i=1, 179(Or however many creature types there are) do
if GetHeroCreatures("Hero Name", i)>=1 then
RemoveHeroCreatures(...)
end;
end;

The hero will be left with 1 peasant.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to Скаут
User Avatar
Auto-translated
Scout

I don't understand what's going on at all. I fixed the spaces, and then the console gave an error:

"[Script warning!] Value was NIL when getting global with name Trigge' (Script) ERROR: attempt to call a nil value"

I added the letter "r" to "Trigge" in the script. The error disappeared, and nothing new appears in the console, but the dialogue is still displayed the same way.

Perhaps the problem lies with the video itself.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
Auto-translated
AddHeroCreature("Name", 1, 1)
for i=1, 179 (Or however many creature types there are) do
if GetHeroCreatures(i)>=1 then
RemoveHeroCreatures(...)
end;
end;

And what needs to be written after RemoveHeroCreatures?

Statistics

Welcome our newest member: Emil