ArisStudio / ArisStudio_Legacy

做你自己的碧蓝档案故事 | Make your own BlueArchive story(deprecated)
https://github.com/ArisStudio/ArisStudio_Legacy/wiki
GNU General Public License v3.0
255 stars 28 forks source link

A bug which may be caused by variable management in ArisStudio.0.2.22 #31

Closed ShenWeiqi0804 closed 10 months ago

ShenWeiqi0804 commented 11 months ago

Bug Report

Prerequisites

Description

while I was calling "bg set xxx" instruction after "bg hide", I found that it didn't work correctly. The next background image came out first and it was hidden soon. But if I add a "wait 0.6" between them, the problem would be solved. So I thought it might be a problem which can be solved by adding a lock which can control the opacity of the image. I haven't viewed the source code yet, but I guess that it may be caused by a problem about variable management in multithreading. I'm sorry that I'm a little busy now, so I will give my solution when I'm free.

Steps to Reproduce

  1. Create a new script and type following code: "load bg bg1 BG_818.png load bg bg2 BG_AbandonedCorridor.jpg bg set bg1 wait 1 bg hide bg set bg2"
  2. Save and try to run it.

Expected behavior: you can see the BG_818.png and it then hides. and then, you will found that BG_AbandonedCorridor.jpg comes out and never disappears. Actual behavior: you will found that BG_AbandonedCorridor.jpg appears and quickly hide again. then the background comes to be black.

How often the issue appear: If trying to run the code, it can always take place.

Versions

ArisStudio.0.2.22

Additional Information

i have nothing to add for this issue. But the following versions couldn't run correctly on my computer: ArisStudio.0.2.23 Aris Studio v0.3.0-alpha.2 ArisStudio.0.3.0.alpha.fix1 I don't really know why because my unity is not available now. Also, I will try to give my solution when I'm free. But there's one thing I'm sure about is that even the Demo script cannot run correctly.

Tualin14 commented 11 months ago

Between bg hide and bg set bg2 you need to add a wait 0.5.

Neither of these two behaviors is a direct execution of a completed action, they both have fading animations. However, you have both behaviors executing at the same time, so they are executing at the same time and thus the error is occurring.

0.0.23 ver. replace ' in the text with `

ShenWeiqi0804 commented 11 months ago

Thank you for reply.

After replacing, the problem in 0.0.23ver solved. It works well! But what I want to say about this issue(although i've known it's not a problem) is that if adding a sync command, which can execute these async command synchronously, that may make the script more easy for human to read and more convenient for debugging. May I talk with you in Chinese on the bilibili? There's something I want to talk about but I'm poor in English. And you know, github is unstable for me. So could you please allow me to talk with you on bilibili?

Tualin14 commented 11 months ago

我看你名字就应该是中国人,没说你不能在这用中文啊。2333 你可以去b站私聊,怎样都行,只要我看见了消息就回。

Tualin14 commented 10 months ago

Archive this repository