Pandora's API - Printable Version +- Wake of Gods Forum | Форум Во Имя Богов (http://wforum.heroes35.net) +-- Forum: Герои Меча и Магии 3.5 WoG/ERA (/forumdisplay.php?fid=99) +--- Forum: Моды (/forumdisplay.php?fid=104) +---- Forum: Архив (/forumdisplay.php?fid=192) +---- Thread: Pandora's API (/showthread.php?tid=4583) |
Pandora's API - gamecreator - 07.09.2014 20:09 Вчера Valery заявил, что нельзя с помощью ЕРМ поставить ящик Пандоры. Сегодня уже можно. Сейчас для ящика Пандоры есть только половина функционала, считывание всего содержащегося в ящике добра будет позже. Если кому интересны мои наработки по структуре данных ящика Пандоры - пишите, выложу. Может когда ещё для чего добавлю функционал (предложения приветствуются). Вот такой вот технический мод для избежания конфликтов разнообразных самописных API. Скачать мод Руководство пользователя (из скрипта, на английском) (Click to View) RE: Pandora's API - Berserker - 07.09.2014 20:47 Очень даже неплохо RE: Pandora's API - Valery - 07.09.2014 21:47 Nice, will test. Tomorrow we will be able to script seer huts then? RE: Pandora's API - gamecreator - 07.09.2014 21:58 Berserker, Valery, спасибо. Только что нашёл баг: новые ящики неправильно сохраняются. Таки не до конца я расшифровал. RE: Pandora's API - gamecreator - 07.09.2014 23:04 Хм, после исправления этого бага может исчезнуть лимит на количество ящиков Пандоры если он больше нигде не прописан. RE: Pandora's API - igrik - 08.09.2014 16:13 Интересно, даже очень.... Quote:Если кому интересны мои наработки по структуре данных ящика Пандоры - пишите, выложу.Выкладывай, ведь может быть не сейчас, но позже кому-то они точно понадобятся. Я так понимаю, что и любой существующий ящик можно перенастроить через эти функции FU920000...FU920008 RE: Pandora's API - gamecreator - 08.09.2014 16:25 Да, для существующих ящиков это должно работать безотказно. RE: Pandora's API - orzie - 09.09.2014 00:16 Круто! Многие сценарии могут в потенциале выиграть от этого, особенно квестовые. RE: Pandora's API - gamecreator - 09.09.2014 01:46 Новая версия с пылу, с жару (буду благодарен если кто потестирует). Исправлены баги с сохранением и с невозможностью установить ящику описание длиннее 512 символов. Скачать (ссылка та же, что и раньше) Прибавление в мануале (Click to View) (07.09.2014 21:47)Valery Wrote: Tomorrow we will be able to script seer huts then?Just noticed this. I will look into it once I am done with Pandora's Box. RE: Pandora's API - Bes - 09.09.2014 02:11 месяц назад я подумал, "а почему бы Ящик Пандоры не разрешить поднимать герою, с возможностью носить его в рюкзаке?", и даже начал узнавать Вконтакте, что там за картинка на сторонах ящика, дабы после замутить картинку артефакта... и тут на тебе, gamecreator сделал такую респект, будем пробовать описанную мною идею толкать Владыке для дальнейшей реализации в ФМ RE: Pandora's API - Valery - 09.09.2014 10:28 (09.09.2014 01:46)gamecreator Wrote: Just noticed this. I will look into it once I am done with Pandora's Box. This would be great because I always wanted to create a mod which stores all quests huts on the map then player can find every hut in a click. Finding seer huts on XL/XXL maps is a pain. Store request/coordinates, place in custom dialog, display to player + go to location (if in visible range) VCMI has the intention of implementing one: Spoiler (Click to View) RE: Pandora's API - feanor - 10.09.2014 22:36 Вот, как раз недавно думал о том, чтобы на рандомках визуально отделять друг от друга ящики с разными сортами фуфла. RE: Pandora's API - gamecreator - 28.09.2014 23:18 Расшифровка провидцев идёт полным ходом. В качестве побочного эффекта можно будет настраивать ещё и стражи проходов. RE: Pandora's API - Berserker - 28.09.2014 23:25 Отличные новости! RE: Pandora's API - gamecreator - 08.11.2014 20:16 Новая версия! Мод претерпел существенные изменения и теперь добавляет не просто набор ЕРМ-функций, а полноценные рисиверы и позволяет добавлять новые рисиверы всем кому не лень! Рисивер QU я, правда, не тестировал, но оттягивать релиз нет больше мочи. Valery обещал сделать свой журнал заданий, вот заодно и проверит. Ссылка та же Документация в наличии на русском и английском. RE: Pandora's API - Berserker - 09.11.2014 01:10 Здорово, поздравляю с выпуском второй версии! RE: Pandora's API - igrik - 09.11.2014 22:56 добавление пользовательских ERM рисиверов вообще мега сильно!! Очень круто RE: Pandora's API - gamecreator - 09.11.2014 23:16 Ещё бы оно кому пригодилось, так было бы вообще замечательно. RE: Pandora's API - Valery - 11.02.2015 08:25 I have a little annoyance with seer huts. All QU#:M0/?z1 work fine but when type 6 (bring creatures) there is no text to get. Neither proposal or progress message. Of course the message is in the hut, I just can't get it by this command. RE: Pandora's API - gamecreator - 11.02.2015 12:17 Interesting... I will check it. RE: Pandora's API - Valery - 11.02.2015 15:07 i can't get those three commands to work, actually, I am stuck at "get". Is this correct? RE: Pandora's API - gamecreator - 11.02.2015 18:51 I made info on my receivers to closely resemble ERM Help: Quote:If a command parameter is shown as $ it means that its value can be stored in a variable. If it's shown as # it means that it can only be set, but not read. And if it's shown as ?$ it means it can be read but not set.So the first command alone should cause error and produce a message with a text of the faulty command, like your ordinary ERM error would. I am yet to implement error messages, Era's ExecErmCmd proved surprisingly incapable of handling IF:M during my earlier tests. Now the reason why I implemented getting creatures/artifacts this way is that you can set unlimited number of them to be delivered and I consider LE:A-like implementation to be lame. So you must cycle through all artifacts, get quantity of each and compose your message. Why it sometimes works for you I don't know. Probably ERM recovers from error (since I provide valid recovery info) and continues to run with faulty command unexecuted and values unchanged. RE: Pandora's API - Valery - 11.02.2015 19:25 I think I understand what you mean. When I asked for seer huts I had one thing in mind, which I find extremely annoying when playing large custom and random maps: locate seer huts and their target. So my mod idea is to store all huts, border guards, now that we can, then player just browse and see which is where, what it asks, where is the monster to defeat and such. In all, works fine, but without those 3 receivers + QU:M0/?z1 for creatures is not complete so no idea how to finish it. Personally I find no use to set regular seer huts, as custom huts can be easily scripted. Instead, regular huts are a real annoyance on given maps, up to 48 and to find them is tedious. Spoiler (Click to View) @Edit: ok, I get it, cycle through all artifacts then compose. I will try this, thanks. RE: Pandora's API - gamecreator - 11.02.2015 19:30 (11.02.2015 08:25)Valery Wrote: I have a little annoyance with seer huts. All QU#:M0/?z1 work fine but when type 6 (bring creatures) there is no text to get. Neither proposal or progress message. Of course the message is in the hut, I just can't get it by this command.I checked it and technically there is no message. Just like if you remove it with QU:M0/0. So when you visit the hut, the game composes the message on spot. I don't know if this is a quirk of the game itself or of the map editor, but all other messages are pre-generated. I'll see what I can do about this. RE: Pandora's API - Valery - 11.02.2015 19:52 There is no need, I solved it. I create text after the creatures loop. Back to work, might finish this mod soon. RE: Pandora's API - Valery - 02.05.2015 17:09 I don't know how to get correct values for rewards when primary skills, morale/luck and creatures. Returns garbage even if I check for that parameter, sometimes correct but depends on number of seers on map, so is not valid. RE: Pandora's API - gamecreator - 02.05.2015 20:14 Receiver QU help Wrote:Some of these values may return garbage when checking for predefined seer huts (e.g. number of creatures). You will have to truncate such values to the appropriate size manually.This means that in some cases these values occupy less than 4 bytes, but QU:R returns all 4 bytes. You can extract the real value either with VR:&(X-1) or VR:%X where X is 2^number of bits. I would guess primary skills, morale and luck occupy 8 bits (or 1 byte), which means X=2^8=256. Don't remember about creatures, probably somewhere between 10 and 16 bits. RE: Pandora's API - Berserker - 02.05.2015 20:23 In short: %256, %65536 RE: Pandora's API - Valery - 02.05.2015 21:10 Moment, I need a bit of help, you mean this? RE: Pandora's API - gamecreator - 02.05.2015 21:17 It does not matter whether it is positive or negative. First you truncate it, then do everything else. RE: Pandora's API - Valery - 02.05.2015 21:19 I mean I don't know how to use this: "In short: %256, %65536" within the code. So first I get the value in y72 then I do what? because if I do y72%256 I get always 0. I am lost... RE: Pandora's API - gamecreator - 02.05.2015 21:36 Look into the help: y72 means nothing when checking for morale/luck. You need to check y71. RE: Pandora's API - Valery - 02.05.2015 21:45 Right, solved for morale and luck, now get correct results with %256. But neither %256 or %65536 give me valid results for primary skills. Solved creatures (65536), remains primary skills. RE: Pandora's API - gamecreator - 02.05.2015 22:22 Show your code. RE: Pandora's API - Valery - 02.05.2015 22:29 This allows reading on seer hut/quest guard both quest/reward + date limit (if any) on right-click. Only this remaining unsolved: !!VRz3&y70=6:S^+%Y72 %Z4^; y72 gets overflow RE: Pandora's API - gamecreator - 02.05.2015 22:47 I don't see where you extract primary skill value from y72. RE: Pandora's API - Valery - 02.05.2015 22:50 I tried and get strange values, both %256 and %65536 for y72. None is good. This way then removed wrong code. RE: Pandora's API - Valery - 02.05.2015 23:07 Ok, I got the right equation: How is this translated in maths? RE: Pandora's API - gamecreator - 03.05.2015 00:27 It is equivalent to (y72-1)%256+1, which is equivalent to y72%256 except when y72 is divisible by 256 (then it's 256 instead of 0). Since the bonus to a skill can not be 256 (or 0 for that matter), your expression is the same as the initial one. RE: Pandora's API - Valery - 03.05.2015 00:37 Ok, so I leave it as it is right now then, thanks. Mod reuploaded with complete informations. RE: Pandora's API - Valery - 03.05.2015 00:45 Ok, I have wrong value in the case the first y72 is correct, I guess is related to Seer hut number or position. How can we know when the result is garbage or ok? A solution would be to start %256 process only if y72>100 I think? And let normal value if y72<100 as it is very unlikely that a mapmaker offers more than 100 bonus in a seer? RE: Pandora's API - gamecreator - 03.05.2015 01:07 Just checked and I see the problem. Computer signed division just works weirdly. Forget everything I (and Berserker) said about %. Use & instead. (03.05.2015 00:45)Valery Wrote: Ok, I have wrong value in the case the first y72 is correct, I guess is related to Seer hut number or position. How can we know when the result is garbage or ok?I don't know. Let's hope the problem goes away when you switch to & method. RE: Pandora's API - Valery - 03.05.2015 01:14 I think I solved for primary skills: This gave 100% correct results on "the lone knight" map, where there are 48 seer huts. Now I have same problem with creatures, so I have to find again. RE: Pandora's API - gamecreator - 03.05.2015 01:22 No, just use &(number-1) instead of %number. E.g. &255 instead of %256, &65535 instread of %65536. It works. Alternatively, if you have such liking to % operation, check the result afterwards and if it is less than 0, and the divisor (256, 65536 etc.) to the result. RE: Pandora's API - Valery - 03.05.2015 01:27 but I solved the creatures problem also using same way, you advice me to start again and use &? All huts now work correct. RE: Pandora's API - gamecreator - 03.05.2015 01:34 What do you mean start again? I replaced your method with mine and it works perfectly for primary skills. The problem with % was in how it is implemented in computer math vs real life math (and I said how to correct it). And my methods do not look like black magic. RE: Pandora's API - Valery - 03.05.2015 01:38 I hate maths... ok, reuploaded, relax until a new bug is found. RE: Pandora's API - gamecreator - 03.05.2015 01:50 (03.05.2015 01:38)Valery Wrote: I hate maths...Here, now you don't have to deal with math: RE: Pandora's API - Valery - 05.05.2015 08:34 Looks like event guards code works for pandora boxes as well. @script 21 by Fnord RE: Pandora's API - gamecreator - 05.05.2015 10:39 Yes, local events and pandora's boxes are essentially the same. LE works for pandora's boxes (which is said in ERM help) and PA should work for local events (but mostly wouldn't, because there is a critical bug; I'll try to update today). I found out about LE when I was already implementing PA, so it was too late to change something and PA works differently anyway (so it can not be made into a replacement for LE). Aslo PA doesn't have the restrictions of LE. RE: Pandora's API - gamecreator - 05.05.2015 14:08 Версия 2.0.1 Рисивер PA: исправлена критическая ошибка с определением номера объекта, исправлена команда PA:M. Рисивер QU: исправлена команда QU:M. Version 2.0.1 Receiver PA: fixed critical bug with determining object ID, fixed PA:M command. Receiver QU: fixed QU:M command. moderator Wrote:Плагин интегрирован в ERA, начиная с версии 2.9.8 |