Raised This Month: $51 Target: $400
 12% 

Late-loading plugins not initially catching forwards?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-04-2015 , 20:30   Late-loading plugins not initially catching forwards?
Reply With Quote #1

So I'm really confused by this. To save time I'm just going to call the two plugins ff2.sp and late.sp.

So FF2 late-loads (this is the correct term, right?) all of its subplugins when enough players join the server. late.sp (the subplugin) listens to the FF2_OnSpecialSelected forward in order to do some precaching for certain bosses.

Now the weird part is even though I've confirmed FF2_OnSpecialSelected fires (or more specifically that my debug output before and after the forward both display), late.sp fails to catch the forward in the first round. All other rounds after that are fine. This is obviously undesirable and can cause the server to crash in the first round due to un-precached models.

Is there any way to get the forward to properly fire in the initial round where late.sp gets loaded?
__________________
~Wliu
Wliu is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 02-05-2015 , 16:03   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #2

https://sm.alliedmods.net/api/index....d=show&id=583& ?

(Totally a random guess but sounds relevant.)
Potato Uno is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-05-2015 , 16:08   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #3

Quote:
Originally Posted by Potato Uno View Post
https://sm.alliedmods.net/api/index....d=show&id=583& ?

(Totally a random guess but sounds relevant.)
As far as I can tell, we're talking about global forwards and there's nothing a plugin can call to hook one of those (it's supposed to be automatic).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-05-2015 at 16:09.
Powerlord is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 02-05-2015 , 16:12   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #4

Why is your whole thing based on plugins late-loading into the game?

Can't you just inhibit every function in a plugin from working using a boolean flag of some sort along with a global cvar until enough players have loaded? Then just flip the cvar flag to 1 if you want everything to run, change it to 0 if you want to stop everything from running.

That should cause the forward to fire on the first round, if you don't block that with a boolean flag.

I dunno, I could be totally talking out of my ass, but late-loading plugins isn't something that would come to me as a viable solution unless if we're talking about like 500 plugins.
Potato Uno is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-05-2015 , 17:04   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #5

It's always how FF2's done it and I've never exactly questioned that logic. There's already a global Enabled variable but subplugins don't get to see that.
Really I don't think there's anything wrong with having the plugins automatically loaded since they already mostly operate on forwards, except that's not possible in the current configuration because they are located in the plugins/freaks/ folder. SM, to my knowledge, does not automatically load plugins in folders (or for that matter plugins that end in .ff2 instead of .smx...).

And Powerlord is right-I'm talking about global forwards here.
__________________
~Wliu
Wliu is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-05-2015 , 17:25   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #6

If they were .smx, SM would autoload them.
__________________
asherkin is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-05-2015 , 18:09   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #7

/sigh Eggman.

At this point in FF2 development, it'd be really difficult to suddenly switch subplugins to using *.smx, even if FF2 auto-renamed them like it does now from *.smx->*.ff2. Oh well.
__________________
~Wliu

Last edited by Wliu; 02-05-2015 at 18:10.
Wliu is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 02-05-2015 , 20:37   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #8

that the same thing for me and it only on linux. I got my primary plugin that provide natives and it give me an error that it did not register it correctly.

L 02/04/2015 - 22:20:45: [SM] Plugin encountered error 21: Native is not bound

if I reload it manually after server start everything seem to work. This is only on linux, I register the native under AskPluginLoad2.
Mathias. is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-05-2015 , 22:13   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #9

@Black-Rabbit you seem to have a different issue. Mine is about forwards and hence no errors are thrown (since the forward never appears to get called); yours is about natives.
__________________
~Wliu
Wliu is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 02-06-2015 , 13:31   Re: Late-loading plugins not initially catching forwards?
Reply With Quote #10

I actually tried to iron out all plugin dependency quirks i've encountered over the past years. Do both of you have a small testcase demonstrating the issue?

People tend to forget the SharedPlugin struct in their include files or don't call RegPluginLibrary after they created the natives in AskPluginLoad2.
__________________
Peace-Maker is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode