Starfinder Playlist
Page 1 of 2 12 Last
  1. #1
    SoxMax's Avatar
    Join Date
    Mar 2021
    Location
    Massachusetts, USA
    Posts
    55

    Updating addEffect in manager_effect.lua of CoreRPG

    I recently tried to replace the addEffect function in manager_effect.lua from CoreRPG but it currently relies on locally declared variables like _nDelayedUpdates. If I wanted to overwrite the function but still do much of what its currently doing and update the local variables it doesn't look like I can reference them via EffectManager._nDelayedUpdates. Short of replacing the entire file does anyone know how to do something like this?

    Ultimately I'm trying to just get the duplicate message print out to obey the bShowMsg flag and only print its message when that boolean is true.

  2. #2
    Pretty sure you have to replace the whole file (hello potential compatibility issues!) to touch those, but I could be wrong.
    bmos' extensions
    he/him | Discord Tag: wil.thieme#3396

  3. #3
    SoxMax's Avatar
    Join Date
    Mar 2021
    Location
    Massachusetts, USA
    Posts
    55
    Yea that's exactly what I was afraid of too. And that level of incompatibility doesn't seem worth it just to fix a boolean flag. I guess I could release the extension as a stand alone and stay on top of updating it instead of bundling it with new functionality.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    29,407
    Is the boolean flag issue an issue with the base product? If so, has it been reported to support?
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    The reason that the duplicate message prints is because an action is being performed which is being cancelled, otherwise there would be no indication that the function did nothing.

    What's your use case?
    Can you check to see if the effect exists before adding?

    Regards,
    JPG

  6. #6
    SoxMax's Avatar
    Join Date
    Mar 2021
    Location
    Massachusetts, USA
    Posts
    55
    My use case is in applying & removing effects based on characters proximity to each other, basically auras. Currently there is a check to see if the effect already exists on the recipient, and if so not try and apply it again. However what I believe is happening is since I've hooked into the onMove event of tokens, during a mouse drag movement on the client checks will occur in rapid succession. As a result when a new target comes into range of an aura it will often check to see the target is missing the effect and fire an apply event. Because of networking though a subsequent move will often trigger another apply event because the client is not yet aware that the 1st apply event was successful.

    Also I agree that without the current duplicate message there is no indication the event did anything. But that's what I thought the bShowMsg controlled. But it only seems to turn off happy path messaging. That's also why I haven't reported this to support as its a bit personal preference if error messaging should be controlled with the hShowMsg flag in applyEffect.

  7. #7
    I think that any sort of aura implementation would have to track information about the source and full text of the effect; and check to see if the effect with that exact text has already been applied from that source; and then determine whether to apply/remove.

    Regards,
    JPG

  8. #8
    SoxMax's Avatar
    Join Date
    Mar 2021
    Location
    Massachusetts, USA
    Posts
    55
    That's exactly what the extension is doing. However what I suspect is due to networking delays plus rapid movement by clients, the target will appear to not have the aura effect even though an apply event has already been fired, causing another apply effect event.

  9. #9
    Effects have to be applied by the host; so any aura check should only be done on the host as well. You probably do not want the player clients involved at all.

    Regards,
    JPG

  10. #10
    Quote Originally Posted by SoxMax View Post
    That's exactly what the extension is doing. However what I suspect is due to networking delays plus rapid movement by clients, the target will appear to not have the aura effect even though an apply event has already been fired, causing another apply effect event.
    What you might consider is instead of applying actual effect objects to tokens in the "aura" radius is to intercept getEffect* and within there return the effect data you want if there are tokens within the auras effect. It's how I do it for 2e and doesn't involve having applied and removed effects based on position to the aura. What is means is the effect test is not made until a getEffect* call is made.

    For my aura effects "AURA: 30 friend red;ATK:3;DMG:3;AC:2" would apply ATK/DMG/AC to any friendly within 30 ft of the aura (including the person with the aura).

    It's not a trivial task but it works.

    If I am presuming to much of your code, apologies, but thats what it sounds like you are doing to me from what I've read.
    ---
    Fantasy Grounds AD&D Content Bundle (All The AD&D Content)
    Documentation for AD&D 2E ruleset.
    My Twitch Channel for AD&D and FG related streams (See schedule for live days)
    My YouTube for FG related Tutorials and AD&D Actual Plays
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DMsGuild

Log in

Log in