-
May 4th, 2021, 21:42 #1
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.
-
May 4th, 2021, 21:54 #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/them
-
May 5th, 2021, 14:26 #3
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.
-
May 5th, 2021, 15:37 #4
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!
-
May 5th, 2021, 16:02 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,412
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
-
May 5th, 2021, 19:19 #6
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.
-
May 5th, 2021, 23:10 #7
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,412
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
-
May 6th, 2021, 00:12 #8
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.
-
May 7th, 2021, 00:49 #9
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,412
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
-
May 7th, 2021, 03:06 #10
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 Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
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)
Bookmarks