RE-BHVT-Editor icon indicating copy to clipboard operation
RE-BHVT-Editor copied to clipboard

feat: add many user-friendly features

Open lingsamuel opened this issue 2 years ago • 4 comments

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

lingsamuel avatar Feb 12 '23 22:02 lingsamuel

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 avatar Feb 13 '23 10:02 praydog

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 avatar Mar 09 '23 16:03 lingsamuel

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 avatar Mar 09 '23 16:03 lingsamuel

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.

lingsamuel avatar Mar 09 '23 16:03 lingsamuel