Skip to content

Configuration

Michael A. Sinclair edited this page Dec 12, 2017 · 4 revisions

All configuration is done through the fish_c_config.nss file. This page will cover each configuration function and show how to use them to set up a basic fishing system.

Notes

  • Do not edit any files besides fish_c_config.nss. Any option that is meant to be altered is located there. Alterations to other files in the system are considered unsupported.
  • Upon editing fish_c_config.nss, you must recompile fish_t_equipment.nss for the changes to be reflected in the game.

Config Functions

Configuration functions are located in fish_c_config.nss. You may alter the content of these functions as long as you do not change the name, return type, or parameters of the function. By default, most of these will simply return TRUE, allowing the system to proceed according to default settings.

OnFishingSetup()

This function houses the main configuration for the module. Here you will define the fish, environments, equipment, and tackle types used throughout the fishing system. Because the possibilities here are extensive, the usage of this function will be documented in other articles.

  • Executes: the first time a fishing item is used or acquired in the module
  • Parameters: none
  • Return value: none

OnFishingTackleUsed()

This function runs when the PC uses a fishing tackle item and has fishing equipment equipped. It returns whether the tackle should be added to the equipped item. Example uses include removing the tackle from the player's inventory when used, giving back tackle already applied to the same slot, or requiring a hook type of tackle to be applied before allowing a bait type of tackle to be used.

You can add tackle to a fish's list using AddFishTackle() in the OnFishingSetup() config function. This function takes a comma-separated list of fish and and tackle, making it easy to add many tackle types to many fish. The function also allows you to add a modifier to the chances a fish will bite when the PC is using that tackle. This allows fish to prefer different tackle.

  • Executes: whenever the player uses a tackle item and has fishing equipment equipped.
  • Parameters:
    • oEquipment: the PC's currently equipped fishing equipment
    • oTackle: the tackle item being used
    • sSlot: the slot the tackle is being applied to
  • Return Value: whether to add the tackle to the equipment slot.

Example

int OnFishingTackleUsed(object oEquipment, object oTackle, string sSlot)
{
    // Remove current tackle of the same type and give it back to the PC.
    RemoveFishingTackle(sSlot, TRUE, oEquipment);

    // Tackle should be single use.
    DestroyObject(oTackle);
    return TRUE;
}
Clone this wiki locally