Jump to content
Ind

Introducing Hercules Plugin Manager

Recommended Posts

You are awesome :D

Will there be official hercules plugin releases? And a forum for them.

Share this post


Link to post
Share on other sites

Will there be official hercules plugin releases?

yes we have plans on adding some features as plugins (e.g. unit control script commands)

And a forum for them.

soon, yes :3

You are awesome :D

not as awesome as you :D <333

Share this post


Link to post
Share on other sites

Im about to cum.. Oh.. ShEEE)tT !! This is greaaaat !!

Share this post


Link to post
Share on other sites

Amazing. Great work!

 

It's really too bad there was a split between rA and Hercules. *Still hopes you guys will "merge"* Don't hate, just a dream xP

Edited by Xantara

Share this post


Link to post
Share on other sites

This plugin system is really awsome, I'm currently trying it and the possibilities are enormous.

 

Right now it's possible to use GET_SYMBOLE from plugins to import function/var, but will it be possible in the future to import function/var from plugins to Hercules ?

 

Edit: Actually it's already possible, you just have to export the HPM->share function, and use it in your plugin to share your own stuff with Hercules, but I don't know if it's OK to do it this way.

Edited by Susu

Share this post


Link to post
Share on other sites

I just find a critical error with the HPM.

 

The HPM->event(HPET_INIT) occurs BEFORE every other inits(atcommand, clif etc...) and because of that it's impossible to add new commands or even override functions.

When your plugin init is over and you atcommand are added, the do_init_atcommand() occurs, wich set the atcommand->db to NULL, wich erase the commands you previously add with your plugin.

The same goes for function ovveriding, because the *defaut() functions are called after your plugin init, wich erase (again) all your modifications.

 

I know it's not finished and you probalbly already found this bug, but I want to try to contribute because the HPM system really as a huge potentiel and a little help can't harm.

Share this post


Link to post
Share on other sites

I just find a critical error with the HPM.

 

The HPM->event(HPET_INIT) occurs BEFORE every other inits(atcommand, clif etc...) and because of that it's impossible to add new commands or even override functions.

When your plugin init is over and you atcommand are added, the do_init_atcommand() occurs, wich set the atcommand->db to NULL, wich erase the commands you previously add with your plugin.

The same goes for function ovveriding, because the *defaut() functions are called after your plugin init, wich erase (again) all your modifications.

 

I know it's not finished and you probalbly already found this bug, but I want to try to contribute because the HPM system really as a huge potentiel and a little help can't harm.

It is not, your information is inaccurate, I've tested all HPM functionality prior to its release. that is exactly the reason why there is a init and a server_ready event, so you can replace the init functions to your liking if you so choose with a init event, or have the original ones trigger and have your code be run on a server_ready event.

(btw the NULL thing took place after the release and was fixed)

but I want to try to contribute because the HPM system really as a huge potentiel and a little help can't harm.

I'm very happy to hear that :D

Share this post


Link to post
Share on other sites

Before I forget for the nth time. 

 

Regarding HPM Function Overloading, is it possible *or would it be possible if it doesnt already* to have Hercule's core functions be loaded together with the plugin functions or would the plugin overwrite them?

 

Scenario: The PK Plugin checks if sd->state.pk is enabled (which would go under battle_check_target), while Faction system plugin would check for like sd->status.faction value to see wether target is friend or foe. If both plugins overwrite battle->check_target, would both checks remai or would one overwrite the other? And each one overwrite the original battle_check_target's code? 

 

Edit: Also in case the functions are not overwritten, would the new custom battle_check_target have to be completely the same  as the original one? or could I just add the pieces of code as I need them? Like for instance, could I simply do

int my_battle_check_target( struct block_list *src, struct block_list *target,int flag){	int16 m; //map	int state = 0; //Initial state none	int strip_enemy = 1; //Flag which marks whether to remove the BCT_ENEMY status if it's also friend/ally.	struct block_list *s_bl = src, *t_bl = target;	nullpo_ret(src);	nullpo_ret(target);        if (s_bl->type == BL_PC && !((TBL_PC*)s_bl)->state.pk) return false;}

for the PK plugin? 

Edited by Xgear

Share this post


Link to post
Share on other sites

I've thought about it before and kinda screwed up myself.

 

It'd be quite nice if each plugin used its own function because it would be a mess otherwise, but the answer to that is on Ind's hands ot another one that can understand all the HPM code.

Share this post


Link to post
Share on other sites

Before I forget for the nth time. 

 

Regarding HPM Function Overloading, is it possible *or would it be possible if it doesnt already* to have Hercule's core functions be loaded together with the plugin functions or would the plugin overwrite them?

 

Scenario: The PK Plugin checks if sd->state.pk is enabled (which would go under battle_check_target), while Faction system plugin would check for like sd->status.faction value to see wether target is friend or foe. If both plugins overwrite battle->check_target, would both checks remai or would one overwrite the other? And each one overwrite the original battle_check_target's code? 

 

Edit: Also in case the functions are not overwritten, would the new custom battle_check_target have to be completely the same  as the original one? or could I just add the pieces of code as I need them? Like for instance, could I simply do

int my_battle_check_target( struct block_list *src, struct block_list *target,int flag){	int16 m; //map	int state = 0; //Initial state none	int strip_enemy = 1; //Flag which marks whether to remove the BCT_ENEMY status if it's also friend/ally.	struct block_list *s_bl = src, *t_bl = target;	nullpo_ret(src);	nullpo_ret(target);        if (s_bl->type == BL_PC && !((TBL_PC*)s_bl)->state.pk) return false;}
for the PK plugin?

 

 

Currently that can be done by copying the pointer to the original, and then throwing it back at it after your custom stuff goes (check my example at the skill error message plugin test), but we have a HPM Hook implementation in the plans that'd make doing what you propose much easier.

Share this post


Link to post
Share on other sites

btw, how much is the minimum memory size to do "make plugins"?

 

What I experienced just now, if I have server with 1GB of memory  and with all normal stuffs installed (let's say, I use Asura Hosting and it ready to use with 512MB of physical memory and 512 Swap), it's not enough.

 

> top

rr1b.png

 

> free -m

EKqi5qh.png

 

> top

(then do make plugins, and see the top result)

> make plugins

iqet.png

 

(the result of..)

> make plugins

esCCzyt.png

 

Share this post


Link to post
Share on other sites

btw, how much is the minimum memory size to do "make plugins"?

 

What I experienced just now, if I have server with 1GB of memory  and with all normal stuffs installed (let's say, I use Asura Hosting and it ready to use with 512MB of physical memory and 512 Swap), it's not enough.

 

> top

 

 

> free -m

 

 

> top

(then do make plugins, and see the top result)

> make plugins

 

 

(the result of..)

> make plugins

 

 

this may help you:

http://herc.ws/board/tracker/issue-7803-hpmhookingc/

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.