Forums

Topic: Petit Computer

Posts 7,841 to 7,860 of 9,620

InsertPi

@Leviceljir nowhere near that easy for some updates. When you load, do you see that huge clump of dots? Each one is representing a different attribute. One might be CAMX (your X coord), another line of dots is the version, a line of dots for your nickname, a dot for how far left or right you're looking (the variable CAMA), etc. The reason they can't convert in this update is because so much has changed in the saving, it is very difficult to convert. Each map has different attributes, so I can't just use a GCOPY on there. Some dots are moved, there are new lines of data, etc. Hehehe but beware for the save data for survival worlds.

Edited on by InsertPi

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

MechaPikachu

Okay, guys. Pretty new to Petit Computer and everyone here has been a great help but a few questions are needed. I have the labels for sprites down including GOSUB, GOTO, VSYNC, Etc BUT. I'm having trouble making the sprite move by one step intervals. it walks fine by long pressing the d-pad but a press-and-release makes it do a floating ty pe movement so. my question for that is, is there a way to fix that and can somebody link me or explain? I've been stumped on this. for a fee days. I can live with it but it's an OCD thing. Would it be that I'm not applying BTRIG()?

These are not the codes you are looking for.

Miblon

MechaPikachu wrote:

Okay, guys. Pretty new to Petit Computer and everyone here has been a great help but a few questions are needed. I have the labels for sprites down including GOSUB, GOTO, VSYNC, Etc BUT. I'm having trouble making the sprite move by one step intervals. it walks fine by long pressing the d-pad but a press-and-release makes it do a floating ty pe movement so. my question for that is, is there a way to fix that and can somebody link me or explain? I've been stumped on this. for a fee days. I can live with it but it's an OCD thing. Would it be that I'm not applying BTRIG()?

So what exactly is the problem? Is the character moving, but it's just not animating? I'm having the same problem. A picture would help if possible.

This isn't a interesting signature. Go look at someone elses.
Friend Code: 5370-0889-8930

InsertPi

@MechaPikachu I'm not quite understanding your problem. I'm definitely not the best with sprites, but I can help with a bit. Try this:

@START
ACLS:CLEAR
SPSET 'All the sprite setting stuff here
@LOOP
B=BUTTON()
IF B AND 1 THEN Y=Y-1
IF B AND 2 THEN Y=Y+1
IF B AND 4 THEN X=X-1
IF B AND 8 THEN X=X+1
SPOFS 0,X,Y
VSYNC 1 'Change this number for speed. The bigger the number, the slower the speed of movement
GOTO @LOOP

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

MechaPikachu

There's no animation on quick presses. It does the same when I try to turn in a different direction unless I long press and then change direction. Animation is completely fine when you hold one of the directions on the d-pad.

It's hard to explain without showing the code but I'll try that really quick and see if that fixes my problem.

These are not the codes you are looking for.

MechaPikachu

@IAmAPerson so, no that wasn't what I needed. I've seen other people with this problem and I tried researching other's codes but that was a no go.

These are not the codes you are looking for.

ramstrong

@randomous

Alright. I think I have it now. Just need checking on the PC side. But this here I load the graphic on Page 1. Page 2 holds the X coordinate. Page 3 holds the Y coordinate. Page 0 holds the final result.

It looks right by me, so far. Unfortunately, I noticed double Y coordinates on the venetian blind method. I wonder if that's right. If you can double check on this I'd appreciate it. It'll be a while for me to set it up on the PC side. If anybody want a QR on this please let me know. I can't make QR without PC, and it'll be awhile. Sorry.

ACLS

FN$="G0":'GRAPHIC FILENAME
LOAD "GRP1:"+FN$,FALSE
PNLTYPE "OFF"
WAIT 180

CX=0:CY=0
FOR J=0 TO 2:FOR I=0 TO 3
FOR Y=0 TO 7:FOR X=0 TO 7
FOR YY=0 TO 7:FOR XX=0 TO 7

GPAGE 0,2,2
GPSET (I*64+X*8+XX),(J*64+Y*8+YY),CX
GPAGE 1,3,3
GPSET (I*64+X*8+XX),(J*64+Y*8+YY),CY
CX=(CX+1)%256
IF CX==0 THEN CY=CY+1

NEXT:NEXT
NEXT:NEXT
NEXT:NEXT

WAIT 60

FOR J=0 TO 191:FOR I=0 TO 255
GPAGE 1,2,1
X=GSPOIT(I,J)
GPAGE 1,3,1
Y=GSPOIT(I,J)
GPAGE 1,1,1
C=GSPOIT(X,Y)
GPAGE 0,0,0
GPSET I,J,C
GPAGE 1,1,1
GPSET X,Y,0
NEXT:NEXT

WAIT 600

EDIT:

Did I say "I think I have it"? Well, now I'm confident I have it. Not 100% mind you. I can't believe I spent a whole day on this one simple problem. My brain must have been sleeping or something. Anyway, change the last few lines to this:

GPAGE 1,1,1
C=GSPOIT(I,J)
GPAGE 0,0,0
GPSET X,Y,C
GPAGE 1,1,1
'GPSET X,Y,0
NEXT:NEXT

WAIT 600

Just swapping I,J with X,Y. And you need to comment out GPSET X,Y,0 so there won't be blank strips on the picture.

@bluerobin2

RSORT/SORT only works on Numerals. I tried it on strings. Didn't work.

MechaPikachu wrote:

It's hard to explain without showing the code but I'll try that really quick and see if that fixes my problem.

Showing code is best. Why would you want to do otherwise? Just make sure all the code is relevant to the problem.

I think you're misunderstanding how SPANIM and SPOFS works. If you use the same timer on both, they should step in sync.

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

LeviCelJir

EHHHH Well The three texture packs I wanted to release will not be released for a few weeks. Because...

My Computer Brokes D:

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

MechaPikachu

ACLS

SPSET ----
SPOFS ----- (SPOFS doesn't do what it's told for some reason here)
SPSCALE --
SPANIM --
CX=16
CY=16
WALK=TRUE

@LOOP
B=BUTTON()
IF B AND 1 THEN GOSUB @UP
IF B AND 2 THEN GOSUB @DOWN


IF B==1 OR B==2 OR B==4 OR B==8 THEN GOSUB @WALK
IF B==0 THEN GOSUB @NOWALK
VSYNC 1
SPOFS 0, CX, CY, 1
GOTO @MOVEMENT

@UP
SPCHR --
CY=CY-1
RETURN


@WALK
IF WALK==TRUE THEN RETURN
SPANIM 0,4,15
WALK=TRUE
RETURN

@NOWALK
NOWALK=FALSE
SPANIM 0,1,15,0
VSYNC 1
RETURN

Long but I'm just starting out and that's as far as I can get. But hopefully you can see my problem here and now that you mention it, I probably am using SPOFS wrong here and SPANIM is not something I fully grasp just yet.

These are not the codes you are looking for.

ramstrong

MechaPikachu wrote:

SPOFS 0, CX, CY, 1
SPANIM 0,4,15

If you're going to post something that long, may as well include all the parameters. Using SPANIM --- doesn't help at all. The way I see it, you're mixing single-frame animation with timed animation. You should use timed animation all the time, unless there's a very good reason not to do so. I look at CX,CY increment, and I should see 15, or whatever it is that you use for distance/step. I don't want to see 1 in timed animation scenarios.

If it helps, try to do it without time interpolation, and just do everything single frame (minus SPANIM). Then use time interpolation. Then use SPANIM. Doing it in stages will help you focus on one problem at a time. Just make sure to use the right kind of stages. Since you're beginner, a degree of experimentation is necessary. Don't try to mimic without thinking. Other people have had their experimentation/growing up process already. If you just copy other's code without understanding, then you're heading for trouble. Take time to experiment each feature individually outside a game. Just write code to understand how a certain command work.

As a note, Sprite system in PTC is rather unique and it took me a long time to get comfortable with it. But once I do, I really appreciate the power inherent within. So, please stick with it. The reward is worth the journey.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

MechaPikachu

Thanks, I'll definitely stick with it and sorry about that. I do try to experiment without the help of others and it only helps on text based programs so far except for simple things as creating certain loops with certain commands. I have quite a few programs that are only codes and commands.

These are not the codes you are looking for.

ramstrong

MechaPikachu wrote:

Thanks, I'll definitely stick with it and sorry about that. I do try to experiment without the help of others and it only helps on text based programs so far except for simple things as creating certain loops with certain commands. I have quite a few programs that are only codes and commands.

No worries. It happens to the best of us. Witness my incompetence in trying to get SAVEGRP (External) program right.
Best of luck to you.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

randomous

@ramstrong I'm sorry, I've been in classes all day. Did you say you wanted to write out to a GRP in PTC in such a way that when it is read by a computer, it is in "linear" order? In other words, it'll look "incorrect" on PTC, but correct on a computer? Why not just reverse the assignment in the given for loop? You know, instead of reading from linear and writing as block, read as block and write as linear? Or am I not think of this right? Anyway, I'll be able to test your code after I cook dinner.

randomous

ramstrong

randomous wrote:

@ramstrong I'm sorry, I've been in classes all day. Did you say you wanted to write out to a GRP in PTC in such a way that when it is read by a computer, it is in "linear" order? In other words, it'll look "incorrect" on PTC, but correct on a computer? Why not just reverse the assignment in the given for loop? You know, instead of reading from linear and writing as block, read as block and write as linear? Or am I not think of this right? Anyway, I'll be able to test your code after I cook dinner.

Yes, that's exactly what I've been trying to do. I think the difficulties lies in that I'm trying to do it 2 dimensional way, some misplaced arrows (pointer), large data set, and the fact that my brain is sleeping the whole day.

Oh, and there's a problem of "double encoding" to worry about. The coding process is not both ways. But my brain is sleeping problem is the biggest issue here. ^_^;

EDIT

It used to be I do my best work when I'm cold and hungry. Apparently, that's no longer true. Once I'm warm and fed in McDonald (Getting all those Streetpasses), I sketched out the solution on the receipt, and found out that my code worked backwards. It's 5 minutes work after that.

It's a pointer problem, so if you drop C language because you can't handle pointers, well, I'll say you'd better learn those pointers because you'll be running into such problems regardless of language whether it's C or Basic!

I'm 100% confident this is good. Just waiting for the confirmation from randomous and/or discostew. Thank you for checking.

LOAD "GRP1:FILENAME",FALSE
PNLTYPE "OFF"
GOSUB @SCAN
END

@SCAN
CX=0:CY=0
FOR J=0 TO 2:FOR I=0 TO 3
FOR Y=0 TO 7:FOR X=0 TO 7
FOR YY=0 TO 7:FOR XX=0 TO 7

GPAGE 1
C=GSPOIT((I*64+X*8+XX),(J*64+Y*8+YY))
GPSET (I*64+X*8+XX),(J*64+Y*8+YY),0
GPAGE 0
GPSET CX,CY,C
CX=(CX+1)%256
IF CX==0 THEN CY=CY+1

NEXT:NEXT
NEXT:NEXT
NEXT:NEXT

RETURN

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

InsertPi

Minecraft DS now has toggleable render distance! It had render distance before, but it was fixed at 16 blocks. Now you can have a distance of 8, 16, 24, or 32 block render distance, and also the option to completely turn it off (it actually sets the render distance to 999 in the code--quick tidbit right there).

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

LeviCelJir

IAmAPerson wrote:

Minecraft DS now has toggleable render distance! It had render distance before, but it was fixed at 16 blocks. Now you can have a distance of 8, 16, 24, or 32 block render distance, and also the option to completely turn it off (it actually sets the render distance to 999 in the code--quick tidbit right there).

Thank you.

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

Miblon

After a couple of minutes of transferring pictures onto my laptop, I'm finally showing you a preview of what I'm developing.
http://imgur.com/8cMuRXC
Miblash- The game!
http://imgur.com/45ixD65
Here's the character, he can walk and slash with his mighty blade!

This isn't a interesting signature. Go look at someone elses.
Friend Code: 5370-0889-8930

randomous

@ramstrong Sorry, I only just now got to test it. It seems pretty close, but there's something wrong. Here's what I did:

  • Generated a test GRP with the letters A-Z over and over. (ABCDEFGHIJKLMNOPQRSTUVWXYZ over and over)
  • Ran your program on the generated GRP
  • Got this on the computer: ABCDEFGHGHIJKLMNUVWXYZABABCDEFGHOPQRSTUVUVWXYZABIJKLMNOPOPQRSTUVWXYZ

So it messes up right at the 8 byte border, so something is just a little off. For confirmation (both because I know you'll want it, and because I'm not confident I did it exactly right), here's the program I wrote:
Untitled

Edited on by randomous

randomous

ramstrong

randomous wrote:

@ramstrong Sorry, I only just now got to test it. It seems pretty close, but there's something wrong. Here's what I did:

  • Generated a test GRP with the letters A-Z over and over. (ABCDEFGHIJKLMNOPQRSTUVWXYZ over and over)
  • Ran your program on the generated GRP
  • Got this on the computer: ABCDEFGHGHIJKLMNUVWXYZABABCDEFGHOPQRSTUVUVWXYZABIJKLMNOPOPQRSTUVWXYZ

So it messes up right at the 8 byte border, so something is just a little off. For confirmation (both because I know you'll want it, and because I'm not confident I did it exactly right), here's the program I wrote:
Untitled

OK. Thanks. You did your part perfectly. I don't see any mistake at all, except it's very probable I'm misunderstanding Discostew's explanation. I'll recheck it tomorrow. Thank you for your help!

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

ramstrong

All this frustration in trying to get that program right is getting to me, so here's a little something I wrote for fun. All GOTOs and not a GOSUB in sight. Does this look like spaghetti code?

The explanation on how sprite works as a timer is in Tutorial thread. But I figure, a little sample on how sprite is used should be helpful to people. I'll put this on my blog eventually, but here's a preview.

'TIMER PROGRAM BY HARRY HARDJONO
SPSET 1,156,0,0,0,0
SPOFS 1,-50,-50
SPANIM 1,4,15
SPSCALE 1,200

@INIT
CLS
SPOFS 1,0,96,0
SPREAD(1),X,Y
?"HOW MANY SECONDS?"
INPUT T
IF 0>=T GOTO @END
CLS
?"A STARTS TIMER"
?"B SETS NEW TIME"
?"X EXIT"
?"Y PAUSE"

@LOOP
VSYNC 1:B=BTRIG()
IF (SPCHK(1) AND 1) THEN SPOFS 1,X,Y,0
IF (B AND 16) THEN SPOFS 1,224,96,FLOOR((224-X)*T/224)*60:GOTO @TICK
IF (B AND 32) GOTO @INIT
IF (B AND 64) GOTO @END
GOTO @LOOP
@TICK
IF (BUTTON(0) AND 128) GOTO @LOOP
LOCATE 0,8:SPREAD(1),X,Y:?"TIME LEFT: ";FLOOR((224-X)*T/224);" "
IF (SPCHK(1) AND 1) THEN BEEP 28:WAIT 60:GOTO @TICK
?"TIME'S UP!":SPOFS 1,0,96,0:X=0:BEEP 50:WAIT 120
GOTO @LOOP

@END
?"GOODBYE!"
SPCLR 1:WAIT 300

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Please login or sign up to reply to this topic