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

. Спасибо
Наверное так? !!SN:W^spheres^/?y1
W^spheres^/0;
(13.08.2014 10:30)igrik Wrote: [ -> ]Да уж, перенамудрил так перенамудрил
. Спасибо
Наверное так? !!SN:W^spheres^/?y1 W^spheres^/0;
угу, так точно, обкопипастился (
UPD: ох, блин... а почему "spheres" то? "okovy" же.
Надо было все-таки после пива спать ложиться, а не по форуму лазить...
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.
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
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
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.
Code:
[Player options]
;remove relics 0/no, 1/yes
77=0
имхо, нет нужды вводить текстовые параметры в секциях (в частном случае), ибо и числовыми вполне можно обозначить всё что угодно... тем более запись в ini через UN:N5 короче в плане кода, чем через ERA-команды
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!
Don't use v1 if you can.
\Pillars.ini => Pillars.ini
It's enough.
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..