-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple instances of the same Node share tags during activation [bug] #34
Comments
Hi, thank you for reporting this! May I ask you how are you activating the ability? If possible, may I also ask you for a minimum repr project? Thank you! |
Sure thing, I set the ability like this in the _process() function I set momentarly the repo public, to give you access to the project I'm currently working on Thank you in advance for the help. |
I am debugging it (you should close your source asap). Btw, you can simplify that check to if activation_event.ability_container != self:
return |
Ok, it's my fault (guess what? Ahaha). I have to add checks, because by design abilities are reference counted, and if you instance one ability by the editor only one instance will exist, leading to one ability connected to multiple ability containers. Fixing right now, close your source and thank you! |
Glad I could have pointed to this problem, thank you for your help! I guess these checks should be made in any of the "handle_ability*". My repo is closed and secured (it's a personal project so it's not too much of a problem opening or closing it out eheh, I kinda want to release the code if the final result is any successfull). |
* fix inventory in diablo_like example (OctoD#21) Co-authored-by: sergwest <ksendzov.sd@gmail.com> * chore: updates gitattributes * chore: adds import file * feat: adds hooks methods in Interaction (OctoD#22) feat: adds on_before_interaction_end feat: adds on_before_interaction_start chore: updates sot-like example with draggable object * chore: adds a line at the end so godot stop complaining * Fix icon paths for attribute/ability resources/nodes (OctoD#24) * fix icon paths missing "attributes_and_abilities" * add available icons to ability nodes/resources * fix abilitycontainer _ready missing preloaded abilities (OctoD#25) * fix: fixes OctoD#26 * fix: adds condition * chore(demo): adds example on how to use tags_to_display * fix: closes OctoD#23 (OctoD#28) * feat: adds _on_interaction_started and _on_interaction_ended calls (OctoD#29) this occurs when an interactable_area is interacted and if the methods are implemented (look at sot-like example) * Feat/2d-and-3d-point-and-click-controllers (OctoD#30) * feat: adds point_and_click_2d * feat: adds PointAndClick3D node * fix: fixes typo in tags_updated signal parameter name * chore(docs): adds docs * feat: adds radial menu (OctoD#31) * chore: removes commented duped line * feat: adds RadialMenuContainer icon * chore: updates readme * feat: adds initial camera shake implementation (OctoD#33) * fix: closes OctoD#34. Thank you @Hairic95 * feat: adds SlideShow node for your game intros (OctoD#35) * chore: migrates from 4.0 to 4.1 * fix: fixes test * fix: fixes esc menu button * chore: updates IDEAS.md * feat: adds get_attributes_dict method * Feat/turn-based-nodes (OctoD#36) * feat: adds turn based nodes * Update README.md (OctoD#42) * fix: closes OctoD#39 (OctoD#41) * chore: updates docs * chore: adds requirement for reproj --------- Co-authored-by: Sergwest <39670193+AFK1@users.noreply.github.com> Co-authored-by: sergwest <ksendzov.sd@gmail.com> Co-authored-by: octod <iamoctod@gmail.com> Co-authored-by: OctoD <OctoD@users.noreply.github.com> Co-authored-by: Daniel Bernard <daniel.john.bernard@gmail.com>
Describe the bug
While using GGS, I created a Scene for a enemy entity with a ShootBullet Ability. This requires two tags to start ('alive' and 'triple_shoot') and is blocked if the tag 'triple_shooting' is present, which is given on activation. This works fine when there's only 1 of these enemies, however when multiple are added to the scene, only one of them seems to performing the ability.
I noticed that the tag 'triple_shooting' is added to all entities of the same type when the Ability, instead of that specific entity. This happens within the AbilityContainer function "_handle_ability_activated".
Currently I wrote the following quick fix to avoid to add the tag to all instances by confronting who that tag is for. Probably it would be cool if the function gets called only on the target object.
Here's the ability configuration, for reference (in the chance I set something wrong):
Desktop:
The text was updated successfully, but these errors were encountered: