Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to }{0TT@6bI4
#3459
Auto-translated
What do pl1gold and delta mean? And how can I fix the error "Invalid file, not a PKZip file" when saving scripts?
User Avatar
#3460
Auto-translated
For tank players: in the first line, I declared the variable pl1gold (player 1 gold), and saved the amount of resources the player has in it, because the GetPlayerResource function returns this value. Delta – I already explained this; it’s the change in resources. To reduce the amount of gold by 100 (for example), you need this structure: SetPlayerResource(PLAYER_1, GOLD, GetPlayerResource(PLAYER_1, GOLD) – 100).
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#3461
Auto-translated
While the map is open in the editor, the script editor cannot save anything. Close the map in the regular editor and save it.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
#3462
Auto-translated
SetObjectEnabled("fort", false); function fortF() pl1gold = GetPlayerResource(PLAYER_1, GOLD); if pl1gold >= 2999; then SetPlayerResource(PLAYER_1, GOLD, pl1gold – 2999); SetObjectEnabled("fort", true); end; end; Trigger(OBJECT_TOUCH_TRIGGER, "fort", "fortF"); It should take money from the player and activate the Fortress, but something seems to be wrong with the line containing 'then'. It says, 'then' expected near ';'. Also, it breaks all previous scripts. Can you tell me what's wrong? Thank you.
Attachments 1
1 file attached • Total size: 125.5 KB
In reply to Святoслав
User Avatar
#3463
Auto-translated
Svyatoslav
SetObjectEnabled("fort", false);

function fortF() 
    pl1gold = GetPlayerResource (PLAYER_1, GOLD);
    if pl1gold >= 2999;
      then SetPlayerResource(PLAYER_1, GOLD, pl1gold – 2999);
      SetObjectEnabled("fort", true);
    end;
end;

Trigger(OBJECT_TOUCH_TRIGGER, "fort", "fortF" );

It should take money from the player and activate the Fortress, but something doesn't seem right in the line with 'then'.
'then' expected near ';' it says.
And it also breaks all previous scripts.

Can you tell me what's wrong?


SetObjectEnabled("fort", false);

function fortF() 
    pl1gold = GetPlayerResource (PLAYER_1, GOLD);
    if pl1gold >= 2999 then
      SetPlayerResource(PLAYER_1, GOLD, pl1gold – 2999);
      SetObjectEnabled("fort", true);
    end;
end;

Trigger(OBJECT_TOUCH_TRIGGER, "fort", "fortF" );
 

К А
Стикеры GBF в Telegram
In reply to Ment
#3464
Auto-translated
Ment
SetObjectEnabled("fort", false);

function fortF() 
    pl1gold = GetPlayerResource (PLAYER_1, GOLD);
    if pl1gold >= 2999 then
      SetPlayerResource(PLAYER_1, GOLD, pl1gold – 2999);
      SetObjectEnabled("fort", true);
    end;
end;

Trigger(OBJECT_TOUCH_TRIGGER, "fort", "fortF" );

Something still doesn't work...
The 10th green one was enabled.
Attachments 1
1 file attached • Total size: 85.3 KB
User Avatar
#3465
Auto-translated
The incorrect value is displayed; delete it and enter it again.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
#3466
Auto-translated
Thank you. And where should I put the file with the text for the MessageBox, or how do I create it?
User Avatar
#3467
Auto-translated
In the script editor, click on the desired folder and select File => New *.txt.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#3468
Auto-translated
Thank you very much for your help with the cycle, }{0TT@6bI4. I apologize for the late response (I was away).
In reply to Andrei_21
User Avatar
#3469
Auto-translated
Hello, dear mapmakers. Could you please tell me the command that teleports a player to specific coordinates? Thank you very much in advance!
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3470
SetObjectPosition("Имя героя", x, y, floor)
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to Святoслав
User Avatar
#3471
Auto-translated
Hello, dear mapmakers. I need your help with a script:
function vedma1()
if SetObjectiveState("vedma1", OBJECTIVE_COMPLETED) then
StartDialogScene('/MoiDialogi/Vedma1/DialogScene.xdb#xpointer(/DialogScene)');
SetObjectiveState("vedma2", OBJECTIVE_ACTIVE);
end;
end;
The game doesn't show any errors, but the video doesn't play. I checked the video separately, and it works. The quest itself works without the functions. Can you tell me what's wrong?
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3472
Auto-translated
The condition isn't `if SetObjectiveState then` (the function itself doesn't return any value other than `nil`, so the condition isn't met), but rather `if GetObjectiveState("vedma1") == OBJECTIVE_COMPLETED then`.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#3473
Auto-translated
Flame Crystal

if SetObjectiveState("vedma1", OBJECTIVE_COMPLETED) then

You have an error here. The `if` statement checks conditions, while `SetObjectiveState`/`SetObjectPosition`/`SetObjectOwner`, etc., change them. In this example, `if` only works with `GetObjectState`/`GetObjectPosition`/`GetObjectOwner`, etc.

Statistics

Welcome our newest member: Emil