fian46 / addons-btree

Visual Behavior Tree
MIT License
115 stars 19 forks source link

Hot Reload remembers the last reload if not saved,and will keep printing the task that is not given to it #29

Closed davord45 closed 4 years ago

davord45 commented 4 years ago

Hi fian46,i found a bug in hot reload,i tried to print "first" than change it to "second",that worked like in the video,but than i tested i you dont press save it will keep printing "second" with "first" even though first is its parameter.I tried fixing it by saving and it keeps printing the same thing. image

fian46 commented 4 years ago

did you connect to debugger first ?

fian46 commented 4 years ago

it will not working if you not connect to debugger. if so it will hint you with message BT Hot reload in hint bar

fian46 commented 4 years ago

the hint message only say saving data so no hot reload performed

davord45 commented 4 years ago

Yeah i did that,but it keeps remembering the last action and prints that until i hot reload again,like it almost runs paralel to the startup parameter,yeah im checking when i increase the wait it prints it twice,and when i hot reload it prints twice hot reload message

davord45 commented 4 years ago

Yeah it keeps the startup parameter on the first line and the hot reloaded one on the second

fian46 commented 4 years ago

Can you upload small reproduce project about this issue ? Also with the step too ?

fian46 commented 4 years ago

Also it will reload until you press ctr + s or press save in editor. My bad not tell you that.

davord45 commented 4 years ago

I will test it when i get back from lunch,but why does it remember the reload after the runtime is over?

davord45 commented 4 years ago

Shouldnt it be going back to what is in tree editor

fian46 commented 4 years ago

I am not really sure, i tried to recreate the node in tour screenshot but it not behaving like your case

davord45 commented 4 years ago

I recorded the bug in video so that you can see everything https://youtu.be/a0B-qNJP4kU

davord45 commented 4 years ago

Now i get it printing first even when i restart the editor,and default is second

fian46 commented 4 years ago

Wow that looks bad. Thanks for the report. I will looking for it. But can you send me just the scene and the script ? I need to looking more details.

davord45 commented 4 years ago

Here you go,hope you can reproduce it. http://www.mediafire.com/file/pjd41ttpotdeug9/HotReloadBug.zip/file

fian46 commented 4 years ago

yeah this is really funny. it looks like your parameter in print is double "first enter first" that is why it print 2 "first" every tick. when you edit "first" to "second" you only change it to "second enter first". i am still consider this as usability problem really, because user still can't really see every parameter value in full. this is not connected to any hot reload problem. but i don't know how to fix it right now. maybe make the text area larger for parameter input ?

davord45 commented 4 years ago

How do you mean larger?How would that fix the problem?Does that fix it on your side?

davord45 commented 4 years ago

Tried resizing the node if thats what you mean,but it did not fix it

davord45 commented 4 years ago

What is a double parameters,how could that be when i only send one parameter?You only have parameters for Strings and Numbers,is this like an array?

fian46 commented 4 years ago

No in your scene file the parameter is 0 is "first enter first". Please scroll down your mouse when edit the paramater. The enter is real enter character btw not enter like text. There is 2 line in your parameter 0

fian46 commented 4 years ago

First line is "first" and second line is "first" When you edit it you assuming only one line but there is two. And the second line is unedited because you cant see it.

davord45 commented 4 years ago

Ah must be because i pressed enter,sorry tried to test it in a rush.

fian46 commented 4 years ago

Yes it fixed in my side. Maybe i can upload some video ?

davord45 commented 4 years ago

Yeah that was the case,didnt see you have a mini scroll bar on the node

davord45 commented 4 years ago

But it still hot reloads twice the first time

fian46 commented 4 years ago

That is fine it is design flaw. Maybe for large text input it need some popup to enter the text for better experience.

davord45 commented 4 years ago

Actually when i press Save in Editor it does only once,must be a keyboard thing

fian46 commented 4 years ago

But it still hot reloads twice the first time

What do you mean ?

fian46 commented 4 years ago

Oh that double print hot reload thing. Yes it is some extra unnecessary reload because the editor intercept the same event as the plugins do. It is unfortunate but that will not changed the operation.

davord45 commented 4 years ago

It hot reloads on ctrl+s press and release,yeah i guess one frame is not gonna matter as much

davord45 commented 4 years ago

Ok i found another issue,when you make two exact same trees only name change,and hot reload a parameter from one it will change it in both.

fian46 commented 4 years ago

Yeah that's another issue in id_generator i just realized that can happen. I will look into it tomorrow 😁

davord45 commented 4 years ago

Get some rest dude,you deserved it.

davord45 commented 4 years ago

You fixed the issue,thanks.