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

Post Reply 
Threaded Mode | Linear Mode
Тюрьмы героев. Общая тема
» Prison&Hero - all question about it..
Author Message
Katarina Offline

Posts: 37
Post: #16

(20.07.2014 02:56)Valery Wrote:     If I recall right, the prisoners are not reset once you delete the prison, so AI or you may find some hero level 50 in tavern. I would check first is there is one hero at prison location, then reset manually to level 1 (stats, skills) before deleting.
I don't remember seeing level 5+ champions in prison anyway (talking about random maps, if starting with "all heroes start with level 5" option), is it possible to find high level guy in prison on them?
20.07.2014 03:18
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #17

Usually some prisons (if in treasure zones) hold some high level heroes, when you delete the prison, the hero goes back to pool but his experience/level remains. So if he was level 30 in prison, you will find him level 30 in tavern.

I think prisons can be avoided directly in rmg.txt, someone maybe knows their exact value. Then you don't need script.
20.07.2014 03:26
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #18

No, they can't. Unless you want to avoid a lot of other stuff as well (including artifacts).


When all gods have burnt to ashes in eternity of sorrow,
Demons gonna tear your soul because there is no tomorrow.
20.07.2014 04:03
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #19

Very useful link, thanks.
20.07.2014 04:33
Find all posts by this user Quote this message in a reply
igrik Offline
Administrators

Posts: 2807
Post: #20

Рабочий пример. Проверено в действии на протяжении уже лет трех: Скрипт удаления двухсторонних монолитов и замены их на ветряные мельницы.
В первую неделю мельницу будут "типо уже посещенные", но и то легко лечится.
Но вот что-то мне подсказывает что с тюрьмами не всё так просто....


game bug fixes extended.dll || My Plugins || My GitHub
20.07.2014 11:35
Visit this user's website Find all posts by this user Quote this message in a reply
Bes Offline

Posts: 5422
Post: #21

(20.07.2014 11:35)igrik Wrote:  Но вот что-то мне подсказывает что с тюрьмами не всё так просто....
я полагаю, что нужно заключённого героя телепортировать в координаты -1/-1/0 , и убрать инфу объекта в OB:C на всякий случай
20.07.2014 13:31
Visit this user's website Find all posts by this user Quote this message in a reply
MOP Offline
Moderators

Posts: 1467
Post: #22

Знали бы вы, сколько я с этим намучился, заменяя Тюрьмы... В итоге выход был найден с помощью этого кода:
Code:
; Продолжается условие нулевого дня (то есть, старт карты, а не загрузка игры)
     rvnz edi, .Нет_Тюрем_на_карте, CalculateObjects, 62, 0
     mov byte [5087805], 235; убрать обновление экрана
     – [Search_X]
   .repeat
     FindObject 62, 0, addr Search_X
     GetMapItem [Search_X], [Search_Y], [Search_L]
     GetHeroStruc [eax + MapItem.контрольное_слово]; контрольное число = номер героя в Тюрьме
     push eax
     movsx ecx, [eax+_Hero_.Хозяин]
     push ecx
     mov byte [eax+22h], Player_Pink; передаём героя последнему игроку
     KillHero eax, 1, 0
     pop eax
     pop ecx
     test eax, eax
     jl .герой_не_был_стартовым
     mov [ecx+_Hero_.Хозяин], al; устанавливаем хозяина
     imul esi, [ecx+_Hero_.Номер],5Ch
     lea edx, [esi+679DF4h]
     movlps xmm0, [edx]
     movlps qword [ecx + _Hero_.Тип_существ_в_слоте_0], xmm0
     push dword [edx+8];
     pop [ecx + _Hero_.Тип_существ_в_слоте_2]
     add esi, 7C4504h
     m2m dword [esi],[ecx + _Hero_.Количество_существ_в_слоте_0]
     m2m dword [esi+8], [ecx + _Hero_.Количество_существ_в_слоте_1]
     m2m dword [esi+10h],[ecx + _Hero_.Количество_существ_в_слоте_2]
.герой_не_был_стартовым:
; установка БМ, если специалист:
     cmp [ecx + _Hero_.Номер], HERO_Вирсавия
     jnz @f
     mov [ecx+_Hero_.Артефакт_в_слоте_Катапульты], ART_Воздушный_Шар
     jmp .дать_знамя
      @@:
     imul eax, [ecx + _Hero_.Номер], Размер_структуры_специализации_героя
     add eax, Адрес_структуры_специализаций_героев
     cmp [eax+Структура_специализации_героя.Тип_специальности], 1
     jnz @f
     cmp [eax+Структура_специализации_героя.Подтип_специальности_1], CR_Баллиста
     jnz @f
     mov [ecx+_Hero_.Артефакт_в_слоте_Баллисты], ART_Баллиста
     jmp .дать_знамя
       @@:
    .if [eax+Структура_специализации_героя.Тип_специальности] = 0 & [eax+Структура_специализации_героя.Подтип_специальности_1] = SS_Первая_Помощь
     mov [ecx+_Hero_.Артефакт_в_слоте_Палатки], ART_Санитарная_Палатка
    .endif
.дать_знамя:
     push ecx
   .if Option_Stacks_Experience & ~[Таблица_запрета_артефактов + ART_Знамя_Полководца]
     GiveArtToHero ecx, Данные_Знамени_Полководца_при_раздаче_баннеров
   .endif
; Даём начальный опыт (по правилам SoD)
     RandomNumber 40, 90
     pop ecx
     mov [ecx+_Hero_.Опыт], eax
     DeleteObject [Search_X], [Search_Y], [Search_L]
     mov eax, [Search_X]
     inc eax
     PlaceObject eax, [Search_Y], [Search_L], 20, 2, -1
     dec edi
   .until ZERO?
     mov byte [5087805], 116; вернуть обновление экрана
.Нет_Тюрем_на_карте:


Circle of destruction, hammer comes crushing
Powerhouse of energy
Whipping up a fury, dominating flurry
We create the battery
20.07.2014 17:37
Find all posts by this user Quote this message in a reply
igrik Offline
Administrators

Posts: 2807
Post: #23

Quote:Знали бы вы, сколько я с этим намучился, заменяя Тюрьмы... В итоге выход был найден с помощью этого кода:
MoP, а как его прикрутить 119, потому-что тюрьмы (точнее герои 5, 10, 20 ур.) просто бесят, особенно на "XXL"


game bug fixes extended.dll || My Plugins || My GitHub
21.07.2014 13:14
Visit this user's website Find all posts by this user Quote this message in a reply
MOP Offline
Moderators

Posts: 1467
Post: #24

Прикручивать не надо, лучше посмотреть, что делается, и выполнить это через ERM (как оно и было изначально, пока мод не перешёл на чистый асм).
1. Получаем контрольное число Тюрьмы = номер героя.
2. Запоминаем хозяина героя.
3. Передаём героя розовому игроку (пофиг, есть ли тот в игре).
3. Убиваем героя.
4. Если герой имел хозяина, а следовательно - был чьим-то стартовым (баг SoD) - даём ему стартовую армию.
5. Устанавливаем ему стартовые характеристики, чтобы всё было чики-пики.
5. Удаляем Тюрьму, ставим @userobject@.
6. Нюанс с убиранием обновления карты мира. Функция временно тупикуется, чтобы не вызывать задержку старта карты своими вызовами при убийстве каждого героя.


Circle of destruction, hammer comes crushing
Powerhouse of energy
Whipping up a fury, dominating flurry
We create the battery
21.07.2014 17:36
Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3880
Post: #25

(18.08.2014 02:14)Valery Wrote:  Prisons in random maps are a plague. So far I have a script removing them but the reset of the hero levels/stats/skills is more complicate.

I need to make an ini file (like the one from call to arms), set inside all heroes initial levels then read from it values. Can anyone give me a clue how those ini files are made? A short example will help me to understand, thanks.

You no need ini. See:

!#
Store all expirience, level, primary & secondary skills of all heroes in SN:W values. At this stage (instructions) heroes not yet in prison, and did not get the experience

!?PI
Frees heroes from prisons (HE#:P-1/-1/-1) and resrore their expirience, level, primary & secondary skills from SN:W values. Remove/replace prisons.


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
18.08.2014 12:02
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #26

Algor, I know, but if the map is generated first in editor, the prisons are already on, thus on instructions, heroes are already modified. Your solution works only on random maps made in game. I need universal solution.
(This post was last modified: 18.08.2014 16:08 by Valery.)
18.08.2014 15:32
Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3880
Post: #27

(18.08.2014 15:32)Valery Wrote:  Algor, I know, but if the map is generated first in editor, the prisons are already on, thus on instructions, heroes are already modified.

No, I was doing to check the map in the editor and at runtime instructions hero was still level 1. Here is my test map (script in event).
Check again.


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
18.08.2014 16:48
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #28

36

Good job, I was rather sure it won't work, but testing is never bad. Thanks.
18.08.2014 17:10
Find all posts by this user Quote this message in a reply
9in Offline

Posts: 9
Post: #29

Как убрать из генерации тюрьмы с героями? Или хотя бы сделать так чтобы выбранный начальный герой не оказывался в них с повышенным уровнем - очень сложно создать карту с высокими AI value на шаблоне XXL - все герои в тюрьмах оказываются, и уровень поэтому выше 1.
(This post was last modified: 03.09.2014 22:30 by 9in.)
03.09.2014 22:29
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #30

I wrote this script to remove prisons and reset heroes for my mod "Adventure pillars".

I hope I didn't make any typo when pasting here as I had to remove pillars parameters, tell me if something wrong.

(This post was last modified: 03.09.2014 23:13 by Valery.)
03.09.2014 23:03
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