Current time: 23.04.2024, 15:55 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Ваши вопросы по ERM-скриптам
Author Message
Archer30 Offline
Moderators

Posts: 1117
Post: #8161

Hi! Quick question, is there an ERM 2 variants for the custom dialogue variable v999 (ID of items)? something like i^item_id^


Latest ERA mods and scripts in development - My GitHub
20.06.2021 04:28
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16488
Post: #8162

Yeah.
Code:
i^dlg_id^     - for OnCustomDialogEvent
i^dlg_action^ - for any mouse events and OnCustomDialogEvent
i^mouse_item^ - for any mouse events and OnCustomDialogEvent


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
20.06.2021 15:29
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1117
Post: #8163

Berserker, thanks. But still got quesion here, in what situation will i^dlg_action^ be used?

From my tests:
Code:
i^dlg_id^=v998
i^mouse_item^=v999
i^mouse_action^=v1000
i^dlg_action^ doesn't work as a replacement to i^mouse_action^

Another question, how can I create a beautiful dialogue like yours with those arrows for navigation?


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 21.06.2021 02:06 by Archer30.)
20.06.2021 22:28
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16488
Post: #8164

dlg_action and mouse_action differ. CM:S and CM:T

dlg_action allows to handle the following events:

Code:
[+] Event DL/(OnCustomDialogEvent) now receive all mouse/keyboard parameters, accessible via !!CM and tracks clicks outside dialogs main area.
    Check CM:T or i^dlg_action^ value for:
      (DLG_ACTION_INDLG_CLICK)
      (DLG_ACTION_OUTDLG_CLICK)
      (DLG_ACTION_MOUSE_WHEEL)
      (DLG_ACTION_KEY_PRESSED)

    Example:

      !?DL&i^dlg_action^=(DLG_ACTION_OUTDLG_CLICK);
      !!IF:M^You clicked outside dialog!^;

    For (DLG_ACTION_MOUSE_WHEEL) action CM:S or i^mouse_action^ can be one of:
      (MOUSE_WHEEL_UP)
      (MOUSE_WHEEL_DOWN)

    Example:

      !?DL&i^dlg_action^=(DLG_ACTION_MOUSE_WHEEL);
      !!IF:M^Wheel: %i(mouse_action)^; display 1/-1 for wheel up/down

    Keyboard presses in dialog can be handled now using Era Erm Framework:

      !?DL&i^dlg_action^=(DLG_ACTION_KEY_PRESSED)/i^key^=(KEY_Q);
      !!IF:M^Good buy any dialog!^;
      !!DLi^dlg_id^:C(TRUE);

    Added two global variables to Era Erm Framework:
    - i^dlg_action^ with CM:T value (action type). Specially useful for DL-dialog events. See DLG_ACTION_XXX constants.
    - i^dlg_id^ with active DL-dialog ID.

The dialog on screen is a layout in Photoshop. igrik was working on this dialog.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
21.06.2021 05:17
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1117
Post: #8165

Interesting! 132 Never thought about CM:T, there was almost nothing about it from ERM help

____

Another question, looks like name variables are not supported for ert yet?
Code:
Do you wish to teach %(hero:z) Expert %s(trainer_secSkill)?

____

Looks like some DL syntax still relies on standard z var heavily
If you replace z30 with ^^, it doesn't work Dash1


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 22.06.2021 01:55 by Archer30.)
21.06.2021 17:57
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16488
Post: #8166

Nope, declaring variables inside string literals is not supported.

DL:H needs constant memory. ^...^ string is erased after receiver execution.
!!VR(hintPtr:y):Z^^;
!!DL:H.../z(hintPtr)


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
22.06.2021 02:40
Find all posts by this user Quote this message in a reply
helgtla Offline
Moderators

Posts: 300
Post: #8167

   
    Пример: после использования артефакта (размещённого на кукле героя), герой перемещается в определённую локацию. И после этого, для продолжения игры (дальнейшее движение героя по карте приключений), приходится каждый раз нажимать либо мышкой на клавишу "закрыть окно героя", либо нажимать ENTER, либо ESC на клавиатуре. Сама необходимость использования подобной особенности артефакта - возникает довольно часто (практически каждый ход игрока), а потому необходимость постоянно проделывать вышеописанное - немного раздражает.
    И потому повторно попытаюсь спросить: можно ли как-то скриптами принудительно закрыть уже открытое "окно героя" ? Через UN:С , или может есть функция за подобное отвечающая (способная сымитировать нажатие клавиши ENTER, либо ESC.)


Карта-мод: STALKER
22.06.2021 15:06
Find all posts by this user Quote this message in a reply
igrik Offline
Administrators

Posts: 2814
Post: #8168

helgtla, да, есть. Вечером скину пример.


game bug fixes extended.dll || My Plugins || My GitHub
22.06.2021 15:45
Visit this user's website Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1117
Post: #8169

Berserker, thanks! Then I have to mix name variables and y99 (local var with large index) for my strings 112

___

New question - Looks like the VR:V command requires the targeted string to contain exactly an integer and nothing else. Is it possible to extract the number from a string even it's not just a number there?
   
num1 = 0, num2 = 11


Latest ERA mods and scripts in development - My GitHub
22.06.2021 21:55
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16488
Post: #8170

Quote:Berserker, thanks! Then I have to mix name variables and y99 (local var with large index) for my strings
Why?


The second question answer is "you need complex function for that". The function should scan characters, checking their codes to be in 48..57 range (''0'..'9') stopping on non-digit and calling !!FU(Substr) to get numeric part of the string to be further converted to integer.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
23.06.2021 04:51
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1117
Post: #8171

Berserker, I meaned for ert.

Say I want to export my strings from erm to ert, any integer contained in ert has to be standard y-var or v-var, while most of my script can still be written with name vars, right?


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 23.06.2021 05:08 by Archer30.)
23.06.2021 05:08
Find all posts by this user Quote this message in a reply
igrik Offline
Administrators

Posts: 2814
Post: #8172

helgtla, не добился я пока что успеха в закрытии окна героя через ERM. Оказалось всё довольно сложнее. Но я ещё немного попробую сегодня.


game bug fixes extended.dll || My Plugins || My GitHub
23.06.2021 12:24
Visit this user's website Find all posts by this user Quote this message in a reply
helgtla Offline
Moderators

Posts: 300
Post: #8173

igrik, принял. Благодарю за отклик на мою просьбу о помощи в данном вопросе.


Карта-мод: STALKER
23.06.2021 12:46
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1117
Post: #8174

Hi Berserker, just realise I've never read about VR:Z syntax. From the example it seems a bit...old fashioned? It can be easily replaced with VR:S

________

Hi, I'm wondering why do some objects have the same type/subtype, but different def and passability?

How do I place the 1 tile rock (type 147, subtype 0) via UN:I?

Image: u3yZBnB.png


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 26.06.2021 21:52 by Archer30.)
26.06.2021 21:48
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16488
Post: #8175

The first answer is wrong.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
26.06.2021 22:09
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Forum Jump:

Powered by MyBB Copyright © 2002-2024 MyBB Group