Current time: 27.11.2024, 06:14 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Ваши вопросы по ERM-скриптам
Author Message
Bes Offline

Posts: 5422
Post: #2881

Katarina, можно... вопрос лишь упрётся в смену описания...
если очень горит, постараюсь нарыть тот самый кусок кода, который когда-то создал Дьякон для Гавани
01.08.2014 17:18
Visit this user's website Find all posts by this user Quote this message in a reply
Katarina Offline

Posts: 37
Post: #2882

Не к спеху, но если что-то есть - было бы неплохо.
01.08.2014 19:15
Find all posts by this user Quote this message in a reply
igrik Offline

Posts: 2819
Post: #2883

Первый раз использую эровские переменные типа !!SN:W^[моя_переменная]^/0; Не перенамудрил ли я? Можно ли данный код сделать короче чтоле, но не используя функций и переменных типа "v" и флагов, т.е. максимально непересекаемо с другими скриптами и модами.
Скрипт - при нападении на нейтралов, оковы войны не действуют, и герой может сбежать


game bug fixes extended.dll || My Plugins || My GitHub
(This post was last modified: 13.08.2014 02:03 by igrik.)
13.08.2014 01:50
Visit this user's website Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3881
Post: #2884

(13.08.2014 01:50)igrik Wrote:  Не перенамудрил ли я? Можно ли данный код сделать короче чтоле, но не используя функций и переменных типа "v" и флагов, т.е. максимально непересекаемо с другими скриптами и модами.
Перенамудрил. Можно.



BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
13.08.2014 03:10
Visit this user's website Find all posts by this user Quote this message in a reply
igrik Offline

Posts: 2819
Post: #2885

Да уж, перенамудрил так перенамудрил 148. Спасибо
Наверное так? !!SN:W^spheres^/?y1 W^spheres^/0;


game bug fixes extended.dll || My Plugins || My GitHub
(This post was last modified: 13.08.2014 10:31 by igrik.)
13.08.2014 10:30
Visit this user's website Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3881
Post: #2886

(13.08.2014 10:30)igrik Wrote:  Да уж, перенамудрил так перенамудрил 148. Спасибо
Наверное так? !!SN:W^spheres^/?y1 W^spheres^/0;

угу, так точно, обкопипастился (

UPD: ох, блин... а почему "spheres" то? "okovy" же. Надо было все-таки после пива спать ложиться, а не по форуму лазить...


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

Posts: 2819
Post: #2887

Quote:Надо было все-таки после пива спать ложиться, а не по форуму лазить...
ох как я тебя понимаю 118


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

Posts: 2196
Post: #2888

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.
18.08.2014 02:14
Find all posts by this user Quote this message in a reply
Bes Offline

Posts: 5422
Post: #2889

for example,restore defaul sex hero...


ini file looks as...
Code:
[defaultsex]
0=0
1=1
2=0
3=1
4=0
...
152=0
153=1
154=0
18.08.2014 11:40
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2890

bes, and how to make writable options into ini file, is possible?

For example player can set in ini file if script will run:

[player options]
Remove relics: 0 (will not) / 1 (will do)

Or must be like this?

[player options]
;remove relics 0/no, 1/yes
0=0
(This post was last modified: 19.08.2014 02:17 by Valery.)
19.08.2014 02:15
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #2891

Code:
[player options]
Remove relics=1

era.dll
function ReadStrFromIni (Key, SectionName, FilePath, Res: pchar): boolean; stdcall;
function WriteStrToIni (Key, Value, SectionName, FilePath: pchar): boolean; stdcall;
Just don't forget that writable ini should be placed in real Data/Maps/etc folder, not in mods one. If you are planning to use ini only for reading then you can place it in Mods\ModName folder.


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

Posts: 5422
Post: #2892

Code:
[Player options]
;remove relics 0/no, 1/yes
77=0



имхо, нет нужды вводить текстовые параметры в секциях (в частном случае), ибо и числовыми вполне можно обозначить всё что угодно... тем более запись в ini через UN:N5 короче в плане кода, чем через ERA-команды
19.08.2014 13:18
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2893

Ok, made my first ini and is working. But as I have no clue how it works, I must ask: is there anything more to add? On reload game, on instructions, PI? Is this OK?
if I use same word more than once in ini, will the code read the correct one?

Ini file
Code:
[Player settings]

;The pillars will replace the objects listed below. Change values between 0 and 10 to set your custom replacement ratio for each object. (0=none, 10=maximum)

Den of Thieves=10
Learning Stones=10
Creature Banks=0
Crypts=0
Schools of Magic=0
Creature Generators=10
Taverns=10
Obelisks=3
Prisons=10

;The following value will automatically activate/deactivate (0/OFF, 1/ON) the watcher for all the game length. The watcher allows to the player to know what the other pillars offer.
;The premonition lasts 7 days. If option is off, the player will have to find the watcher by his own. Default value is off.

Watcher=1

Script:


Once the ini made, I had to delete the previous erm code which went through each option. Economized 300 script lines!
(This post was last modified: 20.08.2014 00:40 by Valery.)
19.08.2014 21:30
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #2894

Don't use v1 if you can.
\Pillars.ini => Pillars.ini

It's enough.


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

Posts: 2196
Post: #2895

Ok for v1. Without the slash, the ini file isn't found if in Mod folder. I don't want it in data folder, for easier location, players are lazy..
20.08.2014 00:56
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