Skip to content

feat: add many user-friendly features - #2

Open
lingsamuel wants to merge 5 commits into
praydog:mainfrom
lingsamuel:main
Open

lingsamuel wants to merge 5 commits into
praydog:mainfrom
lingsamuel:main

Conversation

@lingsamuel

@lingsamuel lingsamuel commented Feb 12, 2023

Copy link
Copy Markdown

Signed-off-by: LingSamuel lingsamuelgrace@gmail.com

  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 <lingsamuelgrace@gmail.com>
@lingsamuel lingsamuel changed the title feat: add many user-friendly updates feat: add many user-friendly features Feb 12, 2023
@praydog

praydog commented Feb 13, 2023

Copy link
Copy Markdown
Owner

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

lingsamuel commented Mar 9, 2023

Copy link
Copy Markdown
Author

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
Copy Markdown
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

lingsamuel commented Mar 9, 2023

Copy link
Copy Markdown
Author

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.

2 participants