I know I've had difficulties with this stuff some days ago as well, but I still can't figure out something. Why does the animation selector requires a number when using a variable? Looking at the code, one would expect that UIDs are used instead.
Thanks again!
Show animation through variable requires a number
● ARCHIVED · READ-ONLY
-
-
Hi FoxySeta,
good point, I think that is a bug. I think Show Animation command has not been used often which is why it probably has not been figured out until now. I put it on the bug list and it will be fixed with the next update. You can fix it yourself or now if you go to the Extension View > Scene Commands > Picture > Show Animation and then the { ....... } entry after "OBJECT_NUMBER" there is a field "variableButton" and the data source is set to "numbers". Just change it to "strings". -
Thanks! I remember giving a look at the scene command creation guide so I should be able to do it. Can I safely edit the original instead than creating a new one since it's going to be fixed in the next update?Hi FoxySeta,
good point, I think that is a bug. I think Show Animation command has not been used often which is why it probably has not been figured out until now. I put it on the bug list and it will be fixed with the next update. You can fix it yourself or now if you go to the Extension View > Scene Commands > Picture > Show Animation and then the { ....... } entry after "OBJECT_NUMBER" there is a field "variableButton" and the data source is set to "numbers". Just change it to "strings".
EDIT: could it be that you also need to forcely preload your animations shown through variable just like if they were characters?
Also, to make it work I had to change at Component_CommandInterpreter this line
Code:in this onerecord = RecordManager.animations[@params.animationId]
Code:record = RecordManager.animations[@interpreter.stringValueOf(@params.animationId)]
Also, I had to do something similar with Pan Screen as well. Would you mind checking them all soon or later? -
Hi FoxySeta, sorry I didn't check the command implementation in the interpreter, I just assumed it is already using stringValueOf so I think your change should be fine there.
Can I safely edit the original instead than creating a new one since it's going to be fixed in the next update?
Yes!
Yes, not sure if I mentioned that only Show Picture supports the calculation of the filename by variable without preloading. However, you could add the same experimental logic to Show Animation yourself.could it be that you also need to forcely preload your animations shown through variable just like if they were characters?
Just look for PlayPictureAnimation in Component_CommandInterpreter. There look for the line where the picture is create using @interpreter.createPicture and add the following under it: (Take care of the correct indentation of the code):
Code:if !picture @interpreter.pointer-- @interpreter.isWaiting = yes @interpreter.waitCounter = 1 return
That will check if the graphic is already loaded, if not it will pause the interpreter. I haven't tested it but it is the same code used in Show Picture tho. However, keep in mind that depending on the amount and size of graphic()s the entire game might get stuck for a short moment especially if it is a web game because then the graphic needs to be loaded from the server first.
Also, I had to do something similar with Pan Screen as well. Would you mind checking them all soon or later?
What is the issue with Pan Screen? -
It's about something like a missing
Code:if I remember correctly. Not sure if it was pan screen or scroll background though.@interpreter.numberValueOf() -
[closed]IgnoreMe[/closed]