Forums

Topic: Petit Computer

Posts 9,221 to 9,240 of 9,618

TexMurphy

I hope they change the way we load people's programs. The more lines of code the more qr codes to scan. Maybe they can run programs from an SD card?

TexMurphy

Discostew

Can someone check something for me? Try out this line of code and report back here. For some reason on my 3DS, the first noise note is extremely short, but the rest are not.

BGMPLAY ":3@151CDEFGAB<C"

Discostew

Switch Friend Code: SW-6473-2521-3817

damolii

@Discostew IT might be other channels interfering, or does it do that when you play it by itself? It works fine on my side...

I don't have a 3DS so what do I put here? -Damolii

randomous

@Discostew I've noticed that it does that too. Whenever I put the "noise" sound at the beginning of a song, it sometimes gets cut off. It did the same thing in the Super Mario Bros 2 theme that I made. I don't know what the problem is, but I've definitely noticed it.

Edit: Oops, I remember why now (or at least, why it happened to me). The keyboard "chunk" sound uses enough "noise" that it cuts out the first note, and it's long enough such that it overlaps with it. If you run the program with the start button, it doesn't do that.

[Edited by randomous]

randomous

LeviCelJir

Since you can't package COLs, How do I make a COL in a program without CHRED or anything?

Hi I'm Levi and I like Bloopys :^)

Discostew

@randomous Ok, that was the problem. I was executing that line of code right from the console, so I could only use the "enter" key to execute it, which made that keyboard sound. When I put it into the actual code area and threw a WAIT 60 line above it, it played just fine.

Kinda odd though because unless I'm mistaken, there are 2 noise channels, not just one, so maybe that keyboard sound is using both?

Discostew

Switch Friend Code: SW-6473-2521-3817

Pixelrobin

I hope PTC 3D will offer alpha transparency....

Everybody do a chirp. CHIRP.

Discostew

@Bluerobin2 They better, and more. I imagine they are going to be using the 3D hardware for most of the rendering instead of legacy 2D hardware. Technically, PTC could have done this and many other stuff which didn't require much to activate. Why they chose not to include them, I don't know.

An example is mosaicing, which is the effect of pixelation to big blocks and back. All that's required to set that up is the designated targets like backgrounds, sprites, etc, and then how much of the effect should be applied. It is not separate for each thing though. They all share it.

Discostew

Switch Friend Code: SW-6473-2521-3817

bigdog00

TexMurphy wrote:

I hope they change the way we load people's programs. The more lines of code the more qr codes to scan. Maybe they can run programs from an SD card?

Don't take this the wrong way, but think about the exploits and s*** that could be done due to them allowing people to launch from the SD card. I would bet money that I or someone else would find a way into the system within weeks.

I like petit computer! Asphault 3d is awesome!

X:

Discostew

bigdog00 wrote:

TexMurphy wrote:

I hope they change the way we load people's programs. The more lines of code the more qr codes to scan. Maybe they can run programs from an SD card?

Don't take this the wrong way, but think about the exploits and s*** that could be done due to them allowing people to launch from the SD card. I would bet money that I or someone else would find a way into the system within weeks.

They're going to have to supply some method other than QR codes. Those codes hold so little data. MM2PTC is almost 300KB of code + 2.5 GRPs (at 49KB each), so my program now (which is still not finished) is about 423KB, equivalent to about about 175 QR codes. We're currently working with a limit of just under 10k lines of code. The 3DS version will have 100x times that.

PTC3D is going to have to be on the SD card anyways just like any other downloaded 3DS app, so its data will be as well. I imagine that the program itself will reserve a set amount of space on the card that holds all code and assets in encrypted form, and the only way to get your code/assets into it is by an import feature within PTC3D, so you have to import them in before anything can be used.

Discostew

Switch Friend Code: SW-6473-2521-3817

TexMurphy

bigdog00 wrote:

TexMurphy wrote:

I hope they change the way we load people's programs. The more lines of code the more qr codes to scan. Maybe they can run programs from an SD card?

Don't take this the wrong way, but think about the exploits and s*** that could be done due to them allowing people to launch from the SD card. I would bet money that I or someone else would find a way into the system within weeks.

I agree with you. Thats why I don't use my ds to go on the web (other than its way too slow). There is no virus software I know to fix anything that happens to my ds system. But, on the other hand, I can't stand scanning qr codes in varying degrees of clarity. Maybe they can upload it to the cloud and downloaded like DSIware? Free Then again they might discontinue that service too on May 20, 2014.

[Edited by TexMurphy]

TexMurphy

Discostew

I really wonder what programming extras SmileBoom is going to have with PTC3D. We got rumors of functions and local variables, but in the grand scheme of things, if they feel people are going to be using just under 1 million lines of code, I would assume they're going to have numerous other additions that weren't available in PTC to ease up the overall programming experience. I have a couple I'd personally like to see added.


TYPES. Currently, there are just 2 types in PTC. Numerical and string. Numerical is always float, leading to some extra code to be used when you just want an integer (aka a whole number). Most other BASIC languages have integers and floats as separate types, and I think it would be beneficial if PTC3D had them separate too. Integers are processed far quicker than floats and are used heavily with bitwise operations. Plus, when doing something like dividing two integers, the result truncates the decimal, so you won't have to resort to extra code like FLOOR on those types. One other thing with types is that the programmer can make their own types. Variables inside a variable in a manner of speaking. Think of it like sprites having 8 slots for values using SPSETV and SPGETV, except you call this internal variable by name following a period that follows the variable type. also like regular arrays, you can have an array of the type you make.

TYPE MYTYPE
VAR1 AS STRING
VAR2 AS INTEGER
END TYPE

DIM MYVAR as MYTYPE

MYVAR.VAR1 = "A"
MYVAR.VAR2 = 10

PRINT MYVAR.VAR1 * MYVAR.VAR2

(would print AAAAAAAAAA)


More C/C++ operators. Currently, the only one PTC has is "!=", which represents most Basic languages "not equal to", or "<>". There are plenty more, such as "++" and "--", which increment/decrement a number. Then there's also "+=", "-=", "*=", "/=", etc. Then there are bit shifts like ">>" and "<<" (I won't give examples of those)

A=1
A++ (would make A equal to 2, like if the code was A=A+1)
A-- (would make A, after being 2, back to 1, like if the code was A=A-1)
A+=2 (would make A, after being 1, become 3, like if the code was A=A+2)
A-=2 (would make A, after being 3, become 1, like if the code was A=A-2)
A*=3 (would make A, after being 1, become 3, like if the code was A=A*3)
etc etc etc

Discostew

Switch Friend Code: SW-6473-2521-3817

Pixelrobin

@Discostew they should also make the "==" optional why not just If x=x2 then...? I also agree with you on +=,-=,etc especially if you have long variable names. But then again, this is BASIC, not C so I honestly doubt they'll add user types.

Everybody do a chirp. CHIRP.

Traulight

What are arrays and what are they used for? And also, what are some commands for arrays or related to arrays?

Traulight

Discostew

@Bluerobin2 Honestly, I prefer "==" for comparing data, plus it can be used outside of IF statements, like so...

A = B + (C == 3)

It assigns A to the value of B, plus 1 if C is equal to 3. Honestly, I would find it confusing if someone programmed that same line of code with using "=" in the place of "==" like so..

A = B + (C = 3)

...because then it would look like they're assigning C to equal 3, and then using that to add to B then assigning to A, rather than just adding 1 if C does equal 3. As much as it is a BASIC language, they've incorporated some C aspects, so it may confuse people if they began mixing up those contexts. As for user types, Basic languages have been using those for a long time. As it is right now, PTC examines the labels before it is ever executed, so they could do the same with those as they'd probably do with functions.

Discostew

Switch Friend Code: SW-6473-2521-3817

Pixelrobin

@Discostew oh... ok

@Traulight an array is a type of variable that stores multiple "things" in it. They are used a lot for map and level data. I wish I could explain more, but im on a 3ds. There are plenty of good tutorials online.

Everybody do a chirp. CHIRP.

Slayer

And of course I just HAD to release a game that is in alpha. I can't learn this language. Tutorials don't help, I can't ask questions anymore, I may very well just leave and just play games that people make. I don't understand any of this, every time I look at my own GAME I don't know what to do. I also have no idea if anyone will even see this.

[Edited by Slayer]

I have nothing really to say about myself.

Lego-Meister

@Slayer We are here to help. Go ahead and ask anything you want about petit computer.

Some programmers pride themselves on how many more lines of code they can write. I pride myself on how many less.

TexMurphy

Traulight wrote:

What are arrays and what are they used for? And also, what are some commands for arrays or related to arrays?

An array is a variable with one name that holds many values. Values can be numbers or strings (words or phrases). Examples: List of names or a table of numbers. You can hold a table of numbers that represents a picture or a map. Commands are: CLEAR to clear memory before creating your array. DIM to create your array (DIM myarray( size of array) or DIM myarray( number of columns, number of rows)). RESTORE looks for location of information to put into array, like RESTORE @mydata. READ reads your data an puts it into your array. READ myarray( index to element in array). Read typically needs to be inside of a FOR NEXT loop to read more than one value. DATA list your values to use in your array. DATA 1,2,4,5 or DATA "cat","dog","randomouse".
Arrays can have a single dimension like a row or double dimension like a table. To enter values into a double array you need two FOR NEXT loops.
CLEAR
DIM myarray(3,3)
RESTORE @mydata
FOR j=0 TO 2
FOR i=0 TO 2
READ myarray(i,j)
NEXT
NEXT
@mydata
DATA 1,2,3,4,5,6,7,8,9
FOR J=0 TO 2
FOR I=0 TO 2
LOCATE i,j
PRINT myarray(i,j)
NEXT
NEXT
Note that when creating an array the column and rows represent how many values we want. BUT when indexing the array, always start with zero to one less than the number of columns and rows. myarray(0,0) , myarray(1,0), myarray(2,0), myarray(0,1), myarray(1,1), etc. We get the same number of columns and rows we wanted but we just have to start indexing at zero. See Making of Mortal Kombat PTC on Petit Computer Wikia under Tutorials for more information on using arrays in an actual program.

[Edited by TexMurphy]

TexMurphy

Pixelrobin

DATA is completely different from arrays even though it gets used with them often. DATA is... data. It is a way a programmer can say how a map would look like or what the players stats are, etc. Arrays are variables that can store this data, especially useful if its going to be edited or read.

eh, that was confusing.

Everybody do a chirp. CHIRP.

Sorry, this topic has been locked.