Skip to content

Posts from Scripts for beginners. Auto-translated

4.5 (2 ratings)
User Avatar
#31
Auto-translated
Okay, I understand. Thanks. I'll try it now.

Added 4 minutes later
And the same applies to Player?
[url=Таверна (фулдилка) - заходите.


User Avatar
#32
Auto-translated
Player - the player whose gold is being checked. 0?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#33
Auto-translated
Understood. Please describe all the functions that need to be modified. Also, I remembered another issue: at the beginning of another player's turn, it displays the same message as the first player when visiting a region.
[url=Таверна (фулдилка) - заходите.


User Avatar
#34
Auto-translated
Is this a multiplayer map? Then things get a bit more complicated.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#36
Auto-translated
There, messages and questions are displayed using another function: MessageBoxForPlayers, QuestionBoxForPlayers. You can find their descriptions in the archive containing the table of identifiers.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to ggroy
User Avatar
#38
Auto-translated
ggroy
Please provide the correct script for a multiplayer map.
It requires replacing a couple of lines.
Messages and questions are displayed there using a different function - MessageBoxForPlayers, QuestionBoxForPlayers. You can find their description in the archive with the table of identifiers.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#40
Auto-translated
Yes, both functions need to be replaced; otherwise, the message or question will be displayed to all players.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#41
Auto-translated
Does anyone know of a script that, upon entering a region, moves the hero (any hero) to another region (or simply to a specified cell)? I need some help.

Added after 48 minutes
And another scripting question. I want a script for a quest where the main objective is to find and bring an artifact to a specified creature. (BUT THE QUEST SHOULD BE THE PRIMARY OBJECTIVE). Please help. I will be eternally grateful.
[url=Таверна (фулдилка) - заходите.


In reply to ggroy
User Avatar
#42
Auto-translated
ggroy
Could anyone suggest a script that, upon entering a region, moves a hero (any hero) to another region (or simply to a specified cell)? I need help.

Added 48 minutes later
And another scripting question. I want a script for a quest where the main goal is: Find and bring an artifact to a specified creature. (BUT THE QUEST SHOULD BE A PRIMARY ONE). Please help. I will be eternally grateful.
1)
function teleport1(hero)
SetObjectPosition(hero, x, y, floor) -- replace x, y, floor with coordinates
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'region', "teleport1")
2) Create a quest in the map properties tree, make it a primary quest, type - MANUAL, IsInitiallyActive and IsInitiallyVisible = false.


function objective_1(hero)
local player = GetObjectOwner(hero)
if GetObjectiveState("quest_name", player) == OBJECTIVE_UNKNOWN then
SetObjectiveState("quest_name", OBJECTIVE_ACTIVE, player)
elseif GetObjectiveState("quest_name", player) == OBJECTIVE_ACTIVE and HasArtefact(hero, artefact_number) then
SetObjectiveState("quest_name", OBJECTIVE_COMPLETED, player)
RemoveArtefact(hero, artefact_number)
end
end

SetObjectEnabled("creature_name", nil)
Trigger(OBJECT_TOUCH_TRIGGER, "creature_name", "objective_1")
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#43
Auto-translated
Thank you, the first script works perfectly, thank you very much.
I'm trying to figure out the second one.
Here's another request:
Tell me a script (task) where, upon touching a specified object, a specified other object disappears. (SECONDARY TASK)

Added 1 minute ago
And what is the task name?
[url=Таверна (фулдилка) - заходите.


User Avatar
#44
Auto-translated
What is the name of the task?
The name of the task is written in the Name field.
object
Seriously?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#45
Auto-translated
Added 33 minutes later
Could you add, to the script with the quests, that when attacking a creature (that gives quests), a dialogue would play? Please explain everything in detail, step by step. Please help.
[url=Таверна (фулдилка) - заходите.