The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

AdventureWalrus! [CSE] [xlibC]

Started by Unicorn, April 04, 2015, 05:03:56 pm

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Unicorn

Th image for tye XLIBC spritesheet right?

So how would the xlibc spriting work? You make the spritesheet, then conver it to jex,then somehow call it in a program? Thats the part I can't really understand. <.<



??? ??? ??? ??? ???

DJ Omnimaga

Celtic sprites use a totally different format. So I recommend using xLIB sprites. But of course you need to use an entire 8192 bytes large sprite sheet regardless of how many sprites you got, unless you want to type the entire hex by hand from memory or something, which isn't practicable. Basically, you make a PNG/GIF containing your sprites, 128x64, then import into TokenIDE, save as 8xv, then in DCS you need to load the appvar into temporary memory (see real(5,0 command at http://dcs.cemetech.net/index.php/DCSE:BasicLibs:ManagePic . To display sprites from that tile pic, you use http://dcs.cemetech.net/index.php/DCSE:BasicLibs:DrawSprite .

Unicorn

Ok, Ithink I get it now. Thanks!



??? ??? ??? ??? ???

DJ Omnimaga

No problem. Feel free to ask more questions if you have any. Make sure to check the wiki a lot, though, since it has very important info, and make sure to backup often too, because it's easy to get the white fuzzy screen of death with xLIBC (and while ON+Quit+2nd+OFF then ON sometimes fixes it, it isn't always the case)

Unicorn

Yeah, backups are a must. So, what do you use to draw the sprite sheet? Gimp?



??? ??? ??? ??? ???

DJ Omnimaga

I just use Paint.net or Photofiltre Studio.

Unicorn

June 05, 2015, 04:21:53 am #51 Last Edit: June 05, 2015, 07:34:05 am by Unicorn
So, I got all the backgrounds and sprites all set up (or so I thought) but when testing, nothing happens except for a small black rectangle appearing in the top left hand corner of the screen

Here's my code and the files.


\\just testing to see if it works
ClrHome
real(0,1,1
real(8,1,0
"MYWBG
real(5,7,0
"MWSPRT
real(5,0,0
real(4,0,3,3,1,1,7,0,1
Pause


The files:
Program
Sprites
Background

Any suggestions?

EDUT:It seems that it is displaying a (corrupted?) version of the walrii sprite, that is extremly small. The background is not appearing at all, soI think the problem is with the managepic commands that I used.



??? ??? ??? ??? ???

DJ Omnimaga

June 05, 2015, 01:55:31 pm #52 Last Edit: June 05, 2015, 02:06:47 pm by DJ Omnimaga
Seeing that the syntax of real(4,0 is real(4,0,X,Y,WIDTH,HEIGHT,XOFFSET,YOFFSET,TRANSINDEX,UPDATELCD,PICINDEXSTART,PICINDEX0,PICINDEX1...etc) , it seems that you are missing many arguments there. For Walrii, width and height is definitively 3, so I assume that's what your 3's are for. This then means that you forgot to specify X and Y at the start.

What is the 7 for in real(4, by the way? It seems like it would be to make the green color transparent, except that I recall the background being yellow in your pic (which would be 230 or 231). You also seem to be missing the pic index or something.


EDIT: Another but totally unrelated issue with your program: Since your program uses lowercase letters, it cannot be ran from the home screen, because the characters will change to prgmM!=>=DegreeSeqW?>.

EDIT 2: I can't seem to figure out the issues that prevents your background from being displayed, same for the sprite. However, there are typos in your program, such as MNYWBG and MNSPRT.

Unicorn

June 05, 2015, 04:56:02 pm #53 Last Edit: June 05, 2015, 05:00:19 pm by Unicorn
Oops. I had thrown that together really quick, I probably shoul have spent more time on it.
For the X and Y offsets, what are they? are they other coords fo the sprites?

Edit:So now the program displays a blue square about the size of the walrii sprite. I do not think Im loading the sprite data right,and the background still doesn't show even with the right string.:P



??? ??? ??? ??? ???

Snektron

The x / y offset are probably the coord to start reading from the sprites from
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Unicorn

Ok, thanks for that clarification.

Now, I have the background done, and the sprite is next. Once I get those to things done, its pretty much simple from now on. :D



??? ??? ??? ??? ???

Snektron

Oh cool. I hope you can share some screen soon :)
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Unicorn

Quote from: Cumred_Snektron on June 05, 2015, 06:01:04 pm
Oh cool. I hope you can share some screen soon :)

Yeah, I'll wait till the sprite works ;)



??? ??? ??? ??? ???

DJ Omnimaga

Glad that the background was done. I don't get why the 32 color one wasn't working, though. Either Token fails to convert them right (my version even threw an error earlier when I tried) or Doors CSE 8.2 has a bug preventing them from working. But it seems to look nice with the pixelated one so it's OK.

As for the sprite, I don't get why it didn't work either. I only could manage to display one of the eye, Maybe you could try a different sprite routine such as DrawSpriteSequentialListA (where you only have to specify the first pic index)?

Unicorn

June 05, 2015, 06:18:13 pm #59 Last Edit: June 05, 2015, 08:38:52 pm by Unicorn
Files if you want to take a look:
Sprites
Background
Program




??? ??? ??? ??? ???

Powered by EzPortal