#261✎ 256niconiiPower UserVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!Hobbies
What happened to maps in SB4?
All that's gone is that there isn't a built-in map editor for SB4 (at least not yet, who knows if one'll be added). Map files themselves aren't anything special, they're just integer arrays saved to DAT files using SAVEV "DAT:NAME",ARRAY. The main thing is just loading the data and getting it into a format that TLOAD can use, because this has changed since BGLOAD in SB3.
TLOAD expects an integer array that looks like this:
The array is three-dimensional, with the size [height, width, 2]. (2D or 1D arrays are fine too, as long as the data's in the right order.)
Each tile is represented with a pair of values, so for the tile at coordinates (x, y), ARRAY[y, x, 0] gets the first value, and ARRAY[y, x, 1] gets the second value.
The first value holds the display attributes in the upper 16 bits, and the character code in the lower 16 bits.
The second value holds the color of the tile, which is the color you set with COLOR, TCOLOR, etc. Usually, this is white.
Now, keep in mind that this is just the format that TLOAD expects. If you make a map editor, there's probably more information you'd store in that file, like what the width and height actually are, or maybe storing multiple BG layers into a single file. It really doesn't matter what format you use, as long as you're able to load it one way or another.
Posted
#262✎ 256niconiiPower UserVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!HobbiesAlso, while messing around with that, found an undocumented attribute for tiles:
Bit 7 (i.e. 128) is reverse video. It forces the tile color to black (respecting alpha), and uses the color set for that tile as the background color.
ATTR won't allow you to set it (it gives an Out of range error), but you can set it with TLOAD, TARRAY, and probably other commands.
EDIT: "Forces to black" isn't quite right. It only looks like that in front of a black background. Basically, wherever the font is opaque, it makes the tile transparent there, and vice versa. See below for screenshots that make it much clearer what's going on.
Posted
Edited
by niconii
#263✎ 1134snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!Achievements
Also, while messing around with that, found an undocumented attribute for tiles:
Bit 7 (i.e. 128) is reverse video. It forces the tile color to black (respecting alpha), and uses the color set for that tile as the background color.
ATTR won't allow you to set it (it gives an Out of range error), but you can set it with TLOAD, TARRAY, and probably other commands.
Could you send some example images? This seems really interesting.
Posted
#264✎ 256niconiiPower UserVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!Hobbies
Also, while messing around with that, found an undocumented attribute for tiles:
Bit 7 (i.e. 128) is reverse video. It forces the tile color to black (respecting alpha), and uses the color set for that tile as the background color.
ATTR won't allow you to set it (it gives an Out of range error), but you can set it with TLOAD, TARRAY, and probably other commands.
Could you send some example images? This seems really interesting.
I don't have images on hand, but basically just imagine you could set the background color of text, but the foreground color had to be #C_CLEAR. That's pretty much all it is.
EDIT: Okay, here they are. While taking these, I found something even more bizarre about this feature: It only works on text screen 4. Considering it's not documented, stuff like ATTR forbids using it, and it's specific to text screen 4, this really feels like some left-over feature they didn't think to remove.
Posted
Edited
by niconii
#265✎ 1134snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsHmm, so it's like the trick in SB3 where you set the text foreground to transparent and the text background to black. The text screen is basically stenciled by the text characters. IIRC this was faster to make custom text coloring than GPUTCHR was.
Posted
#266✎ 1134snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsThe inverse bit seems to be illegal for sprite attributes (Out of range.) If there is one for sprites I can't find it.
It is illegal to use the text inverse bit on ATTRTPUTTFILL so the only legitimate way to use it is with TLOAD or a TARRAY/TUPDATE.
This seems like a useful feature even if it is weird and smileboom should try to make it more accessible.
Posted
#267✎ 188412Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfSo does it invert all the channels? or something more complex?
Posted
#268✎ 256niconiiPower UserVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!Hobbies
So does it invert all the channels? or something more complex?
(with colors normalized from 0.0 to 1.0)
(font ARGB = actual pixel colors in GRP)
(tile ARGB = color set with COLOR, etc.)
(ARGB = color displayed on screen)
Normal:
A = font A * tile A
R = font R * tile R
G = font G * tile G
B = font B * tile B
Reverse:
A = (1.0 - font A) * tile A
R = tile R
G = tile G
B = tile B
Posted
#269✎ 188412Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfAre you sure it's not
R = (1-font R) * Tile R etc.?
Posted
#270✎ 256niconiiPower UserVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!Hobbies
Are you sure it's not
R = (1-font R) * Tile R etc.?
Yes, I'm sure. The color of the font is completely ignored other than alpha. (I've done more tests than the screenshots I showed earlier.)
The equation might be a little more complicated than just A = (1.0 - font A) * tile A, though. I am sure that the font's RGB channels are ignored, however.
Posted
Edited
by niconii
#271✎ 567HTV04Forum LeaderHiddenAchievementsThird YearMy account is over 3 years oldWebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthWhat do all of the function keys do?
Posted
#272✎ 256niconiiPower UserVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!Hobbies
What do all of the function keys do?
There's a list of the default keyboard bindings in the reference.
Posted
#273✎ 343MinxrodThird YearMy account is over 3 years oldWebsiteExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthQSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source QSP Contest!
What do all of the function keys do?
There's a list of the default keyboard bindings in the reference.
Some useful ones to know:
F1 is help
F5 is run
F12 is TOP MENU
F9-F11 are the smile tools
F7 opens the code editor to Slot 0 and F8 is DIRECT MODE
Posted
#274✎ 1134snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!Achievements
What do all of the function keys do?
There's a list of the default keyboard bindings in the reference.
Some useful ones to know:
F1 is help
F5 is run
F12 is TOP MENU
F9-F11 are the smile tools
F7 opens the code editor to Slot 0 and F8 is DIRECT MODE
Ctrl+0 is direct and Ctrl+1-4 is edit slots 0-3. IIRC X on the controller switches between edit and direct.
Posted
#275✎ 203NathanielAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsStaff Pick"Your program is one of our favorites!" - StaffAchievementsScholarReceived for knowing a great deal about programming topicsAchievementsIs there an easy way to load GRP's from SB3 to SB4? I transferred the file over but I can't just use GLOAD.
Posted
#276✎ 256niconiiPower UserVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!HobbiesLOADG "DAT:SB3GRP",0
SAVEG "GRP:SB4GRP",0
Keep in mind this is LOADG/SAVEG, not GLOAD/GSAVE.
Posted
Edited
by niconii
#277✎ 1134snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsDoes anyone have a USB mouse that actually works with SB4? Can you read the wheel and tell me what the output looks like?
Posted
#278✎ 203NathanielAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsStaff Pick"Your program is one of our favorites!" - StaffAchievementsScholarReceived for knowing a great deal about programming topicsAchievementsMine outputted a number that increased and decreased as I scrolled the mouse wheel up and down. It only seemed to output multiples of 120.
Posted
#279✎ 405CyberYoshi64Expert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthGreat PageHiddenAchievementsNight PersonI like the quiet night and sleep late.Express YourselfDamn, too bad I'll never get a Switch until Nintendo eventually discontinues it or so...
Posted
#280✎ 47PetitProfessorHas anyone messed around with the IRsensor shooting mode? I’m trying to set something up like the Wii controller where a sprite moves across the screen depending on where you’re pointing a controller. Should I be looking more into the gyroscope or do you think the IRsensor is the right way to pull it off?
Posted