Adding custom effect

Started by Acuru, July 15, 2017, 05:39:13 PM

Acuru

I want to add custom effect to skill, and then use it like variable in script but i don't see how. I searched core.pkt but not find answer there.

Particularly I'm trying to make skill that will increase amount of skill points earned each level. I managed to change this value manually to fixed amount, but i want it to be dynamically. For example if u got skill to level 1 u will get 11 points every level up instead of 10.

Or make another manufacture skill that will enable aditional manufacturing options.

Acuru

Ok i finnaly got it, but have another question:

function CalculateSkillPointsForLevel(args)
{
    return 10 * (args.level - 1);
}


How i will use it here? in args there is only level passing. How i can use effect value? In example i want something like this:

function CalculateSkillPointsForLevel(args)
{
    return (10 + custom_level) * (args.level - 1);
}


Lurler

If I understand correctly what you are trying to do - then you need to pull that value from the character cache. Like GetFinalCacheValue or such (sorry, I can't remember the exact function name from the top of my head, but it is used in a lot of quests so you can just take a look).

Now, there is only one issue. I don't remember if this function is part of the internal or external scripting. If it's external then it's all good, because player data will be accessible, but if it's internal then it won't be and you won't be able to do that.

Perhaps ai_enabled can tell that, because I'm not particularly familiar with that part of scripting, because I was mostly doing quests and other scripting that is "external" to game logic.

Bottom line is, for now you can just give it a try by pulling the character info there and see if it works. It all depends on environmental context (internal or external).

Sanhumaner

I can not imagine what I would have come across, but it was good.

Lurler

Quote from: Sanhumaner on September 20, 2017, 10:28:02 PM
I can not imagine what I would have come across, but it was good.
Um... what? :)
I thought you are a spam bot, but you don't have any links in your profile, so it seems like a legitimate message, but then what does that even mean? :)