people playing: 55, servers online: 19, games played: 142,903,515 Top Player: Ceytune

  Toribash Community » Toribash » Mods » Lua scripts
Register FAQ General Rules Community
Reply
 
Thread Tools Display Modes
Old Jan 4, 2014   #1
NutHug
Toribash Legend
 
Orange Belt
Join Date: Jun 2007
Posts: 5,330
Clan: RAWR



Replay Recorder
This script is supposed to provide replay information for advanced replay hacking and I also added some other shenanigan. It's designed to work with Toribash 4.5, I don't know if it works in later versions and I'm even less sure if I'd be able to make it work with later versions.

Known bugs: Don't use numbers in replaynames! Will be fixed later.

Huge thanks to Yoyo and stew who helped me to create this script! Stew wrote the basic recording function and Yoyo helped me extend it with all these features (or rather wrote it himsef )

Download the script and load it ingame.
First command:
simply type /record playerid inputfile outputfile parameters

Command explained:
playerid = set 0, 1 or 2 to record Tori(0), Uke(1) or both(2)
inputfile = this name is taken straight from the replayfolder. If you type blah it takes blah.rpl from your replayfolder
outputfile = the file it records to. If you type blaha it will create a file called blaha.rpl in your replay folder(careful about overwriting files)

Parameters:
By default it records everything on every frame but you can change that with a few parameters.
-pos = doesn't save POS lines
-linvel = doesn't save LINVEL lines
-angvel = doesn't save ANGVEL lines
-qat = doesn't save QATlines
-dm = doesn't save CRUSH lines (dismemberments)
-grip = doesn't save GRIP lines (griprecording is still wip)
dmonce = saves CRUSH only when it happens (automatically disables save on every frame)
Numbers = Put 2 numbers there to determine a frame intervall in which you want to record. These numbers represent the countdown you see at the top of the screen. So to determine the intervall space+p to the frame you want to start, write down the number, space+p to when you want to end and write down that number.

Example command:
/record 2 Discipline output -pos -qat -angvel 500 300
Saves Discipline.rpl from 500 to 300 without pos, qat or angvel lines to output.rpl

Second Command:
This let's you start a replay from the middle of another replay.
command is /startfrom playerid inputfile outputfile parameter

Command explained:
Everything like before but the parameter now determines the frame where you want to start from. So shift+p to where you want to start and use that number. The script then records 25 frames before and puts that at the beginning of outputfile.rpl

Command to merge the replays back together is currently under construction.
Attached Files
File Type: lua recordframe.lua (7.8 KB, 226 views)
Oblivion: that wasn't hilarious
Oblivion: it was brilliantly complex though
Oblivion: hands down man
Oblivion: today I genuinely believe more than I ever did before
Oblivion: that you are better than me
Oblivion: gg NutHug

Like my stuff?
Join my FunClub or subscribe on Youtube

Last edited by NutHug; Jan 4, 2014 at 04:50 PM.. Reason: finally able to fix YOYOS name
NutHug is offline   Reply With Quote
Old Jan 4, 2014   #2
Oblivion
Que outro valor mais alto se alevanta
 
10th Dan Black Belt
Join Date: Mar 2008
Posts: 1,297
Clan: [T]



Worked with 4.62 when I tested it.

This is a ridiculously amazing script for hacking replays.
I'll make a quick tutorial on a use of it when I have the time to.
We're still kids in buses longing to be free.
Oblivion is offline   Reply With Quote
Old Jan 4, 2014   #3
Yoyo
 
5th Dan Black Belt
Join Date: Nov 2009
Posts: 4,260



lua code:

function sign(num)
if num >= 0 then
return 1
end

return -1
end

function mat2qat(rot)
local q = {w = 0, x = 0, y = 0, z = 0}

q.w = math.sqrt(math.max(0, 1 + rot.r0 + rot.r5 + rot.r10)) / 2
q.x = math.sqrt(math.max(0, 1 + rot.r0 - rot.r5 - rot.r10)) / 2
q.y = math.sqrt(math.max(0, 1 - rot.r0 + rot.r5 - rot.r10)) / 2
q.z = math.sqrt(math.max(0, 1 - rot.r0 - rot.r5 + rot.r10)) / 2

q.x = q.x * sign(q.x * (rot.r9 - rot.r6))
q.y = q.y * sign(q.y * (rot.r2 - rot.r8))
q.z = q.z * sign(q.z * (rot.r4 - rot.r1))

return q
end


This bit of code is really cool, it transforms a 4*4 rotation matrix (get_body_info().rot) into a quaternion, that is actually the rotation format used in replays.

Here's a snippet from nut's script:
lua code:

f:write("QAT " .. i - 1 .. ";")
for j = 1, 21 do
local quaternion = mat2qat(get_body_info(i - 1, j - 1).rot)
f:write(" " .. round(quaternion.w, 6) .. " " .. round(quaternion.x ,6) .. " " .. round(quaternion.y, 6) .." " .. round(quaternion.z, 6))
end
f:write("\n")

To give you an idea of how it's used.

Also, nut's script has some really messy code in it, I'll probably help him do a cleanup soon.
multiple texture uploader! updated: multiple texture remover!
updated pretty colorlist!

<BobJoelZ> ok ive just rebooted my pc and ive tried to activate my reflex on yahoo internet explorer :/ no luck

<Aracoon> I do not enjoy having anal sex with multiple men

Last edited by Yoyo; Jan 4, 2014 at 07:30 PM..
Yoyo is offline   Reply With Quote
Old Jan 4, 2014   #4
NutHug
Toribash Legend
 
Orange Belt
Join Date: Jun 2007
Posts: 5,330
Clan: RAWR



Originally Posted by Yoyo View Post
I'll probably help him do a cleanup soon.

Yoyo: first I'll have to do a cleanup of the code
Yoyo: that's a very hacky thing
Nutstone McHugginson: hahaha no!
Yoyo: yes
Yoyo: I'm definitely
Nutstone McHugginson: I don't want you to spend another 5 hours to clean up my shit
Nutstone McHugginson: it makes me feel bad
Yoyo: well I want to
Yoyo: and you can't stop me
Oblivion: that wasn't hilarious
Oblivion: it was brilliantly complex though
Oblivion: hands down man
Oblivion: today I genuinely believe more than I ever did before
Oblivion: that you are better than me
Oblivion: gg NutHug

Like my stuff?
Join my FunClub or subscribe on Youtube
NutHug is offline   Reply With Quote
Old Jan 4, 2014   #5
SparChar
Chatterbox
 
3rd Dan Black Belt
Join Date: Jan 2013
Posts: 4,693
Clan: Frost



I can barely understand your explanation of the script cause I'm a retard but I'll go fuck around with this thing.
"they're like enormous pillows of disgusting girly meat" ~Orih 2016
My Replays
SparChar 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 04:31 AM.




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