Forums

Topic: Petit Computer

Posts 9,081 to 9,100 of 9,621

randomous

@Discostew The animation offset is kept. For instance, if we originally had a sprite which used character 8 and had a 4 frame animation, the sequence would be 8 9 10 11 8 9 10 11 etc. The offsets would thus be 0 1 2 3 etc. Let's say we're currently on frame 3, or character 10 in this case (offset 2). If we used SPCHR to change the sprite to 16, the sprite would show up immediately as 18, since the animation offset is kept. It still does the normal animation of 16 17 18 19 etc., just as you say, it starts in the "middle" of the animation.

Edit: Gosh, that was way too much just to say "No, the animation doesn't reset".

Edited on by randomous

randomous

Discostew

@randomous Thanks. Now I can begin altering my code to take advantage of that. Right now, every sprite has to be processed through the update phase each frame. Even if a sprite is not animated, it does have a frame counter going from 0 to MAX_INT to keep the system stable. By eliminating any sprites that have a constant delay between all frames in an animation (or animations that have an end to them and don't just loop around), it reduces the workload the update phase must endure. A screen filled with 16 sprites may then only have to deal with 8 of them after this.

This would have all been easier if the developers designed SPANIM to also use arrays for both frame offset and frame delays.

Edited on by Discostew

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

TexMurphy

@Discostew In the Miku2 game, I created a sprite with SPSET. I animated the sprite with 3 to 4 frames. Then I changed the sprite to a sprite that did not have 3 to 4 frames. The animation continued but went beyond the frames I had for that particular sprite. With larger sprites its hard to give the same amount of frames to every change. Like walking (3 frames) to jumping 1 frame. I may have to halt the animation.
I have been working on Mortal Kombat PTC edition. I have the theme music and the character selection screen done.

Edited on by TexMurphy

TexMurphy

Discostew

Other than reducing the processing, the other reason for this is because there is no built-in method to make a sprite disappear or flash and retain positioning and such. I know I could do things like moving them off the screen, but that would mess with the collision system. I currently set up a 64x64 block that is completely blank, and when I want my sprites to flash, I switch them back and forth to that block. Since I do all my animations manually, it allowed me to do this capability fairly easy. Now I can expand on that with the more simplistic animations using the built-in functions.

Edited on by Discostew

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

damolii

@IAmAPersson I'm still having trouble using DATA for your text scrolled. Any explanation would be appreciated l. , .l

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

Slayer

Is there a way to repeat a command's effects with a different variable outcome? As I adjust the health bar code I need something like this.

Edit: That was interesting. I learned how to put aimbot into my own game. I edited some SPOFS code and wherever I aimed the zombie sprite would follow the aiming crosshair. It aimed FOR me. It was amusing and weird at the same time. I can hack my own game now.

Edited on by Slayer

I have nothing really to say about myself.

Discostew

Aw jeez. I was all ready to begin adding this, but then I realized a snag. My sprite handler also has the ability to freeze a sprite in the middle of the animation (meant for using Flashman's weapon), and then have the animation resume later on. That's something I can't do with SPANIM. I can't even swap between the two in the middle of the animations because then I would have to keep track of the animation frame/delay, nullifying any performance gain I would have had, and that's only if my program never dropped below 60fps since using SPANIM isn't restricted to code execution of VSYNC.....

Edited on by Discostew

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Discostew

Ok, forget what I posted, because I think I found a way around it. Since animation via SPANIM relies on the screen refresh rate rather than the program loop, it means I can use MAINCNTx to figure out which frame and frame increment the moment my freeze operation gets applied, force it to stop animating by setting the character index with SPCHR and setting 1 frame for SPANIM, then when I resume, I can manually animate the sprite until it loops around, to which then I'll give back control to SPANIM.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

InsertPi

damolii wrote:

@IAmAPersson I'm still having trouble using DATA for your text scrolled. Any explanation would be appreciated l. , .l

RESTORE@STRINGS
DIM TEXTS$(3)
FOR I=0TO 2
READ TEXTS$(I)
NEXT
FOR I=0TO 2
'We assume that the engine itself is under a subroutine called @TEXTANIM
TEXT$=TEXTS$(I)
GOSUB@TEXTANIM
NEXT
END
@STRINGS
DATA"Your string here","Another string","Yet another string"

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:

Gimmemorecoinz

Anyways uhh I have an issue.

This is rather irritating. It may take an expert!
http://imgur.com/z2HWi5w This is the zeldamapper I'm working on.

replace the prg zeldampr with this qr: http://imgur.com/3AqXoKk

now the issue is when running from gallery...
BGU0 doesn't load LA00_PNG properly.
It draws the tiles at the top.
Then when I begin placing the tiles on the touch screen.. petit computer does something REALLY MESSED UP
it decides that it's going to use it's own BUILT IN tileset instead of BGU0
What the heck is going on here? Can somone help???

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

Gimmemorecoinz

^ and this is why I hate petit computer sometimes. LOL.

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

Gimmemorecoinz

An update to the issue I posted above. I did some enraged tinkering.

Set BGPAGE to 0
Loading Tiles to BGU0

Draw some BG tiles to top screen

SET BGPAGE to 1
Try to use UPATEFULL from discostew's engine to update.
Tiles are petit computer's default tiles on bottom screen.
Running it again fixes it (I'm assuming because the second time BGPAGE is set to 1 by default)
Going to try setting BGPAGE to 1 first..... I hope this doesn't break... Urgh.

EDIT: Okay so... if anyone cares in the future. DONT load your own BG TILES. and then SET BGPAGE to a page that it wasn't set to you loaded them.
It messes up and somehow un loads the tiles you loaded. Yet it's fine if you don't switch BGPAGES again. I hope this helps someone I wasted hours with gcls and clear and acls and GPRIO trying to fix it... out of other issues... kay thanks. ANd I'm sorry that in future code with BGPAGE I will be forced to basically load multiple bgs all at once for both BGPAGES. Hope you don't mind the wait times for these! (They seem fast? )

Edited on by Gimmemorecoinz

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

brizobst

Question about CLEAR and GOSUB

I have a program that has gotten a little complicated, I made a bad habit of having goto commands inside go sub routines, and as you can imagine, after the program has been running awhile, I get out of memory errors (probably because the program has been looking for a RETURN command for too long).

I thought I could get around this by forcing the player to save between levels, then sending the program back to the first line and using CLEAR.

I noticed however, that even if you use CLEAR, the program remembers it is looking for a RETURN command, does anyone know a way around this? (aside from going through all my goto and GOSUB routines and cleaning things up, which I realise may be the only solution).

brizobst

Discostew

@brizobst Every GOSUB must have a RETURN. PTC can only hold so many pointers in the stack before it overflows (out of memory), and each RETURN reduces that stack by one. CLEAR only messes with variables and arrays. The pointer stack for GOSUB/RETURN gets cleaned out each time the program starts (not when it ends because doing a break and then using CONT allows it to keep going under some circumstances, retaining what it had in memory).

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

damolii

@IAmAPersson "@TEXTANIM" starts from RESTORE @STRINGS, right?

Also, would I still need MID$ for the effect? I saw that MID$ picks how much of the text to display, and the speed at which to display. Lastly, for some reason I'm getting duplicate definitions for DIM TEXTS$(3). I use CLEAR when the program starts, but for some reason, it doesn't have an effect. It's only when I put it in the subroutine and it works, though obviously I don't want to put it there as it would keep clearing the amounts.

Edited on by damolii

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

Gimmemorecoinz

So I'm not advertising this but I'm advertising this. I fixed alot of issues with my editor I was up all night lastnight.
I worked really hard on this so far and I just wanna give back to the community.
This editor can't save yet but in the future it will be useful for making very large maps that are 255 by 255, or larger.
Something that SCRED can not do.
http://imgur.com/hlb1mOM
The instructions are in the program if you get lost private message me or post questions about it here. I don't know how fast the forum will move but I'll probably skim for responses to my post later.
I'd like some feedback to if you try it if it isn't asking too much, I need to bug test it so yeah. Just give it a try if you like map editors.

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

damolii

@Gimmemorecoinz The art looks great. I don't really know how to use map editors well, but when I wanted to switch to a different part of the tileset, (e.x switching from a part of the tree to the green grass), the part of the map I already selected and put where I wanted on grid moved too. Is that supposed to happen?

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

Traulight

@Hairmanban19 have you ever thought about making some kinda D&D style program with a dice rolling system and stuff like that?

Traulight

TexMurphy

CHRED question. If I am creating custom sprites in this program, when I save am I only saving the sprites I see on page 0 or am I saving all other pages? I am making Mortal Kombat characters 4x4 which puts one character set per row for two character sets per page. Can I use the other page numbers and get more characters per file? Or do they save like SPU0, SPU1, ... SPU7?
Untitled

Edited on by TexMurphy

TexMurphy

Top

Please login or sign up to reply to this topic