| Valery   
   Posts: 2196
 
 | 
			| 
 
				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
			 |  | 
	| 08.01.2018 04:18 |  | 
	
		| Berserker   
   
   Posts: 16785
 
 |  | 
	| 08.01.2018 06:37 |  | 
	
		| Valery   
   Posts: 2196
 
 | 
			| 
 
				DL:S opens dialog, DL:C closes it. So it is after closing, I have no idea how to use this other way.
			 
				
(This post was last modified: 08.01.2018 07:04 by Valery.)
 |  | 
	| 08.01.2018 07:02 |  | 
	
		| RoseKavalier   
   Posts: 118
 
 | 
			| 
 
				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    
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 |  | 
	
		| Berserker   
   
   Posts: 16785
 
 |  | 
	| 08.01.2018 16:32 |  | 
	
		| Valery   
   Posts: 2196
 
 | 
			| 
 
				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./
			 |  | 
	| 08.01.2018 16:43 |  | 
	
		| Berserker   
   
   Posts: 16785
 
 |  | 
	| 08.01.2018 16:48 |  | 
	
		| Valery   
   Posts: 2196
 
 | 
			| 
 
				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.
			
				
(This post was last modified: 08.01.2018 17:08 by Valery.)
 |  | 
	| 08.01.2018 17:05 |  | 
	
		| Valery   
   Posts: 2196
 
 | 
			| 
 
				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.
			 
				
(This post was last modified: 08.01.2018 17:22 by Valery.)
 |  | 
	| 08.01.2018 17:21 |  | 
	
		| Berserker   
   
   Posts: 16785
 
 |  | 
	| 08.01.2018 18:29 |  | 
	
		| gamecreator   
   Posts: 7107
 
 |  | 
	| 08.01.2018 19:50 |  | 
	
		| feanor   
 Posts: 624
 
 | 
			| 
 
				 (07.01.2018 02:31)Berserker Wrote:  При отвязке от карты появляются возможности для единообразного добавления скриптов на Lua, можно распространять ресурсы отдельно (не только скрипты), можно применять оптимизации (в 2.55 загрузка гораздо быстрее, так как ЕРМ остаётся тем же в большинстве случаев загрузки). +Часть багов связана именно с поддержкой событий карт.Современные карты-моды распространяются в виде модов, поскольку и писать ЕРМ в событиях, мягко скажем, неудобно, и отлаживать в карте невозможно без рестарта.
 
а) легаси. Много мелкого легаси. 
б) распространение ресурсов отдельно - минус, а не плюс.   
в) ориентация на картомоды, которых считанные единицы, вместо карт с полутора снипплетами (отключение командиров etc), я полагаю, неверна.
 
Ну и принуждение к удобству..ну такое. 
 
Компромиссным вариантом была бы выгрузка скриптов (при их наличии) из файла карты с папку перед загрузкой
			 |  | 
	| 08.01.2018 21:04 |  | 
	
		| Berserker   
   
   Posts: 16785
 
 |  | 
	| 08.01.2018 23:55 |  | 
	
		| Valery   
   Posts: 2196
 
 | 
			| 
 
				 (08.01.2018 19:50)gamecreator Wrote:  Because your script is paused when you display the dialog. It resumes after the dialog is closed. 
yes I did a test and now I see what you mean. Before I thought that this won't work:
 
!?CM0; 
!!UN:R2; update resources bar 
!!OW:R0/6/d5000; add resources
 
and needs to be 
 
!?CM0; 
!!OW:R0/6/d5000; add resources 
!!UN:R2; update resources bar
 
But in fact it works. Somehow it looks weird to me that it is being updated before script is activated but there is the evidence.
			 |  | 
	| 09.01.2018 04:02 |  |