DICE PACKS BUNDLE
  1. #1

    Adding effects via code

    Hello

    I need some help with adding effects via a code I have some prototype of an extension (I can somehow not add the link to it; it is in the 3.5e forum in the recent threads) which handles situation dependent saves. However, I found out that it only works for saves of NPCs but not for PCs. As far as I can see both are using the modSave function for effects in the manager_action_save.lua. My extension is based on adding an auxiliary effect to the person who has to roll the save using

    local sActorType, nodeActor = ActorManager.getTypeAndNode(rActor);
    EffectManager.addEffect("", "", nodeActor, rEffectSpell, false);

    (where rActor is the one making the save)

    For NPCs that works, they get the effect rEffectSpell (in form of a string saved in rEffectSpell.sName). But for players this doesn't work. Does the addEffect works differently there? Or do I need a different command to get the node of a PC?

    Thanks in advance
    Last edited by Kelrugem; May 6th, 2019 at 21:59.

  2. #2
    Ok, it seemingly depends on the definition of rEffectSpell, isn't it? I just want to add some string to the effects of the actor. So far I have

    rEffectSpell.nDuration = 1;
    rEffectSpell.nInit = 0;
    rEffectSpell.nGMOnly = 1;
    rEffectSpell.sApply = "";

    and .sName the corresponding string

  3. #3
    I think that anyone will have a hard time figuring out the situation from the code snippets.

    My recommendation is that you use Debug.chat or Debug.console APIs to inspect the parameter variables before you make calls, and inspect the result variables after you make calls. then, you’ll be able to review the variable values to see where the ariables qre different than what you expect.

    Regards,
    JPG

  4. #4
    Quote Originally Posted by Moon Wizard View Post
    I think that anyone will have a hard time figuring out the situation from the code snippets.

    My recommendation is that you use Debug.chat or Debug.console APIs to inspect the parameter variables before you make calls, and inspect the result variables after you make calls. then, you’ll be able to review the variable values to see where the ariables qre different than what you expect.

    Regards,
    JPG
    Thank you for your answer Yes, was not sure how to explain that without copying all of the code. I try what you mentioned

  5. #5
    Oh, wow, thank you very much for your advice! I was able to solve it The problem was that I get the charsheet-id with getNode, but I needed the CTnode and for that I have to use rather getCTNode Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Character Create Playlist

Log in

Log in