2
\$\begingroup\$

I've downloaded the mod Art of the Catch and I was wondering how I could change the scripts in order to spawn three new category of items:

any ingredient (dragon bones) any non-enchanted craftable item (iron helmet) any enchanted craftable item (ring with magic enchantment that is vanilla or added by a mod)

Looking at the source code, I found this:

function SelectFish()
    Form fish_base = fish_detected.GetBaseObject()

    if fish_base == CritterPondFish01
        PlayerRef.AddItem(CritterPondFish01Ingredient, 1, true)
        _AC_CaughtFish01.Show()
    elseif fish_base == CritterPondFish02
        PlayerRef.AddItem(CritterPondFish02Ingredient, 1, true)
        _AC_CaughtFish02.Show()
    elseif fish_base == CritterPondFish03
        PlayerRef.AddItem(CritterPondFish03Ingredient, 1, true)
        _AC_CaughtFish03.Show()
    elseif fish_base == CritterPondFish04
        PlayerRef.AddItem(CritterPondFish04Ingredient, 1, true)
        _AC_CaughtFish04.Show()
    elseif fish_base == CritterPondFish05
        PlayerRef.AddItem(CritterPondFish05Ingredient, 1, true)
        _AC_CaughtFish05.Show()
    elseif fish_base == CritterSalmon01 || fish_base == CritterSalmon02 || _AC_FishWaterfallTypes.HasForm(fish_base)
        PlayerRef.AddItem(FoodSalmon, 1, true)
        _AC_CaughtFishSalmon.Show()
    endif
endFunction

It was inside _ac_beginfishing.psc with other functions. I am pretty sure I just need to modify the function, but I am not sure if we can use a general class of items as a variable, and I am even less sure about adding items with enchantments, because from what I know there's no variable that points to a list of items.

Anyway, how would you change the scripts so that it spawns random items? The way I would do is generate a random number and use it to select an item in a list, but I am not familiar with the scripting language, so I am not exactly sure how I could do that or even if it's possible.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

I'm not sure this is part of the modding script. This looks like it just tells the game to show the fish you've caught. I might be wrong. Mabye your looking at the wrong piece of code?

PlayerRef.AddItem(CritterPondFish05Ingredient, 1, true)

That part could lead you somewhere.

"akItemToAdd: The base form add to this reference's inventory. If this is a base object, it will add a newly-created item. If it is a reference, it will move/remove it from own place/container to this container. If a form list, then it will add aiCount of each item in the list."

Just replace CtitterPondFish05Ingredient with the desired object. DO realize that this will only trigger when the function selectFish is fired. If you don't want this, put it in some other function. Hope this helps.

\$\endgroup\$

You must log in to answer this question.