BananaHolograma / turnity

Your go-to plugin for streamlined turn management in Godot. Elevate your game's experience with efficient turn-based mechanics. Craft dynamic battles and engaging scenarios effortlessly.

Home Page:https://godotengine.org/asset-library/asset/2570

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some Questions

ipatterson opened this issue · comments

Hello, I just wanted to ask a few questions to help better my understanding after some more exploration.

  • In the example for Initializing a new turn, I couldn't get the example working until I changed .set_sort_rule(your_custom_sort_function) to TurnityManager.set_sort_rule(your_custom_sort_function)\. I'm unsure whether or not it was intended, so I just wanted to bring it to your attention.
  • When manually moving to the next turn, how do I trigger the ended_turn() signal? I tried using the code example in the 'Manually move to the next turn' section, but can only advance the turn. The signal is triggered fine when the turn duration is a non-zero value, but I want to fire that signal manually. I even did TurnityManager.ended_turn.emit() without any success.

Thank you again for all the hard work you've put into this plugin!

Hi @ipatterson, let me answer your questions:

  • You're right, the docs are missing the \ in two functions to continue the chain execution, I'll fix it
  • The ended_turn signal as I see in my code requires a manual action, i.e., right now calling next_turn() is only calling the TurnityManager signal turn_changed()

I created it this way so that there is control over this signal on each socket and you decide when it is actually 'the end' of the turn.

At the moment you can listen to the TurnityManager turn_changed() signal and manually emit the ended_turn signal on the first parameter that gives you the previous socket.

signal turn_changed(previous_socket: TurnitySocket, next_socket: TurnitySocket)

Thanks for your patience, I'm currently working on other things and I have pending an update for this plugin to make its use clearer.

Cheers!

Apologies for the late follow-up, but would you be able to provide a code example? I tried to emit and listen to turn_changed, but I think I'm writing unnecessary code. (I'm happy to also provide my code if needed). I'm sorry to say that I still don't fully understand the process.

After a bit more playing around, I found another workaround. I'm still working to understand Godot scripting, so I'm open to feedback. But I wanted to share in case it helps.

So, on a unit with an attached TurnitySocket (which itself has the actor attached), I wrote a custom signal send_active_unit(TurnitySocket), so now in my main script I can manually call ended_turn