Current time: 15.10.2018, 22:47 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
ERA II
» WoG Era 2: Русская и Английская версии
Author Message
Valery Offline

Posts: 1919
Post: #3706

Yes, but not working until I CLICK on something (then it updates), so I needed something special, then Jim came with TL and UN:C


Era mods and utilities
(This post was last modified: 08.01.2018 01:03 by Valery.)
08.01.2018 01:02
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 10634
Post: #3707

The problem seems familiar to me, show me the code please. Do you call UN:R right after DL:S?


Скачать Герои 3 Эра и всё, что с ней связано
08.01.2018 01:56
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 1919
Post: #3708

For example I give hero x levels then I close dialog. Before dialog closes, I get the vanilla level up box, until the end, then dialog closes and stats are unchanged on map. When I click anywhere, stats now update.



Era mods and utilities
(This post was last modified: 08.01.2018 02:06 by Valery.)
08.01.2018 02:02
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 10634
Post: #3709

!!UN:R1; must be after DL:S command. Make variable like 'UpdateAfterDlg' and after !!DL:S check it. If update is necessary, call !!UN:R1. You cannot update while dialog is still opened. You must update after dialog is fully destroyed.


Скачать Герои 3 Эра и всё, что с ней связано
08.01.2018 04:09
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 1919
Post: #3710

Yeah, thats why the TL. UN:R does simply not work if changes are done within dialog, tried everything. Is like updating battlefield from dialog, needs a special SN or UN:C


Era mods and utilities
08.01.2018 04:18
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 10634
Post: #3711

Val, where is your DL:S command? Update must be right after it.


Скачать Герои 3 Эра и всё, что с ней связано
08.01.2018 06:37
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 1919
Post: #3712

DL:S opens dialog, DL:C closes it. So it is after closing, I have no idea how to use this other way.


Era mods and utilities
(This post was last modified: 08.01.2018 07:04 by Valery.)
08.01.2018 07:02
Find all posts by this user Quote this message in a reply
RoseKavalier Offline

Posts: 18
Post: #3713

In plugin I simply call 0x417380 (redraws everything on adventure map) after dialog is closed, it updates with no issues.
I don't know if you can call a function from ERM with arguments but it's basically:

Code:
__thiscall([0x6992B8], 1, 0) ~~~

__asm{
    MOV ECX, DWORD PTR DS : [0x6992B8]
    PUSH 0
    PUSH 1
    MOV EAX, 0x417380
    CALL EAX
}

I guess it may be the same function... ERM noobie 118

EDIT: according to WoG source, it's partial use of 0x417380 function so it may be missing something.

Code:
void RedrawMap(void)
{
  #include "templ.h"
  __asm{
    mov    ecx,0x6992B8
    mov    ecx,[ecx]
// ïåðåðèñîâûâàåò ýêðàí advanture
// ecx -> advManager
    mov    ecx,[ecx+0x44]
// âûëåòàåò, åñëè íóëü
    or     ecx,ecx
    je     l_not
   push   ecx
    push   1
    push   1
    push   0xFFFFFFFF
    mov    eax,0x4032E0
    call   eax
   pop    ecx
    push   1
    push   1
    push   0xFFFFFFFF
    mov    eax,0x403420
    call   eax
// ïåðåðèñîâûâàåò ïðàâîå íèæíåå îêíî êàðòû
    mov    ecx,0x6992B8
    mov    ecx,[ecx]
//    mov    ecx, -> advManager
    push   1
    push   1
    push   1
    mov    eax,0x415D40
    call   eax
  }
l_not:;  
  RETURNV
}
(This post was last modified: 08.01.2018 08:50 by RoseKavalier.)
08.01.2018 08:35
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 10634
Post: #3714

Valery, DL:C simply sets variable to close dialog, but does not close immediately. I do not see any DL:S in your code (((

RoseKavalier, yep, thanks. In ERM it's !!UN:R1, but "right after close" is right after calling Dialog Show (!!DL:S) in ERM. Val is trying to call redraw IN EVENT HANDLER, not after dialog is closed.


Скачать Герои 3 Эра и всё, что с ней связано
08.01.2018 16:32
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 1919
Post: #3715

Well of course there is a DL:S because I need to open the dialog))

Here is short version of what is done when level is modified:



Then modify stats



And finally close:


So I modify stats, close dialog, but now in map to see any change I have to click somewhere, otherwise it shows same values as before. An update problem./


Era mods and utilities
08.01.2018 16:43
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 10634
Post: #3716

!!DL550:S1;
Insert update command right after it. It may be enclosed in condition. If SHOULD_UPDATE then update. Any global variable with suit.

!!DL:S
!!if (some update w-var is set)
    ; update!
!!en:;


Скачать Герои 3 Эра и всё, что с ней связано
08.01.2018 16:48
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 1919
Post: #3717

Now thats silly, it works. I can't still get the mechanics of why it works, but it works, all updated. Thanks a lot.

Final version of trainer uploaded.


Era mods and utilities
(This post was last modified: 08.01.2018 17:08 by Valery.)
08.01.2018 17:05
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 10634
Post: #3718

It's not silly, because !!DL:C does not close dialog, but only marks it for closing. Dialog is still on the screen. After all !?DL triggers execution WoG will close dialog. So you call update while dialog is still on the screen. Real updates can be performed after DL:S command. Here all !?DL triggers already executed, dialog is closed and you are free.


Скачать Герои 3 Эра и всё, что с ней связано
08.01.2018 17:18
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 1919
Post: #3719

I see (for me still doesn't make sense as the command to update is done before any action took place, but I don't know the internals). Is interesting that Jim didn't see this, then went into TL triggers which made the mod very unstable.


Era mods and utilities
(This post was last modified: 08.01.2018 17:22 by Valery.)
08.01.2018 17:21
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 10634
Post: #3720

Jim likes to experiment )


Скачать Герои 3 Эра и всё, что с ней связано
08.01.2018 18:29
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-2018 MyBB Group