トピック
Emily GymLeaderErika

Can someone elaborate on the SPANIM command?

One thing I don't understand is the Time thing (the in-game help only says "Animation data itself"), and also maybe the Item(s). How does SM detect if there's Item 2 or not?
1そうだね
未プレイ
返信[1]
親投稿
L. Lohadaa
There are multiple usages of SPANIM, but I'm gonna explain the code you'll end up using the most. Refer to screenshot green text. Those numbers are how SmileBASIC knows which sprite to show for how long. Also I haven't looked at it myself, but Nobu created a sample program to illustrate sprite animations. Take a look. [XKA334JX]
0そうだね
プレイ済み
返信[2]
親投稿
L. Lohadaa
Oh, where the green text says "display in X sec", I actually mean "display WITHIN X sec". Just didn't have enough space.
0そうだね
未プレイ
返信[3]
親投稿
Emily GymLeaderErika
OK I'll try to use that as my 2nd reference, as my current reference was this Halloween "Screen Saver"-type program: https://miiverse.nintendo.net/posts/AYMHAAACAAADVHkiYhoPww And one thing to self-learn was tweaking the values of the SPANIM commands & do some trial-and-error runs, but I'm still having lots of questions later...
0そうだね
未プレイ
返信[4]
親投稿
Emily GymLeaderErika
lol... "just shut up and put it" .-. A bit insulting don't ya think?
0そうだね
未プレイ
返信[5]
親投稿
L. Lohadaa
Nothing personal ;)
0そうだね
未プレイ
返信[6]
親投稿
Emily GymLeaderErika
Yeah I'm aware you didn't do that hehe. Anyway there are 2 I also don't understand: "Adding 8 to the target numerical value will cause the value to be treated as being relative to the run time" & "Suffixing the character string with "+" will also cause the value to be treated as being relative to the run time" What do they mean? Maybe I'll know if I'm already above n00b level...
0そうだね
未プレイ
返信[7]
親投稿
L. Lohadaa
Umm sorry, where did you see those? I didn't see those in the Halloween program and I'm equally confused. Context please
0そうだね
未プレイ
返信[8]
親投稿
Emily GymLeaderErika
Oh, forgot to mention they're the instructions for the SPANIM command ^_^' ... You can refer it here: http://smilebasic.com/en/reference/
0そうだね
未プレイ
返信[9]
親投稿
Emily GymLeaderErika
Anyway, from that Halloween screen saver-type program, if I remove the + from the "XY+" from Line 79, that witch girl sprite will float as it goes to the right. Why is that lol?
0そうだね
未プレイ
返信[10]
親投稿
L. Lohadaa
Ah ok that made more sense. So SPANIM 11,"XY+",-1000,500,0 means to "display sprite 11, and within 1000/60 sec, move it 500 pixels right and 0 pixels up, endless loop". The + means it's RELATIVE to the current coordinates. Without + it'll mean "display sprite 11, within 1000/60 sec, move it to coordinate (500,0) endless loop." In SmileBasic, coordinate (500,0) is the upper right corner.
0そうだね
未プレイ
返信[11]
親投稿
L. Lohadaa
So that's what they meant by "adding + means to treat it as being relative to the current state". And since you can shorthand XY to 0 and XY+ to 8, that's the "8" part.
0そうだね
未プレイ
返信[12]
親投稿
Emily GymLeaderErika
Ah I see. Thanks for the tips :) BTW, why is it -1000 instead of 1000? What will happen if the time is negative?
0そうだね
未プレイ
返信[13]
親投稿
L. Lohadaa
Only "I" and "V" requires positive time (our sense of time) but the remaining five modes ("XY","Z","C" etc) require negative time. Negative time tells the program to CHANGE SMOOTHLY within that time frame. In this case, it has to move the witch smoothly in 16.6 sec. Put a positive time and the witch suddenly appears without moving. Just treat it as a requirement.
0そうだね
未プレイ
返信[14]
親投稿
Emily GymLeaderErika
Ahh thanks. I didn't know this, as the manual didn't mention about it neither. Also, what's different from the UV coordinates to the XY?
0そうだね
未プレイ
返信[15]
親投稿
L. Lohadaa
Imagine a large image. UV means to move the CAMERA from a particular set of coordinates to another. It doesn't move the image itself like XY, just the view. Umm...get it? *notices your NNID* OK, Celadon City is just a large map right? But our view is always one screen at a time. That's because the camera moves with UV. It doesn't actually move the entire Celadon map around, just the view.
0そうだね
未プレイ
返信[16]
親投稿
Emily GymLeaderErika
Ahh ok. BTW, does that UV coordinates also determine the pivot for rotation right? Like for example there's a Yo-yo sprite... if the pivot is the center of the yoyo disc instead of the string, then only the string rotates.
0そうだね
未プレイ