プレイ日記
mystman12 mystman12
Anybody know how attributes work? I just want to mirror a sprite, but all I see in the reference is that I need to use an attribute, something about ¦b03¦ and #SOMETHING. I can't figure out how to use it...
1そうだね
プレイ済み
返信[1]
親投稿
TN21 Trinitro21
The value is binary. The different bits in the binary number mean different things. The # things are system constants. They're pretty much just variables. The first bit is visibility, and can be represented with 1 or #SPSHOW. The one that horizontally flips it is 8 and has a system constant of #SPREVH. You'd want (#SPREVH OR #SPSHOW). If you want to do it in decimal, that would be 9.
1そうだね
プレイ済み
返信[2]
親投稿
mystman12 mystman12
But what is the command for SPSET? I tried: SPSET 1,0,0,64,64,1,#SPREVH but that just results in an error...
0そうだね
プレイ済み
返信[3]
親投稿
TN21 Trinitro21
Why is that second 1 there? It isn't listed in any of the SPSET definitions in the reference. Take it out and you should be error free.
0そうだね
プレイ済み
返信[4]
親投稿
mystman12 mystman12
The 1 was for #SPSHOW, without it the sprite is invisible. Now I've tried creating two seperate commands, SPSET with the #SPSHOW attribute, and SPDEF with the #SPREVH attribute. Now, while the sprite shows, and there are no errors, it still isn't mirrored... I don't understand why some of these things have been made so much more complicated from PTC...
0そうだね
プレイ済み
返信[5]
親投稿
MerZ LinkZ19
There's another way to mirror a sprite Try this SPANIM 1,"S",1,-1,1,0
0そうだね
プレイ済み
返信[6]
親投稿
mystman12 mystman12
Hold up, I got it! I used SPCHR instead of SPDEF, and it works fine now! That said, there has to be a way to add multiple attributes to a sprite in one command, right? If there's a simpler way to do this, please let me know!
0そうだね
プレイ済み
返信[7]
親投稿
Gale Storm GaleTheStorm
As a previous post mentioned, the number you enter is referenced via binary. The b's you see next to the numbers reference these bits and look like this: Bit 03 Bit 02 Bit 01 Bit00 0 0 0 0 I don't know the attributes by heart yet, so i'll use an example. Let's say bits 0-1 controlled rotation. 0:0 , 1:90 , 2:180 , 3:270. Because of how attribute works, you >>
0そうだね
プレイ済み
返信[8]
親投稿
Gale Storm GaleTheStorm
have two options: you can either put in a normal number or its binary equivalent. In the example I provided, if I wanted to rotate it by 270 degrees, the corresponding but values would be ( bit01: 1 bit00: 1 ) or the number 3. Now, if you wish to use the first method, the number you use needs to be in binary format, with " &B ". The number also needs to be as big as number of bits.
0そうだね
プレイ済み
返信[9]
親投稿
Gale Storm GaleTheStorm
I'll be back with visuals.
0そうだね
プレイ済み
返信[10]
親投稿
Gale Storm GaleTheStorm
In the pic, I used SPDEF, but the same principle applies. Notice what I typed at the end: " &B010001 " With the aide of the binary format, each individual number represents a bit: 0 1 0 0 0 1 Bits: 05 04 03 02 01 00 With this, you can apply a 1 to whatever you want to be true. In this case, I told it to show the sprite and invert it vertically.
0そうだね
プレイ済み
返信[11]
親投稿
Gale Storm GaleTheStorm
Like so: Alternatively, I could've simply typed in the numerical equivalent of (0)10001, which is 17, at the end to get the same result. However, I find it easier to manage when actually looking at the bits. Hope this helps somewhat. If not, then I tried. :p
1そうだね
プレイ済み
返信[12]
親投稿
Gale Storm GaleTheStorm
I was stuck on this as well, but I learned how it works with the ATTR command, which messes with text on the display console. It was helpful because it used less bits.
0そうだね
プレイ済み
返信[13]
親投稿
TN21 Trinitro21
(#SPSHOW OR #SPREVH) also does the same thing. So does (#SPSHOW+#SPREVH)
0そうだね
プレイ済み
返信[14]
親投稿
mystman12 mystman12
@GTAerohog Ah, thank you! I understand now! Looks like I can also add them together using #THIS+#THAT. Thanks for your help!
0そうだね
プレイ済み