Hm.. There hasn't been much activity, so I will just have to create a new thread. When is this multiplayer page going to be finished?
Which reminds me about the pages project I started a while back. I've been busy with the new site and all.
Apparently James Kanjo wanted to finish the page.
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me
Are there any ways to have two people playing a game at the same time, without taking turns or something?
An idea I've had is using a blank Input command on one calculator and having the other one check to see if the X or Y variables have changed. The second calc would be the one where calculations were performed and such and would be the screen on which the game took place.
Problem with this is that Input doesn't change the X or Y variables until the cursor stops moving, so holding keys down wouldn't work.
Any other suggestions?
No, I am afraid that's not possible.
well sure it would be possible, just incredibly slow and unresponsive. However, if you are really interested in making a real time multiplayer game, Omnicalc has an excellent link function that allows for incredibly fast linking, as well as different functions. You can send different values, see if the other calculator is sending a value, or wait indefinitely until you receive a value from the other user.
No, I am afraid that's not possible.
Unless you are using assembly programming ;D
But seeing as we're the TI-Basic Developer, I doubt we'll write an assembly linking tutorial.
Not even with asm. When you send a variable, via the silent linking, it quits the program that received the variable. I am sure you can do a raw send/receive, but that's a little complicated. You could write your own routine for moving x,y, and could then do getcalc, but that would probably slow things down a bit.
Nobody uses the bcalls in assembly though, people just use the link port. Which has none of those artificial limitations.
True. Albeit difficult to use, because you work with high/low lines, so basically, you could send two bits, at a time.
buuuuuut if you use the Omnicalc built in linker, its nice and simple, and you still get to program (mostly) in basic ;)
Is this a correct way to use the GetCalc( function? Or am I doing it wrong?
Str2→Str3 //save the user's name
GetCalc(Str3 //get the opponent's name and consequently preserve the user's name
"SDTHWAPMZO"→Str1
For(V,1,10
expr(sub(Str1,V,1→∟MULTI(V) //store the user's stats into a list
End
GetCalc(∟MULTI //get the opponent's list
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
That looks right. Is that code not working for you?
I haven't tried it yet, but I was just getting clarification, so thanks lol.
However, for when the users perform their attack, I am lost. I'm guessing I need to establish the "Calc A" and "Calc B" thing? Once I do this, I'm also lost, once again.
Perhaps someone could help me with this?
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
What are you lost on? If you could provide your complete code that would help.
Here is my complete code:
Text(24,19,"Establishing
Text(30,19,"connections...
Str2→Str3
GetCalc(Str3
//store items from stats list into variables
//unnecessary to type
"SDTHWAPMZO→Str1
SetUpEditor MULTI
For(V,1,10
expr(sub(Str1,V,1→∟MULTI(V)
End
//code to make sure variables are not less than zero
//again, unnecessary
If U or Str3=Str2 Then //U is the variable i used in the code to check for not lower than zero (it is greater than 0 if there are)
ClrDraw
Text(-1,22,17,"Connection
Text-1,30,17,"failed
Repeat getKey
End
Return
End
This is just the establishing connections part. However, it does not work and I always got a "Connection failed". Where I am stuck is 1) how do I get the connection to NOT fail, and 2) how to initiate the sequence for getting the opponents button that was press. I know I would have to use some kind of 'Repeat' loop for this, but I do not know how.
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
Well, have you tried just putting a simple loop around GetCalc(?
:Str2→Str3
:While Str2=Str3
:GetCalc(Str3
:End
How could I test to see if there's a calculator connected then? Otherwise it would just be an endless loop.
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
As far as I know, TI-Basic doesn't have a way to test whether there's a calculator connected. Did you try putting a loop around GetCalc(?
Yes, I need to wait until Tuesday to test it out (I have Columbus Day off) but I think I got it right. So far my code is:
Str2→Str3
1→V
While Str2=Str3
Text(57,0,"Attempt ",V,"..."
GetCalc(Str3
V+1→V
If V=11:"iopsbnadfubsdifgub→Str3 //just gibberish
End
Text(-1,56,0," " //clear the attempt stuff
If V=11:Then
DelVar Str3
For(V,10,45,7
Text(-1,V,15," " //clear the other stuff
End
Text(14,17,"Connection
Text(20,17,"timed out
Text26,19,"1: Try again
Text(32,19,"2: Quit
Repeat K=92 or K=93
getKey→K
End
If K=93:Return
If K=92:Goto CA //connection attempt
End
DelVar V
RepeatV=3 //just to make sure ;)
GetCalc(U
V+1→V
End
e(U=π)+π(U≠π→U
If U=pi:"[CALC_A]→Str1
If U=e:"[CALC_B]→Str1
//then continue with the code i have listed above
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
What about using two calculator screens for one program's output? Shouldn't it be possible to display map info on one screen, and the map on the other? This would increase the amount of screen space a game has to work with.
I'm sure it could work. I'd imagine all you have to do is establish which calculator is which then (depending on which is which) setup how you want to perform everything, then send or get it correspondingly. One list (or matrix) could be used to hold the information (or string, however you want it) and then another could be used to hold the map itself. Just remember that whatever is recieved gets over-written to whatever variable it is.
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
How can you make the one calculator to wait until the same program is started by the other calculator without using the Pause or Menu command?
My code was like this (I had the same problem on my program so i used im instead of mine) but the calculators continue waiting until i break the program on one calculator, then the other one enters the menu:
"→Str1
"→Str2
0→B
0→C
GetCalc(A
e(A=π)+π(A≠π→A
If A=π
1→B
If A=e
1→C
0→D
While B=0 or C=0
D+1→D
If A=π
GetCalc(C
If A=e
GetCalc(B
Disp "Wait",D
End
Lbl M
ClrHome
Menu("IM","READ",R,"SEND",S,"QUIT",Q
// the rest of the code
Get futuristicOS 8 for your TI-84+
Learn more about futuristicOS 8
Unfortunately, you need a Pause, Menu(, or Input in order to establish the link and transfer data.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
This is just an idea that probably won't work, but if you could somehow figue out how the calc's OS stores "getkey" in its own way, you could manipulate "Pause" to make the "ENTER" key already "pressed," thus allowing a connection to be made and still go on. However, it probably would not work because time is probably required, not "Pause."
Coffee + Radiohead = ^^
Internally, Pause puts the calculator into a special halted state that allows it to devote much of its processing to reading the link port if it is active. If you read up on some of the pages, you will see that in the older OSes, linking actually simulated pressing Enter automatically once the data was sent. This would be very useful for linking, so I wonder if some hook could be made to cause this to happen again o_O That would be rather awesome. Even better, though, would be if KermM added in a way for BASIC users to use the linking software in DoorsCS7 :D Unfortunately, that is hardly possible with how little room he has left >.> He does all the data transfer via interrupts which fire 140 times per second, even during BASIC execution, so it transfers data in the background, even in Assembly games. The OS actually does something similar, but it waits until the user puts it in a mode to read data.
Z80 Assembly>English>TI-BASIC>Python>French>C>0