Perl Scripting Engine Plugin for FLHook
-
for some reason, a few of the events refuse to hook for me with this, and i cant figure out why. FLHook reports a ‘Error: Plugin ‘perl’ does not export ….’ even though its listed in the source (i’ve coded and compiled some of these in a another plugin, and they hook fine)
ones i’ve noticed:UserCmd_Process
HkIServerImpl:: ReqAddItem
HkIServerImpl:: ReqModifyItem
HkIServerImpl:: Startup
HkIServerImpl:: LocationInfoRequest
HkIServerImpl:: BaseInfoRequest
HkIServerImpl:: CharacterInfoReq
HkIServerImpl:: SPRequestInvincibilitythe first 3 are of prime importance, expecially the UserCmd_Process any help on this would be VERY muchly appreciated
-
I used your example to create something basic (not very useful - but this is just for me to get used to this), but it’s not working…
Here’s what I’ve got:
callRegister 'ActivateCruise', sub{ my $charname = GetCharacterName $iClientID; MkFMsg $iClientID, "<tra data="\"000099x1\"" mask="\"-1\"/"><text>$charname has activated cruise engines.</text>"; };</tra>
Any idea why it’s not working?
-
assuming the plugin is working correctly (the tester.pl script is good for confirming that)
looking at the FLHook documentation, our ActivateCruise hook is passed 2 values, first is the iClientID, second XActivateCruise struct.
the XActivateCruise struct isnt passed to perl yet (structs not supported atm). But we need to capture that iClientID for your scriptcallRegister 'ActivateCruise', sub{ # catch first argument passed my $iClientID = $_[0]; my $charname = GetCharacterName $iClientID; HkFMsg $iClientID, "<tra data="\"000099x1\"" mask="\"-1\"/"><text>$charname has activated cruise engines.</text>"; };</tra>
you also typo’d the HkFMsg (in your code above you have it as MkFMsg). I wouldnt bother trying anything overly useful yet, the plugin has a long way to go still.
-
HkMsgU and HkFMsgU for universe messages
-
updated.
more seamless data type conversion (structs and lists still not fully supported),
removed some redundant functions not needed in perl (mostly data type conversion functions).
added brief documentation on FLHooks functions - whats currently working and how to access via perl.
functions that formally took a Client ID or Character name will now accept either one.
added ‘short’ versions of some functions, eg:#getting and setting a reputation - long function names my $rep = HkGetRep( $client, $faction ); HkSetRep( $client, $faction, $value ); # short function names my $rep = rep( $client, $faction ); rep( $client, $faction, $value ); ######################################### #getting current cash and adding 1000cr - long my $cash = HkGetCash( $client ); HkAddCash( $client, 1000 ); # short my $cash = cash( $client ); cash( $client, 1000 ); ```note alot of short functions have yet to be defined, and those that are the names arent final yet (subject to change later) Message functions and ConPrint now support multiple lines per call
HkMsg can be called as msg() - short form
HkMsg( $client, $line1, $line2, $line3, $etc);
still no luck on getting FLHook to recognize a few of the exported hooks… UserCmd_Process is driving me nuts since perl defiantly needs this one
-
both using official build of 1.6.0, and tried compiling myself with Visual studio 2003 on XP sp3
i had a feeling it might have been just my machine, since i couldnt see anything wrong and have exported those fine in other test plugins. Thanks alot for testing that, I’ll see if i can find a solution