Current time: 22.04.2024, 16:12 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Ваши вопросы по ERM-скриптам
Author Message
Berserker Online
Administrators

Posts: 16488
Post: #8086

SergOz, штатно программно — нет. А так узнать у igrik-а название def-а, где хранятся кадры и подменить нужный кадр через png.


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

Posts: 1292
Post: #8087

igrik , выручай! 119
Мне даже не столь важна смена картинки - кто там её разглядывает - мне нужно заменить описание способности "Враг".
Функционал способности полностью устраивает. Его менять не нужно.


Карта-мод "Война на Холсте"
25.05.2021 21:43
Find all posts by this user Quote this message in a reply
Berserker Online
Administrators

Posts: 16488
Post: #8088

zcrexp.txt не пробовал менять?


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

Posts: 2814
Post: #8089

А чё за сложность то? Всё же просто))
Деф: DlgExpMon.def
Текст: в zcrexp.txt


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

Posts: 1117
Post: #8090

Interesting, looks like v1 should be avoided in most cases?
When I test Obelisk Rune option (script 35, option 43) on the official scenario Heroes of Might Not Magic (SoD map), there were several ERM error popping out, saying x coordinate was not right.

The code:
Code:
!?PI;
!!UN:P43/?y-1; [Check if script is enabled: y-1]
!!FU&y-1<>1:E; [Exit if script isn't enabled]

!!UN:U57/-1/?y-2; [Number of Obelisks on map: y-2]
!!VRv1:S-1; [Initialize v1 to -1 to work with new faster UN:U syntax]
!!DO5312/1/y-2/1&y-2>0:P; [Loop through all Obelisks to set spell]

!?FU5312;
!!UN:U57/-1/-1/1; [Store next Obelisk coordinates in v1/v2/v3]
!!FU$spell$:P0/0/1/0/1/0; [Determine random non-banned Adventure Spell number: y-99]
!!IF:M^%v1, %v2, %v3, %v4^;[For TESTING]
!!POv1/v2/v3:Sy-99; [Set spell number (S) to y-99 -- will be -1 if all spells banned]

Looks fine to me at the first glance. However, the value returned of v1 was 47379860.

Any idea why this happened?
It was an easy fix after I figure out v1 was the issue. Used v2 instead and everything's fine again.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 26.05.2021 23:35 by Archer30.)
26.05.2021 23:13
Find all posts by this user Quote this message in a reply
Berserker Online
Administrators

Posts: 16488
Post: #8091

v1 is global shared variable. Global shared variables should be avoided.
v1 in changed in many triggers and in any SN:E command
replace v1/v2/v3 with v2/v3/v4 whenever possible


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

Posts: 1117
Post: #8092

Thank you, Berserker. That explains. Any other variable like v1 that scriptwriters should always avoid?


Latest ERA mods and scripts in development - My GitHub
26.05.2021 23:34
Find all posts by this user Quote this message in a reply
Berserker Online
Administrators

Posts: 16488
Post: #8093

Any global shared variable.

Say, use use v2/v3/v4, then you call almost any ERM command like UN:I/O, or any ERM function. Be prepared, that there is some OnObjectCreate/Delete event where another scripter will reuse those v2/v3/v4 for his own purposes. Local variables go for aid )


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

Posts: 1117
Post: #8094

Strange. After shifting v-vars to +1, the script run well on Heroes of Might Not Magic, but the same issue happened on All for One (RoE scenario). x coordinate was wrong on one of the obelisk (returned -1).

Things are getting confusing. The v-var for x coordinate was set in !!UN:U, why it has to change before !!PO:S?

I tried with v3/v4/v5, problem's gone, but still wondering the reason of it. 102


Latest ERA mods and scripts in development - My GitHub
27.05.2021 02:06
Find all posts by this user Quote this message in a reply
Berserker Online
Administrators

Posts: 16488
Post: #8095

Insert anywhere !!SN:F^GenerateDebugInfo^; after loop and inspect erm tracking.erm. You'll see all executed commands. Maybe some command changed v2.


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

Posts: 1292
Post: #8096

Berserker, igrik, спасибо. Сейчас далеко от компа. Приеду буду разбираться.


Карта-мод "Война на Холсте"
(This post was last modified: 28.05.2021 00:03 by SergOz.)
27.05.2021 11:40
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1117
Post: #8097

Berserker, I found the cause.

I forgot to change the v1 initialization to v2 Sorry
Code:
!!VRv1:S-1;


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 27.05.2021 17:34 by Archer30.)
27.05.2021 13:10
Find all posts by this user Quote this message in a reply
Berserker Online
Administrators

Posts: 16488
Post: #8098

Archer30, ok )


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

Posts: 1012
Post: #8099

Здравствуйте..

А как можно запретить артефакт командирский передать командиру?

Я очень бы хотел запретить артефакт 149 (шлем бессмертия) вставлять в командира? Что-то не могу додуматься как это вообще сделать?
(This post was last modified: 28.05.2021 20:34 by fatsawhorse.)
28.05.2021 20:29
Find all posts by this user Quote this message in a reply
SergOz Offline

Posts: 1292
Post: #8100

fatsawhorse, так же как и другие арты: через !!UN:A назначаешь ему позицию на теле героя или в рюкзак.


Карта-мод "Война на Холсте"
28.05.2021 23:08
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