people playing: 292, servers online: 86, games played: 135,957,462 Top Player: Shmevin

  Toribash Community » Toribash » Mods » Lua scripts
Register FAQ General Rules Community
Reply
 
Thread Tools Display Modes
Old Apr 7, 2014   #1
Daanando
Member
 
5th Dan Black Belt
Join Date: Jun 2013
Posts: 111
Clan: fl0w



[WIP/REL] reSpar.lua
reSpar is primarily intended to aid continuity in long multiplayer sparing games. It's two basic functions are:


UPDATE 21/04/14: Added some graphical interfacing for the ease of your eyes in your face. After starting the script, right click the Joint State panel to view the load directory and options. Note: reSpar can now also be used as a slightly clearer replay loader.

After loading the script. 



After right clicking the panel (or pressing F1) 


The top panel shows your /replay directory. the bottom one displays the content of the highlighted replay file (I'll eventually get round to parsig that in to something more user friendly). Highlighting a different replay file is done by scrolling, arrow keys or '+' and '-'. Press Load Replay to load the file as a regular replay. Replay Moves to run the game one move at a time (holding SHIFT when pressing Replay Moves will swap Uke for Tori and Tori for Uke). Safe Save for constant live game saving. And Unload Script for... well you'll guess.


Older details, but still useful information:



1. More robust game saving

How many times has it happened that you're deep into a great multiplayer sparring game, only to have your partner ping and disconnect from the game? All that time wasted and not even a replay file to show for it... Unless you pressed 'f' and save the game every turn.
reSpar does this automatically. Before you start an important sparring game, use the command

"/safesave [OPTIONS FILENAME]"

This will ensure that every turn the replay will be updated and saved in the replay/ folder. if you don't give a filename the game will be saved as SafeSave.rpl

2. Recreating a saved mp game

Now what if you and you partner wanted pick up that game from where you left off. With:

"/replaymoves [FILENAME]" you can do just that. It will load the moves of the saved game and control your tori for you up until where the game was saved.

Details:

Run the /safesave command before you start the game you want to save. Once started, it will keep going until the current game has ended or a new game has started (in case of sudden disconnect).

Since you cant control your partner, both of you will need reSpar.lua and the to be loaded replay on your respective computers.
For now reSpar doesn't check whether the game whose move your loading has the same settings as game you're loading them into. Make sure they're compatible (and identical if you want continuity).
When ready, start a new game with your partner, both type in "/replaymoves [FILENAME]". On your screen you'll see a bar with a two sets of two sequence of letters, one above the other. Red for the tori position, blue for the uke. These are just joint (and grip) states. If the top and bottom are the same colour then your tori is making the exact same move as it did in the saved game. If you're both ready, press space for the next turn. Keep doing so until you want to pick up control.

Note: the joint state sequence is in a different format than usual.
f,b,h,r are still the same (forward (Mousewheel Up), back (Mousewheel Down), hold, relax) but it's ordered from neck to abs, right arm (right peck to right wrists & grip state ), left arm, right leg (right butt to right ankle), left leg.

Additional uses:
Yes: reSpar can be used as an extended MoveMemory.
Yes: reSpar can be used to help two colluding player rig a (decap) game by doing a "here's one we prepared earlier". God help you though, son, if you think it's a good idea.
Not really: You cannot perfectly recreate single player games in multiplayer or vice versa. Apparently the engine, ever so slightly, handles the two differently.

Let me know what you think.And if you enjoy this script, or any of my previous one, please, feel free to make a small TC donation. Thank You.

respar.lua (11.2 KB, 64 views)
Attached Files
File Type: lua respar.lua (22.9 KB, 685 views)

Last edited by Daanando; Apr 21, 2014 at 11:15 AM..
Daanando is offline   Reply With Quote
Old Apr 7, 2014   #2
jmanthebig
Member
 
10th Dan Black Belt
Join Date: Feb 2013
Posts: 108



>:OOO do my eye deceive me "Recreating a saved mp game" Good job if this works how I think it works.. you will go down in history as the greatest I will be testing this soon.
10/10 for catching my attention
jmanthebig is offline   Reply With Quote
Old Apr 7, 2014   #3
box
?crazykid700=flashglass
 
Cardboard Belt
Join Date: Sep 2007
Posts: 9,203
Clan: I am



It'd be nice to specify a frame number for the recreation to go through.

Excellent idea, excellent implementation.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
box is offline   Reply With Quote
Old Apr 7, 2014   #4
Daanando
Member
 
5th Dan Black Belt
Join Date: Jun 2013
Posts: 111
Clan: fl0w



Originally Posted by box View Post
It'd be nice to specify a frame number for the recreation to go through.

Excellent idea, excellent implementation.

(Thanks, Box, that's means a lot coming from you (I've read everything you've wrote on lua scripting)

For now, the script is just a bare bones proof of concept (I'm deathly afraid that maybe mp games cant be recreated in a new, but exactly the same, mp server by the moves alone) If the basic principle works, then I look forward to tackling yours and anyone else's .suggestions.
Daanando is offline   Reply With Quote
Old Apr 7, 2014   #5
scorpionma
Forumite
 
4th Dan Black Belt
Join Date: Sep 2011
Posts: 2,405



Ummmm
One of the best scripts!
I'll see if it has any bugs
But thank u daanando
INB4 14 days ban
scorpionma is offline   Reply With Quote
Old Apr 7, 2014   #6
jclark
Elitist
 
6th Dan Black Belt
Join Date: May 2012
Posts: 6,869



oh my goodness you have solved the problems of hundreds of sparrers. thank you so much. this should be stickied somewhere
Have a great day, thanks for looking at this post I guess.
cnc is an endangered resource
jclark is offline   Reply With Quote
Old Apr 7, 2014   #7
Maxtix
Member
 
2nd Dan Black Belt
Join Date: Feb 2013
Posts: 40



I love it, but you need to disable the grabs if possibru
Dead
Maxtix is offline   Reply With Quote
Old Apr 7, 2014   #8
@Oblivion
Que outro valor mais alto se alevanta
 
10th Dan Black Belt
Join Date: Mar 2008
Posts: 1,286
Clan: [T]



This is absolutely genius.
You have just solved the biggest problem of the current sparring scene.
Truly, truly ground-breaking.

I'll test this as soon as possible and add it to my Legends thread.
Congratulations on this feat, and thank you.
We're still kids in buses longing to be free.
Oblivion is offline   Reply With Quote
Old Apr 8, 2014   #9
deprav
 
Master Belt
Join Date: Dec 2010
Posts: 2,164
Clan: fl0w



Daym Daanando !! That might make play some spar way more often <3
deprav is offline   Reply With Quote
Old Apr 8, 2014   #10
William
 
Wushu Belt
Join Date: Oct 2008
Posts: 5,322
Clan: fl0w



I've been on the devs necks to implement something like this! Amazing that you were able to do it with lua!
Basically opens up lots of possibilities, and makes it easier for casual players to create spars!
Will test it soon.
Your messed up world enthrills me
William is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:13 PM.




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game