Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: stevon8ter on May 24, 2012, 04:20:35 pm

Title: Few simple questions
Post by: stevon8ter on May 24, 2012, 04:20:35 pm
I have some basic questions

1) is it possible that if you have a string, "00000" to only change one of the 0's with a code? It's if i press for example f1 it should adjust the first, f2 should chane the 2nd, ..,

2) the easyest way to make a time delay for a blinking pixel would be a for loop? Cause if i do:
Code: [Select]
Starttmr->T
Lbl1
If chektmr(T)>= 3
Then
...
End
Goto1
 
It doesn't work
Title: Re: Few simple questions
Post by: blue_bear_94 on May 24, 2012, 04:34:26 pm
1.
Code: [Select]
"."+Str1"+".→Str1
Repeat 2≥abs(Ans-3
getKey-10
End
sub(sub(Str1,1,Ans)+"1"+sub(Str,Ans+2,6-Ans),2,5→Str1

2. If it's a small delay, then rand(#) is better.
Title: Re: Few simple questions
Post by: stevon8ter on May 24, 2012, 04:41:20 pm
Could you give a little explaination of the code you wrote? Maybe with a little example? And i don't know if this matters but te 0's could only become a 1

And the delays would be from .5->5 sec
Title: Re: Few simple questions
Post by: blue_bear_94 on May 24, 2012, 05:17:28 pm
The first line adds delimiters so Line 5 will work. Line 2-4 waits for a key F1-F5 to be pressed. (Why?) Line 5 concatenates three substrings: the one before the character to be changed, one being the new character, and the one after, and then clips it to the appropriate range.
Title: Re: Few simple questions
Post by: stevon8ter on May 24, 2012, 05:22:44 pm
Ok, thanks, but i decided to make it with lists, it's much easyer for what i'm doing, and the rand(#) works perfect
Title: Re: Few simple questions
Post by: stevon8ter on May 25, 2012, 05:34:54 pm
Ok, i'm making this my official help ask topic, i'll ask here questions for basic

Ok, i know there are much posts about this one but i just don't feel like reading them all

What's the best way to make sprites? And what's the best movement methode?
Title: Re: Few simple questions
Post by: Sorunome on May 25, 2012, 05:39:19 pm
Making sprites will only work good with some library, for example xlib, and with moving, just make that the sprite possition depends on X and Y.
Title: Re: Few simple questions
Post by: stevon8ter on May 25, 2012, 05:40:41 pm
Ok, so of i'dd have xlib, how would it work?
Title: Re: Few simple questions
Post by: Sorunome on May 25, 2012, 06:22:06 pm
you'd have to have all your sprites in pics, then you call it with real(), sprite is real(1, then you give x and y possition on the screen, e.g. real(1,X,Y then you need width and height, width is in bytes, so you get now real(1,X,Y,1,8 now you need the pic number and the coordinates where the sprite is saved there, so if you have it now in pix 1 and the sprite is at 0,0 you have this: real(1,X,Y,1,8,1,0,0 Now you need the sprite logic, and then if you want to flip it and then if you want to update the LCD, so for displaying it is now real(1,X,Y,1,8,1,0,0,0,0,1
To read more stuff about xLib: http://www.ticalc.org/cgi-bin/zipview?83plus/asm/libs/xlib.zip;ReadMe.txt
Title: Re: Few simple questions
Post by: stevon8ter on May 25, 2012, 06:25:09 pm
Ok thanks, but what is the sprite logic?
Title: Re: Few simple questions
Post by: Sorunome on May 25, 2012, 06:28:18 pm
It is how the sprite is copied to the screen.
0 is overwrite, that means that all pixels that are white in the sprite will be white on the screen and all black ones will be black.
1 is and, that means that all pixels that are on the sprite black AND on the screen black will be black
2 is or, that means that all pixels that are black in the sprite will be black on the screen, but not with white pixels
3 is xor, it is like or, just that if the pixels are black in the sprite AND the screen they will end up white, so it inverts all the black places in the sprite.
Title: Re: Few simple questions
Post by: stevon8ter on May 25, 2012, 06:31:45 pm
Ah ok, thx, euhm, i had an other question but i forgot

Allready know it again

The users should also need to have xlib and the pic?
Title: Re: Few simple questions
Post by: Sorunome on May 25, 2012, 06:32:27 pm
Haha xD
Just ask it if you remember it.
Another good thing with xLib is that you can store up to 255 pics! :D
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 06:44:38 am
255 full 62*94 pics? Wow, amazing

And the user also needs the pic and xlib...
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 08:42:09 am
Nope, full pics are 64*96 pixels :P
And you could make that when you start the program it creates the pics what the user doesn't see (by just using the backup buffer) and by exiting delete them so that the user has more RAM.
And yes, they'd need xLib (or DoorsCS which also has xLib included and is A LOT more awesome), but everyone should have DoorsCS anyways xD
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 08:51:39 am
Ah ok, and the backup buffer, how do i use it?
(sorry for not knowing about that stuff, but everytime you teach me something, i don't forget it and i won't have to ask much later)
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 08:57:07 am
ok, first of all, with xLib you have two screens so to say.
One screen is the normal screen.
The other screen is some backup screen (screen buffer). Everything you draw onto the normal screen is also drawn to the backup buffer, but you can optional just write to the backup buffer, the user doesn't see this.
Remember the last parameter of drawing sprites being one so that it updates the screen? That is because xLib draws all the time to the backup buffer, with that being one you tell the calc to copy everything from the backup buffer to the normal screen. Leaving it 0 would just draw it to the backup buffer and you wouldn't see it on the screen.
You could also just do real(6) to copy everything from the backup buffer to the normal buffer.
Now, you could draw a lot of stuff into the backup buffer, store everything from the backup buffer into a pic, clear again the backup buffer, draw some other stuff there (e.g. a menu), and then update the LCD by e.g. using real(6) and so you have created the pics you need for sprites without that the user notices that!
I hope you get my explanation :D
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 09:03:19 am
Ah thanks, i get it, so you also can draw a screen, let the user see it, when that's done draw a screen on backup while the user still sees the first drawing
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 09:14:11 am
Yep, and that other screen on the backup buffer you can copy to a image with real(9,2,<picnumber>), then you can clear the backup-buffer with real(0,0) and draw some new stuff to the backup-buffer, and then let the user see everything with real(6)
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 09:19:33 am
Ok, that's actually pretty cool, that allows people to make a startupscreen that tells them what's it preparing, like: a pic with "loading sprites" then if the image is drawn, draw the sprites on backup, when that's done, adjust the menu to: "drawing map" and then do that, that's pretty cool

And where does xlib saves all of those pics?
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 09:24:35 am
It saves it in ram. You'll have then if you go to the memory menu and select pics some wiered names with pic numbers greater than 10. But that doesn't mind. Remember that you CAN'T recall them with recallPic <num>, you need to use real(3 like this:
real(3,rPIC_Num,rPIC_Method,Recall_UpdateLCD)  (copied from the readme)
rPIC_Num = PIC to recall PIC0 - PIC255
rPIC_Method = The copy method 0 = Overwrite, 1 = AND, 2 = OR, 3 = XOR
Recall_UpdateLCD = Toggle LCD update 0 = No, 1 = Yes   // is if it should copy the backup buffer to the screen of not
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 09:30:22 am
Ow yeah, i forgot that because i don't have it right now on my calc, but i'm going to do it soon and then i'll read the read me again and start my project(s)
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 09:35:23 am
But if you want real power you should use DoorsCS instead of xLib, that gives you even more features for later on and it gives you a epic GUI and also allows you running archived programs from homescreen. It is found here: http://www.cemetech.net/programs/index.php?mode=file&path=/beta/dcs72b2.zip
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 09:39:35 am
What kind of extra features does it have?

And are the real() stuff the same as xlib's?
Title: Re: Few simple questions
Post by: turiqwalrus on May 26, 2012, 09:41:08 am
But if you want real power you should use DoorsCS instead of xLib, that gives you even more features for later on and it gives you a epic GUI and also allows you running archived programs from homescreen. It is found here: http://www.cemetech.net/programs/index.php?mode=file&path=/beta/dcs72b2.zip
meh... it depends...
keep in mind that Doors is 3 app pages(49152 bytes), a pretty sizable amount.
Depending on the end user's calculator model, I'm not sure if they'd want to have to install a giant app :P

edit: ninja'd :P

Stevon8ter the xlib commands are all still the same, and it adds the Celtic III library, PicArc, and several more, including a few of its own commands
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 09:42:23 am
yes, the real() functions are the same. Features it has: it has even more libraries than xLib which are called with other tolkens (identitiy(), det(), sum() ). It gives assebly programmers a lot of other functions, like calcnet, to connect, i think in theory infinity calculatores, it gives you also the ability to access with your calc to the internet (you have to have it connected it to the pc and have some stuff on the pc running), it also alows basic programmers to add a program image (up to 16x16 pixels) and a description.
Oh, and it has a computer-like GUI.
And it's just epic.
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 09:48:23 am
I see, well, i'm going to install it but for now i'll use only the xlib commands in ly prog, so the user can choose if they install doors or only xlib
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 10:08:45 am
It's also a good idea to check if a user has xLib on, that is possible with real(6), as without xLib that would return 6. With xlib it wouldn't return anything.
So put anywhere at the top of your program something like this:
Code: [Select]
if real(6)=6
then
disp "You need xLib
Stop
end
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 11:45:35 am
That's a great idea, i always try to make checkig to make sure nothing goes wrong, this time i didn't think of it yet

EDIT1: before i forget, the x-y coordinates for sprites, is it upper-ledt corner or upper-right or ...?
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 04:38:35 pm
And could you also explain me some more specific about the tiles and the scrolling? How it happens and stuff.... Or you know a good tutorial for it?
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 04:54:39 pm
I don't quite get what you mean.... do you mean how to make the sprites? Or how to make a tile-map and then scrolling a scrolling map?
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 04:57:15 pm
I mean how to make a tile map and then scrol a scrolling map (sprite stays on the same place of the screen, so there isn't a sprite-movement but a scrol-movement)

And how about the sprite's x and y, what corner is it?
Title: Re: Few simple questions
Post by: Sorunome on May 26, 2012, 05:01:56 pm
Well, first to drawing a tilemap...
xLib has a nice function for it :D
copied from the readme
Spoiler For tilemap:
2 - DrawTileMap:
----------------
usage: real(2,Matrice_Name,X_Offset,Y_Offset,MapWidth,MapHeight,ScreenStartX,
ScreenEndX,ScreenStartY,ScreenEndY,mPIC_Num,Tile_Method,Tile_Size,Map_UpdateLCD

Matrice_Name = Name of matrice containing map data 0 - 9. 0 = [A] - 9 = [J]
X_Offsett = X Map Offsett. Which part of the map you wish to start drawing at
Y_Offsett = Y Map Offsett. Which part of the map you wish to start drawing at
MapWidth = Width of TileMap
MapHeight = Height of TileMap
ScreenStartX = Which COLUMN you wish to START drawing. Can be a value from 0-12 for 8x8 or 0-6 for 16x16
ScreenEndX = Which COLUMN you wish to END drawing at. Can be a value from 0-12 for 8x8 or 0-6 for 16x16
ScreenStartY = Which ROW you wish to START drawing. Can be a value from 0-8 for 8x8 or 0-4 for 16x16
ScreenEndY = Which ROW you wish to END drawing at. Can be a value from 0-8 for 8x8 or 0-4 for 16x16
mPIC_Num = The PIC in which the tile data is located PIC0 - PIC255
Tile_Method = The copy method 0 = Overwrite, 1 = AND, 2 = OR, 3 = XOR
Tile_Size = Size of tiles, 8 = 8x8, 16 = 16x16
Map_UpdateLCD = Toggle LCD update 0 = No, 1 = Yes

The ScreenStartX, ScreenEndX, ScreenStartY, ScreenEndY enable you to draw a 'windowed' map. This means that you can draw
your map and leave space for a HUD or something similar. Drawing smaller maps will also be a little faster.

To draw an 8x8 tilesize map centered with a 1 tile blank border the inputs would be:

ScreenStartX = 1
ScreenEndX = 11
ScreenStartY = 1
ScreenEndY = 7

The TileMap routine now supports MULTIPLE PICS and 16-bit TILE INDEX's. This means that you can have a map with more than
256 different tiles. If a tile is >95 it will overlap to the next PIC (if it exists).

PICS must follow each other numerically!!!!

So if your input PIC is PIC0 any tiles > 95 will be taken from PIC1 and any tiles > 191 will be taken from PIC2.

If the PIC doesnt exist then the tile will be drawn as a BLANK.

This function will still be able to read PIC data even if it is archived! But it may slow things down.
So, with scrolling, I'd do that you have a grand matrix with the full map in it, and into a second matrix is copied what must be displayed on the screen, which is used then for the tilemap function. Then I would place the sprite for the character in the center using the overwright logic and then update the LCD.
Title: Re: Few simple questions
Post by: stevon8ter on May 26, 2012, 05:24:04 pm
I don't really get it, if you once have time (now or tommorow or whenever, could you give me an example of tilemap + scrolling? Sorry to bother you with my n00b questions
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 04:43:14 pm
Ok, do already know how to use matrixes?
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 04:56:37 pm
Not really, but now i allready installed xlib, yeey :P
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 04:59:36 pm
Ok, matrices can be used just as two-dimensional lists. You have in total 10 matrices (with xTravar up to 255 :P)
Well, you can defind them like this:
Code: [Select]
[[5,6,8][8,6,2][3,5,2->[A]As you can see this is a 3x3 dimensional matrix that is stored in A.
You can call the single thingys like this: [A](row,column)   (row and column may be the other way around, dunno D: )
you can also define them like that
Get it?
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 05:02:13 pm
Yeah, get that
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 05:07:36 pm
Ok, now you can use that to store tiles in it, twelve across and 8 down, for 8x8 tiles.
Now, you have in a pic all the tiles stored.
0 would draw then the first tile, 1 the second one etc. 96 and greater automaticly fetch from the next pic.
so, now you have:
real(2,0(if you use [A]),0,0,0,12,0,8,<picnum>,0(method),8,1)
Caution: I didn't try this out now, it may crash, as wrong drawing of tilemaps in xlib can make the calc crash.
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 05:21:18 pm
Is it like: one tile has to be in the pic and then it always takes the same tile or does the tilemap has to be in the pic allready completely?
And the matrix has to be preset with the numbers you've set in the previous post?
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 05:23:35 pm
Well, you have in the pic then all your tiles you wanne use, e.g. grass, roads, etc.
then the one in the top left corner is represented by the number 0, the one left to it with 1 etc.
Now the matrix has all the numbers in the way it should be displayed in the correct positions.
Nope you get it :)
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 05:28:18 pm
And how does the matrix interpretes (wrongly spelled) it? Oike the left-above matrix is the left above tile where he places the tile-number?
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 05:31:34 pm
Yep, so for the full screen you need a matrix the size of 12*8, and then everything is then just exactly copied.
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 06:18:58 pm
But in the real( are standing 11 numbers, in xlib's tutorial are standing 14 numbers
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 06:22:43 pm
ups, sorry

usage: real(2,0,0,0,96,64,0,12,0,8,<picnum>,0,8,1
and the matrix, as a tilemap for the full screen would be then 12 tiles across and 8 tiles down your matrix will be 12 across and 8 down
Code: [Select]
[[2,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1]]->[A]that would fill it with the tile 1 and just in the top left corner have the tile 2.
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 06:29:25 pm
Ok, it works, tho, it displays all the 1's empty and all 0's in the matrix he draws a block, and he puts it on the homescreen

Forgot: first tile=0

Now i only have the homescreen
Thing
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 06:34:39 pm
it draws to the homescreen? impossible...... could you please paste your exact code your using here? (maybe for the pic a screenie of it would be good :D)
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 06:43:10 pm
I cant acces my pc right now (0:40 am), bit i ram-cleared my calc, so maybe now it goes correct

Code:
Code: [Select]
real(2,0,0,0,96,64,0,12,0,8,1,0,8,1
And now it gives an error:argument. :/
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 06:44:33 pm
same time here xD
Oh, and I also need to see the matrix......
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 06:47:41 pm
Are you from belgium? Or no, france :P that's it
Code: [Select]
[[1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1]->[A]
[\code]
Title: Re: Few simple questions
Post by: Sorunome on May 27, 2012, 06:50:31 pm
I think i created the tilemap wrong....this is the right one, just checked with some program i made ages ago:
real(2,0,0,0,12,64,0,12,0,8,1,0,8,0
And it should be filled now with the 8x8 sprite in pic1 one located at (0|8), as it are 1s and not 0s
Title: Re: Few simple questions
Post by: stevon8ter on May 27, 2012, 06:54:15 pm
Yay, it worked (argument error was wlib wasn't installed anymore because of the ram-clear :/)

Thx a lot man

Edit: when drawing a sprite in pic 1 and saving that, i then use code real(1,15,15,1,8,1,0,0 but it gives sintax error
Edit2: even i the pic is empty but still saved it should work normally, but mine always gives syntax error
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 05:33:26 am
Well, the first one is draw sprites, right?
it must be real(1,15,15,1,8,1,0,0,0,0,1)
You forgot the flip sprite one, and it was correct, your thinking, that instead of ,1 at the end (what is here) you can just leave it out to save bytes :D
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 07:12:55 am
Still doesn't work :/ could it be that i have a wrong version of xlib, or a bad calc
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 07:13:35 am
Still doesn't work :/ could it be that i have a wrong version of xlib, or a bad calc
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 07:14:34 am
hm....
please post THE ENTIRE code your using so i can look it through, thanks! :)
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 03:50:18 pm
Code: [Select]
real(2,0,0,0,12,64,0,12,0,8,1,0,8,0
real(1,15,15,1,8,1,0,0,0,0,1

Also, if i do:
Code: [Select]
If real(6)=6
Disp 1

It displays the xlib logo but also the 1, so i think it's my OS (2.55MP) (haven't had time to downgrade to 2.43)
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 03:51:46 pm


Also, if i do:
Code: [Select]
If real(6)=6
Disp 1

It displays the xlib logo but also the 1, so i think it's my OS (2.55MP) (haven't had time to downgrade to 2.43)
make that to this:
Code: [Select]
:0
:real(6
:if Ans=6
:then
:
:stop
:end
And the other thing, i meant the hole code, so also drawing pics and making the matrix
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 03:55:30 pm
Ok, wait a sec
And for the second code: if i do disp 1 on the empty line, it still displays 1 , i think i have a wrong version of xlib or my calc is broken
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 03:56:08 pm
well, just add clear screa at the beginning of your program, i'd do that anyways always.
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 03:59:44 pm
And what should that help? If i clrscreen the 1 just comes displayinh again
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 04:00:48 pm
yeah, then all the other crap isn't displayed. ALWAYS when you start a program clear the screen and clear the homescreen.
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 04:08:38 pm
Complete code:
Code: [Select]
Axesoff
0->Xmin
0->Ymin
94->Xmax
62->Ymax
Line(8,62,15,62
Line(8,55,15,55
Line(8,62,8,55
Line(15,62,15,55
[[0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0][1,1,1,1,1,1,1,1,1,1,1,1]->[A]
storepic 1
real(2,0,0,0,12,64,0,12,0,8,1,0,8,0
real(1,15,15,1,8,1,0,0,0,0,1
Yes, the sprite is still empty now (or tile, idk) but that doesn't matter... Does it?
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 04:09:55 pm
what kind of error on which line does it give you?
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 04:11:43 pm
Last line, syntax

Also happens when i use the real(3,... Function

And normally real(6 shouldn't be 6 but it is
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 04:13:55 pm
did you check it this way? the other way i mentioned before isn't good.
Code: [Select]
:0
:real(6
:if Ans=6
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 04:16:35 pm
No other code? Just those 3 lines?
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 04:17:10 pm
nah, replace the line if real(6)=6 with these three lines to check if xlib is on. And if it is off turn it on.
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 04:21:06 pm
But it is on, cause my tilemap real(2 works fine
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 04:24:16 pm
real(1,15,15,1,8,1,0,0,0,0,1
 should be

real(1,15,15,1,8,1,0,0,0,1
i think
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 04:31:37 pm
Still syntax error, but what's the latest xlib version? I have 0.602b
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 05:33:53 pm
I think that's the newest version...strange.....
EDIT: Double-check every parameter
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 05:39:57 pm
All parameters are checked, matrix is there, pic is stored,... Anything else?
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 06:00:37 pm
Sorry, I can't test atm as Doors is acting wired.
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 06:25:59 pm
If xlib won't work for me within the week i'll solve it be using a matrix and tilemap command as sprite. Haha
Title: Re: Few simple questions
Post by: Sorunome on May 28, 2012, 06:28:45 pm
Haha, that's slower than drawing sprites but still a idea :P
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 06:57:59 pm
Found the reason for errors, xlib doesn't work 100% on OS 2.53MP or above
Title: Re: Few simple questions
Post by: Builderboy on May 28, 2012, 07:00:25 pm
I know that CelticIII has compatibility with xLib, maybe try using that instead?  Maybe that will work with the newer operating systems
Title: Re: Few simple questions
Post by: stevon8ter on May 28, 2012, 07:02:46 pm
Might be, but tommorow i'm going to downgrade and install doors
Title: Re: Few simple questions
Post by: Sorunome on May 29, 2012, 06:01:17 am
Oh, yeah, maybe xlib isn't to good compatible with the newer mathprint oses
Title: Re: Few simple questions
Post by: Deep Toaster on May 29, 2012, 09:25:17 am
I know DoorsCS is compatible with the newer OSes, though I'm not sure if the included xLIB library is as well.
Title: Re: Few simple questions
Post by: stevon8ter on May 29, 2012, 11:21:41 am
I downgraded to 2.43 now it works perfect


But it could be that it was just an error in my 2.55MP and not in 2.55MPnin general
Title: Re: Few simple questions
Post by: Sorunome on May 29, 2012, 11:22:34 am
Well, mathprint is VERY buggy so i'm not sure.
Title: Re: Few simple questions
Post by: stevon8ter on May 29, 2012, 11:25:07 am
Yeah, but for drawing a line, it was real(12,and then

(lost the game)
Title: Re: Few simple questions
Post by: blue_bear_94 on May 29, 2012, 04:06:29 pm
I know DoorsCS is compatible with the newer OSes, though I'm not sure if the included xLIB library is as well.
Yes, DoorsCS includes an MP-compatible version of xLib.
Edit: I lost!
Title: Re: Few simple questions
Post by: stevon8ter on May 29, 2012, 04:09:44 pm
Ok, then i'll download that so i'm sure it always works
(*lost the game AGAIN)
Title: Re: Few simple questions
Post by: stevon8ter on May 30, 2012, 12:23:32 pm
How can i do correct collision detection in xlib?
Title: Re: Few simple questions
Post by: Sorunome on May 30, 2012, 12:25:02 pm
collision detection of what? That makes a large difference, also i need to know how your programming the rest...
Title: Re: Few simple questions
Post by: stevon8ter on May 30, 2012, 12:29:02 pm
Now i just have. 16*15 sprite, and some tiles, can i do tile-orientated collision detection? In xlib's tutorial is one but it's only woking when x and y are lower then 6

Another problem:
If my matrix is:
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[1,1,1,1,1,1,1,1,1,1,1,1]

The map is displayed like this:
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,0]
[0,0,0,0,0,0,0,0,0,0,0,1]
[1,1,1,1,1,1,1,1,1,1,1,0]
Title: Re: Few simple questions
Post by: Sorunome on May 30, 2012, 12:44:08 pm
First: If you draw wtih tilemap you can check the matrix.
Second: You must have forgotton somewhere some 0...
Title: Re: Few simple questions
Post by: stevon8ter on May 30, 2012, 12:46:44 pm
And how would i have to check it? And then my sprites maximum movement speed is 1 tile-width...?

Edit: tilemap working again