Hercules icon indicating copy to clipboard operation
Hercules copied to clipboard

Plugin addBattleConf

Open Samuel23 opened this issue 4 years ago • 2 comments

It seems that adding battle conf through plugins is not working.

I even tried using the sample plugin added in the hercules emulator, my_setting is not being read in any battle conf files.

Tried to change addBattleConf("my_setting", parse_my_setting, return_my_setting, false); to addBattleConf("my_setting", parse_my_setting, return_my_setting, true);

it just shows debug message: [Warning]: Missing configuration 'my_setting' in file conf/map/battle.conf!

In conf/map/battle/battle.conf Added at the end of the file my_setting: 1

Also tried using import battle conf:

battle_configuration: { my_setting: 1 }

Even when both is implemented, [Warning]: Missing configuration 'my_setting' in file conf/map/battle.conf!

And to make sure, i tried making an npc with the script: prontera,124,201,1 script trialNPC 4_F_JOB_BLACKSMITH,{ mes(getbattleflag("my_setting")); close; }

Whatever changes i made with the my_setting value, it shows 0.

Samuel23 avatar Jul 19 '20 05:07 Samuel23

why you closed issue? you found solution?

4144 avatar Jul 19 '20 09:07 4144

why you closed issue? you found solution?

@4144 sorry, accidentally closed it,.

yes, i found a solution.

sample plugin should be updated.

from addBattleConf("my_setting", parse_my_setting, return_my_setting, false); -> which is at default

addBattleConf("battle_configuration/my_setting", parse_my_setting, return_my_setting, false); -> which was brought up by update.

I accidentally found this when I'm looking with Dastgir's plugins.

Btw, another thing I encountered is if this "battle_configuration/my_setting" exceeds 40 characters, it will not be read. Don't know if it's designed by that.

Samuel23 avatar Jul 21 '20 07:07 Samuel23