Help with patch for flhook plugin
-
nameIDs patch
im trying to make a patch so i can get it to return
the name from a IDS
basicly to add comands like thisvoid UserCmd_EnumCargo(uint iClientID, wstring wscParam) { list <cargo_info>lstCargo; HkEnumCargo(ARG_CLIENTID(iClientID), lstCargo, 0); uint iNum = 0; foreach(lstCargo, CARGO_INFO, it) { const GoodInfo *gi = GoodList::find_by_id(it->iArchID); if(!gi) continue; if(!it->bMounted && gi->iIDS) { PrintUserCmdText(iClientID, L"%u: %s=%u", it->iID, HkGetWStringFromIDS(gi->iIDS).c_str(), it->iCount); iNum++; } } if(!iNum) PrintUserCmdText(iClientID, L"Error: you have no unmounted equipment or goods"); }</cargo_info> ```like i say its not returning the name cant seem to find the problem
-
Wouldn’t that make for horrid performance in realtime situations?
I think it might be best to cache necessary IDS names at launch time and put them in a hashmap. CPU time is a rare commodity and disk access is slow, but memory is fast and plentiful. If you don’t know what IDS names might be required over time, then cache them as you read them.
-
No, what he does is pretty much what Freelancer itself does.
The code looks okay (well, I would do iDLL = iIDS >> 16; iIDS &= 0xFFFF). Have you verified the DLLs are actually loaded? You might also want to load ids 0, since that’s “Object Unknown”.
Looking at the disassembly, it appears the definition for GoodInfo is wrong (actually, really wrong, but that’s for another time). Replace:
float iDunno2[7];
uint iIDS;with:
float iDunno2[6];
uint iIDS;
uint iIDSInfo;and you should be right.
-
its the way old hook handles it still aint returning the names
it returns the slot number and the amount but no name
this is one of the important functions
you cant exacly send the players the IDS lol
its not just for goods its for sending base names system names ship names
its always been part of flhook
so why was it not added in the first place -
so basicly what your saying stick to plugins that dont interact
with the clients lol ones that dont supply eny info to them
basicly dont make advanced plugins
keep then simple functions
i though the whole point in it was to dev plugings to enhance mods funny enough i can do that with old hook
but you get it as one bundle i want to be able to use the plugin version to select the stuff i need basicly have a choice
i dont want a list of commands that are dissabled
or having to recompile to remove themall i want to do is make plugins but have a core with all the functions i need to do it simple
you think im asking alot
the reason im making a big thing about it is i see this is the way to do it the way forwardso ill ask can it be done or is it back to the old hook
is it going to be added yes or no
if not ill not waste my time no more on it -
kosacid wrote:
so ill ask can it be done or is it back to the old hook
is it going to be added yes or no
if not ill not waste my time no more on itI think it makes sense to include the IDS code into FLHook because I see it can be useful for many plugins.
Check adoxas earlier post (he edited it). If you can make it work, I think we can apply the patch to the SVN source.