FLHook Development

no description available
192 Topics 1.5k Posts
  • Autobuy problem resulting in crash

    Locked
    6
    0 Votes
    6 Posts
    7k Views

    Found another issue which might lead to wrong autobuy. If a ship has no batts/bots defined it can happen that the autobuy buys nearly 4 billion items šŸ™‚

    here the code:

    foreach(lstCargo, CARGO_INFO, it) { AUTOBUY_CARTITEM aci; if((*it).iArchID == iNanobotsID) { aci.iArchID = iNanobotsID; aci.iCount = ship->iMaxNanobots - (*it).iCount; aci.wscDescription = L"Nanobots"; lstCart.push_back(aci); bNanobotsFound = true; } else if((*it).iArchID == iShieldBatsID){ aci.iArchID = iShieldBatsID; aci.iCount = ship->iMaxShieldBats - (*it).iCount; aci.wscDescription = L"Shield Batteries"; lstCart.push_back(aci); bShieldBattsFound = true; } }

    Should be changed to:

    foreach (lstCargo, CARGO_INFO, it) { AUTOBUY_CARTITEM aci; if (((*it).iArchID == iNanobotsID) && (ship->iMaxNanobots > 0)) { aci.iArchID = iNanobotsID; aci.iCount = ship->iMaxNanobots - (*it).iCount; aci.wscDescription = L"Nanobots"; lstCart.push_back (aci); bNanobotsFound = true; } else if (((*it).iArchID == iShieldBatsID) && (ship->iMaxShieldBats > 0)) { aci.iArchID = iShieldBatsID; aci.iCount = ship->iMaxShieldBats - (*it).iCount; aci.wscDescription = L"Shield Batteries"; lstCart.push_back (aci); bShieldBattsFound = true; } } if ((!bNanobotsFound) && (ship->iMaxNanobots > 0)) { // no nanos found -> add all AUTOBUY_CARTITEM aci; aci.iArchID = iNanobotsID; aci.iCount = ship->iMaxNanobots; aci.wscDescription = L"Nanobots"; lstCart.push_back (aci); } if ((!bShieldBattsFound) && (ship->iMaxShieldBats > 0)) { // no batts found -> add all AUTOBUY_CARTITEM aci; aci.iArchID = iShieldBatsID; aci.iCount = ship->iMaxShieldBats; aci.wscDescription = L"Shield Batteries"; lstCart.push_back (aci); } }
  • '88 Flak's FLHook

    Locked
    63
    0 Votes
    63 Posts
    69k Views

    AFAIK Flak use their own FLhook.

    Check first post in this topic.

    http://the-starport.net/freelancer/forum/viewtopic.php?topic_id=1749

  • 0 Votes
    3 Posts
    5k Views

    sabatino, look at the forum youā€™re posting in. This is FLHook development, yes there will be C++ code.

  • Need help/tips to get debug infosā€¦

    Locked
    3
    0 Votes
    3 Posts
    5k Views

    Ok so it must not be an NPC - but it can? Anyway a position of any object is tried to retrieve and finally a basewatcher tries to check whatever.

    Can this be reason of a memory leak at another point? Or anyway to track down what BaseWatcher is watching via the Watchable struct?

  • 0 Votes
    5 Posts
    9k Views

    I would like to use the 2.0, but the problem is it doesnā€™t seem to have a dsacesrv plugin. I need that for some customization. My server rules in place of the standard discovery rules, a few slightly modified IDā€™s and such. But when I try running it with that plugin in the flhook_plugins folder the flhook console tells me unable to load dsacesrv plugin. Other than that it would be great. Iā€™ve wanted a bountyhunt plugin.

    I did finally figure out what the problem was. the file FLHookVC6Strings.dll wasnā€™t in the main exe folder but in the plugins folder. With it in the main exe folder, flhook works great. Although the flhook console reports

    Error: Could not read plugin info (Get_PluginInfo not exported?): FLHookVC6Strings.dll

    But if itā€™s not there FLHook wonā€™t hook into the server when it starts. Go figure.

  • HkGetClientIDByShip

    Locked
    4
    0 Votes
    4 Posts
    5k Views

    Players.GetMaxPlayerCount() should return the player count of current active players. If you want you can test the number it returns. Since it is old code, I assume it has been tested a number of times, but you never know.

    The bug you wrote about has something to do with fuse kills. At least thatā€™s what I noticed in our mod. Since there is no player who killed the player the code assumes memory garbage for the killer ID (smth. like that). I completely rewrote the killing detection and it is now based on who did the most damage in the last seconds (actually itā€™s a bit more complicated). I remember getting the actual damage done by a player was quite tough to get.

  • The writecharfile FLHook command

    Locked
    3
    0 Votes
    3 Posts
    6k Views

    Disconnecting from the server should be all that is required. There is no difference between a disconnect (not going to the character selection screen, an actual server disconnect) and closing the game entirely.

    The kick function does just that.

  • PlayerDBTreeNode

    Locked
    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • CreateWString

    Locked
    3
    0 Votes
    3 Posts
    5k Views

    Yeah thats it. Have used it and everything is fine again.

    BUT i would kindly understand what is the difference. Is there a setting i need to activate or is it simply impossible to generate a working dll with VS2055?

    Thanks Cannon!

  • Binarytree.obj?

    Locked
    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • FL HOOK

    Locked
    3
    0 Votes
    3 Posts
    11k Views

    thank you for the prompt feedback, i will give it a shot this evening.

    thanks boreland

  • Disallowing to buy equipmentā€¦

    Locked
    4
    0 Votes
    4 Posts
    6k Views

    Yeah i expect that the server requires this function call. I believe internally something like the following happens:

    If player buys the equipment
    disable the button
    run through the buy routines (that would be ReqAddItem)
    if everything is ok enable the button again
    further stuffā€¦.

    I have a workaround for this - but thought this workaround could be useless if it directly could be avoided to add the item. Even if i set the count and mount variable to 0/false the item is added - what is a bit strange.

    It is just wondering me - because the PluginVersion also returns prior the server.reqadditem routine. And i am asking myself if this never has been an issue before?

  • Routine for mounting equipmentā€¦.?

    Locked
    7
    0 Votes
    7 Posts
    8k Views

    At least thats the first function that my breakpoints interrupt the code from its execution - so i thought its well used as first šŸ˜‰

    If the EquipDescList reference from the function call would point to the item/equipment that is currently in use then it could save needless traversing through the cargo. W0dka pointed out to use the iterators of EquipDescListItem - but the question would be if the item that is currently in use can be retrieved by it wiithout running through all objects.

    I will see if i can find something out with these iterators. For now i think traversing the cargo hold is a reasonable way to get what i am looking for - although if its a workaround^^
    Thanks so far all that left a hint here.

  • 0 Votes
    7 Posts
    10k Views

    And so to finally lay this whole issue to rest, I have discovered the follow after speaking to a colleague at work who mentioned VirtualBox, XP and host time synchronisation donā€™t work well.

    Disable host to guest time sync and the problem goes away:

    on linux:
    vboxmanage setextradata <vmname>ā€œVBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabledā€ ā€œ1ā€

    on a windows host:
    vboxmanage setextradata <vmname>VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1

    Replace <vmname>with the name of your vm.

    Crappy VirtualBox and crappy windows :)</vmname></vmname></vmname>

  • Idea suggestion: New FL missions Ā© FLHook

    Locked
    4
    0 Votes
    4 Posts
    8k Views

    I dont know anything about web based missions or missions created via flhook sorry.

    But i do think the idea to create a forums category for suggestions to modders and programmers is a good one.
    Iā€™m currently working with single player missions and i can create them now (without blowing my own trumpet) quite well.
    Having lots of fun making, testing and playing them. Getting lots of alleviation when they are finished And iā€™m always looking out for new ideaā€™s.

  • FLServer Startup Times

    Locked
    4
    0 Votes
    4 Posts
    8k Views

    Nice!

    What results did the method bring that we have been using at HC? (I think FF or somebody else gave it to you).

  • Audio Chat through commands

    Locked
    8
    0 Votes
    8 Posts
    10k Views

    Iā€™ll try to do something. Thanks for the help w0dk4!

  • Chat off

    Locked
    8
    0 Votes
    8 Posts
    9k Views

    Thank you for help, lol

    Future of Freelancer is great >.<

  • Add GetIObjRW to FLHook plugin

    Locked
    11
    0 Votes
    11 Posts
    10k Views

    Bump

  • FTL for FLHook plugin

    Locked
    6
    0 Votes
    6 Posts
    10k Views

    Cool bananas šŸ™‚

    thanks for the info. Iā€™ll keep watching these hook threads