@HappyHappyist I used to program in Visual Basic. Gave up on it. After a few years, I found this. It really inspired me to get back into programming. Now I am a decent programmer in C#, very fluent in Petit Computer, and a few other lesser-known languages. Agreed 100% with you.
When I was very young, I was introduced to Visual Basic. And I was using the computer a lot programming in it. I made a football scoreboard by myself and I stand proud by that program today. I even have it on my hard drive on this very computer, but it was programmed on the computer sitting at my feet right now as I use my gaming PC that is weakened, struck by a terrible hardware problem with the liquid cooling system tube that brought it to its metaphorical knees.
Conclusion: I used to use VB all the TIME before I abandoned it and found other languages that were interesting. I just can't seem to learn PTC that well...
i'd like to add on that this community has been extremely helpful. in my time here, this one forum answered each question very thoroughly and politely. without such threads, learning PTC is nearly impossible, so thanks for the help guys, you're part of the solution.
i am part of a social group interested in uniting the world by painting it blue.
Blue blue.
I began with GW-Basic, moved to Q-Basic, then to Visual Basic. I remember using a DX7 wrapper and began work on what I called RPGC, which was to make games along the lines of Secret of Mana. The original website for it still exists here. It was quite ambitious, and that's why it never got finished, because I didn't know enough game logic to carry it out. It wasn't until I taught myself the C language via GBA homebrew that I began to learn that, but I never went back to that project. From there I went on to DS homebrew, as well as learned C++ and C# on my own. I learned other languages like Java in school and techniques in game programming, but my favorite is the C-based language.
PTC wasn't hard for me because of my BASIC background.
Discostew
3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew
@randomous or maybe @Discostew I have a program request. Could you make a program that turns PTC COL files into color swatches for popular image editors (Photoshop, Paint.NET, GIMP, Greenfish icon editor, inkscape, etc) or an image to use the color picker tool on. This will be useful for people like me; who make their graohics on a computer with their own colors. I wanted to do it for a while, but I don't understand how PTC encodes (or whatever it is) stuff.
There's not much to taking the colors from a PTC COL file. After the 48-byte header (which is present in all PTC files), the remaining 512 bytes make up the 256 colors. Each color is represented as 16-bit values (only 15-bits is used), which is 2-bytes (2bytes * 256 = 512 bytes). The first 5 bits are for red (making a range of 0 to 31), next 5 for green, and last 5 for blue. The final bit of the 16-bit value is always 0 because only the first 15 get occupied. After getting each component, you can upscale to 24-bit by multiplying each component value by 8 (forcing the range from 0-31 to 0-255, although 31 will be shown as 248). 32-bit is just 24-bit with an extra component for alpha (set at 255 for opaque).
Discostew
3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew
I never knew how REALLY REALLY REALLY REALLY really HARD ADDING CRAFTING IS IN A GAME. I probably did it really inefficiently too. Ehh atleast it's a system I can easily add crafts with.
There's not much to taking the colors from a PTC COL file. After the 48-byte header (which is present in all PTC files), the remaining 512 bytes make up the 256 colors. Each color is represented as 16-bit values (only 15-bits is used), which is 2-bytes (2bytes * 256 = 512 bytes). The first 5 bits are for red (making a range of 0 to 31), next 5 for green, and last 5 for blue. The final bit of the 16-bit value is always 0 because only the first 15 get occupied. After getting each component, you can upscale to 24-bit by multiplying each component value by 8 (forcing the range from 0-31 to 0-255, although 31 will be shown as 248). 32-bit is just 24-bit with an extra component for alpha (set at 255 for opaque).
What I got from that:
Colours colours colours bit stuff values
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
PTC was probably my first program experience actually, I don't think you could count a crappy LUA script that does nothing as a programming experience. After PTC I wanted to get into more advanced things, and my OS had suddenly quit on me forcing me to install Ubuntu. From there I tried a C compiler on Ubuntu and got really into C. C++, didn't really like. Randomous persuaded me to try C# and so I installed Visual Studio after installing Windows 7. I know know more C# than any other object oriented language now and finally know a little bit of Visual Basic. I have also tried Java. Now I can program in Javascript, C, C#, SmileBASIC, a little bit of Java, and HTML & CSS.
Now everyone back in your camping tents, campfire stories are over sadly
I can work in (esoteric languages):
Brainf*ck
pBrain
I've worked in (legit languages):
Visual Basic
C
C++
Javascript
HTML Design Language
I've worked in (esoteric languages):
LOLCODE
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
I can work in (esoteric languages):
Brainf*ck
pBrain
I've worked in (legit languages):
Visual Basic
C
C++
Javascript
HTML Design Language
I've worked in (esoteric languages):
LOLCODE
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
So I guess since everyone is doing it, I will too. Not very impressive for me, I know SmileBASIC and GML (GameMakerLanguage) really well, I know a fair bit of C, And I'm not too shabby at HTML and Javascript.
If PTC 3D has functions and local variable capabilities, then how will we define global variables/arrays? In most languages nowadays that have global and local assignments, the programs have an entry point that isn't necessarily at the top of the program. With that, global variables are placed at the top and are allocated before the program starts.
Maybe we'll have to assign global/local variables by having the command global/local in front of the variable/array.
Discostew
3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew
If PTC 3D has functions and local variable capabilities, then how will we define global variables/arrays? In most languages nowadays that have global and local assignments, the programs have an entry point that isn't necessarily at the top of the program. With that, global variables are placed at the top and are allocated before the program starts.
Maybe we'll have to assign global/local variables by having the command global/local in front of the variable/array.
You would do something like this:
Class hi():
Def hello(self):
Global a
A=3
G=4
Print(a)
Print(g)
That way G could only be accessed from that block of code, but any section of code could read A.
You probably understood that already, but you should only have to use the Global command.
I think it should be automatic depending on what scope the variables is first introduced in.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
@Discostew Considering how BASIC works and how "easy" the developers would like to make the programming, I'm thinking that all variables will be automatically global, and if you want a local variable, you'll have to do something extra. OR maybe the ONLY local variables have to be declared when you declare/define the function. For instance, when you make a function, maybe the function name has to be followed by the local variables that you want to use. Like:
MyFunction(A, B, C)
USES D, E, F, G
'D E F and G are local variables, A B and C are parameters.
ENDFUNCTION
Forums
Topic: Petit Computer
Posts 9,201 to 9,220 of 9,620
Please login or sign up to reply to this topic