Current time: 22.11.2024, 07:13 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
ERA III
Author Message
Berserker Offline
Administrators

Posts: 16657
Post: #2296

Got it. The second issue is solvable on library level.



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

Posts: 1175
Post: #2297

Yea, that's solvable but that means all those pop-ups have to be remade. Nothing similar can be done in ERA like the OnAdvMapTileHint event?

Assuming the answer is negative. Can you give some hints about manipulating the Witch Hut RMB pop-up, like where to hook and how to replace the original hint?


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

Posts: 16657
Post: #2298

Nope, any solution will lead to code rewrite. You cannot force authors to use new API instead of unique IF:M/Q/Custom dialog popup.
Doesn't CM:R work for witch huts?


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

Posts: 2196
Post: #2299

Seer huts mod works only partially in 3.9.5. Dialog with huts and border gates shows fine, seer huts work as their position is stored in v6-v8 but border guards position is stored in v1-v3 and gets corrupted, no idea why...

I will try to change variables, but I don't remember very well how I coded the whole thing, was years ago Mad
Note to myself, always put detailed comments to scripts for 50 years later.

Would help to know what changed, is v1-v3 handling different now? I am not even sure it is about those variables, maybe something else. Works fine on 3.0. Is it possible that when closing a DL now changes v1-v3?
(This post was last modified: 07.07.2023 01:39 by Valery.)
07.07.2023 01:33
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #2300

v1 is used heavily for external function calls (SN:F, SN:E store result in v1). I would start trying to change v1..v3 to v2..v4 or v600.v602. Paste here of piece of code if it does not work.


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

Posts: 4343
Post: #2301

Berserker, about pyramid's WoG objects
0040C577 - Lohook here for hint
00414F3C - hook here for rmc

Or just HiHook both hint handlers and create new Triggers
Cause the native hints works with better way imo


Image: widget.png?style=banner2

Новейший Heroes Launcher
07.07.2023 06:22
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2302

(07.07.2023 02:27)Berserker Wrote:  v1 is used heavily for external function calls (SN:F, SN:E store result in v1). I would start trying to change v1..v3 to v2..v4 or v600.v602. Paste here of piece of code if it does not work.


Well, from my tests closing the dialog corrupts v1-3. Here is the part of script storing quest guards coordinates



v1-v3 are not used in any of the additional actions, then when I close the dialog


I used debug messages and v1-v3 changes exactly when I press close dialog. Those scripts were modified now to v6-v8 and that fixed it. However now I should check all the mods using DL, unless there is another explanation which I can't find.
07.07.2023 15:18
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #2303

You close the dialog by pressing "Enter" key, which generates OnKeyPressed event. Any script, using v1..v3 may scree them. I thought we had "keyboard fixed.erm" script in many of your mods, saving v1..v10(?) before the first OnKeyPressed handler and restoring after.


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

Posts: 1175
Post: #2304

There is a small issue with IF:D/E receivers

Many WoG scripters wrote their script by using 0 as the parameter for "nothing", like this one from the Emerald Tower script:
Sometimes they put nothing in it (Espionage script):

Most of the time these are ok. however, when you have another IF:D/F/E dialogue using the same dialogue ID, the problem comes. For example, execute this before the emerald tower script:
and you will see the Emerald Tower dialogue corrupted because both this script and Emerald Tower use the same dialogue ID 3.

This should not happen in ERA 3! We are free from remembering the used variable index, so should dialogue IDs.
I suppose ERA should support "0" or "nothing input" in IF:D/F for clearing the cache created in the previous erm executions.

Quote:Doesn't CM:R work for witch huts?
It does but when I have two IF:M from two different scripts, I can't disable one by CM:R0. Anyway think I have a solution.


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

Posts: 16657
Post: #2305

Afair, there is no «cache». IF:D/F settings are just stored in global static arrays. Thus valid code should either use high level API or clear/overwrite the whole 16 parameters before showing dialog.
I would use ID = 1 in ERM Api, like it's done in RadioDlg_Show. Or, maybe, if GET syntax is supported, higher level API should save/restore DLG 1 settings.

See how RadioDlg_Show is implemented in EEF.


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

Posts: 1175
Post: #2306

Quote:IF:D/F settings are just stored in global static arrays. Thus valid code should either use high level API or clear/overwrite the whole 16 parameters before showing dialog
Yup. If I understand your idea correctly, these examples from WoG Scripts can be fixed by:
It's fixable in the erm. Yet kinda clumsy in syntax. As I see those WoG scripters already treated 0 as a valid initialization. It would be good to support that usage.


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

Posts: 16657
Post: #2307

As far as I see from erm.cpp and service.cpp the first time you call IF:D/F for certain dialog ID changes that dialog ID from UNSET to SET. The first time 0 works as empty string, the second time as "do not change".

Both IF:D3 and IF:F call the same function, but IF:F passes the first 10 arguments as 0. Because IF:F is called after IF:D, dialog is initialized and 0 is treated as "do not change".
I recommend something like:


Otherwise implement higher level api.


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

Posts: 1175
Post: #2308

Well then I've already replace those with 0 with ^^ in scripts to make sure they don't have compaitiblity issue.

Any finding for SN:R replacing def frame with given png?


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 08.07.2023 15:41 by Archer30.)
08.07.2023 13:59
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2309

Bersy, I finished test, all fine. Would it be possible to add to the package Igrik's 2 plugins for battle replay -and battlesave)? I uploaded them here :

https://easyupload.io/rq0te9

I will wait for a link to final 3.9.5 then I will create a second link on my side too. Thanks
14.07.2023 04:52
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #2310

Quote:Bersy, I finished test, all fine.
Great news!

Battle Replay plugin usually needs ERM support for complex scripts/mods (special events like OnBeforeBattleReplay were added) because !?BA trigger handlers usually change global variables, which are not reverted by plugin. igrik, daemon_n and Archer fixed many wog scripts to support replays. So your custom maps logic may be broken after the first replay. I think BattleSave plugin is much safier.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
14.07.2023 13:25
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