Skip to content
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

feat: add many user-friendly features #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lingsamuel
Copy link

@lingsamuel lingsamuel commented Feb 12, 2023

Signed-off-by: LingSamuel [email protected]

  1. cache some global vars to make linter happy

  2. add a "Go back" feature. User can now go back after go to
    image

  3. add array length indicator for fields
    image

  4. add local index indicator for states in order to find the corresponding condition quickly

  5. add states indicator for conditions like states
    image

  6. add "Start states conditions"
    image

  7. add "Replace action by id" to avoid a very long drop list
    image

  8. add a "Referenced by" array to query nodes to it (by states or start states)
    image

  9. support make side panel width static. Increase its width from /4 to /3.5

  10. support render children in "Transition Position". It displays the start state and states in a tree format.
    image

Signed-off-by: LingSamuel <[email protected]>
@lingsamuel lingsamuel changed the title feat: add many user-friendly updates feat: add many user-friendly features Feb 12, 2023
@praydog
Copy link
Owner

praydog commented Feb 13, 2023

I am trying to test this but there is a crash occurring now within imnodes.end_editor(), only when using transition positioning. It only occurs on some nodes. The one in particular I am seeing is 2554 on Longsword, in a lobby, not a hunt. Maybe too many draw calls? I can't tell.

sdfhdf

@praydog praydog self-requested a review February 13, 2023 10:13
@lingsamuel
Copy link
Author

lingsamuel commented Mar 9, 2023

I finally had time to update this script to make it suitable for PR.

Newly added features:

  1. Handle some common-used action/condition types, make them easy to edit.
    image

  2. Display some node metadata (maybe useless for most users but it helped me a lot) and parent. require my forked version
    image

  3. Some performance limit, for example, draw max 100 links, won't draw node 0, etc.

  4. Node tree analysis (won't update after editing unless a reset-script for now), also some bug-fixes for it

  • purple (dangling in the node tree): the node is not referenced by any state or start state in the node tree
  • red (is a start state): the node is referenced as a start state
  • yellow (is an exit state): one of the states or start states is not a child of the node tree
    image

image

@lingsamuel
Copy link
Author

I am trying to test this but there is a crash occurring now within imnodes.end_editor(), only when using transition positioning. It only occurs on some nodes. The one in particular I am seeing is 2554 on Longsword, in a lobby, not a hunt. Maybe too many draw calls? I can't tell.

sdfhdf

Strange, I can't reproduce this.

@lingsamuel
Copy link
Author

lingsamuel commented Mar 9, 2023

I also implements a fully "deep copy" for nodes. To do so, I need the "resize" function to make the relocating happen only once. I do this in my fork repo.
It's not included in this PR because public REF does not currently have a resize function.

I found that this is because the nodes referenced by some fields need to be all inside the subtree (or more precisely, they can't refer to children of other subtrees, I guess). This internal relationship was probably broken by the "duplicate node" feature of the BHVT editor, as it did not handle these reference relationships, making the copied nodes not work properly.
I then spent a few hours implementing a full "deepcopy" that relocates all the pointers it should have. (I edited the REF to get some of the funcs I needed)

Now I can add nodes dynamically via lua and they work just like they were loaded from the motfsm file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants