Author Topic: Adding custom effect  (Read 631 times)

Acuru

  • Newbie
  • *
  • Posts: 33
    • View Profile
Adding custom effect
« on: July 15, 2017, 05:39:13 pm »
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

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Adding custom effect
« Reply #1 on: July 16, 2017, 09:01:12 am »
Ok i finnaly got it, but have another question:

Code: [Select]
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:

Code: [Select]
function CalculateSkillPointsForLevel(args)
{
    return (10 + custom_level) * (args.level - 1);
}

Lurler

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1024
    • View Profile
Re: Adding custom effect
« Reply #2 on: July 16, 2017, 08:22:17 pm »
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

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Adding custom effect
« Reply #3 on: September 20, 2017, 10:28:02 pm »
I can not imagine what I would have come across, but it was good.

Lurler

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1024
    • View Profile
Re: Adding custom effect
« Reply #4 on: September 21, 2017, 12:44:40 am »
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? :)