people playing: 282, servers online: 78, games played: 94,980,142

  Toribash Community » Toribash » Mods » Lua scripts
Register FAQ Community Calendar Search
Reply
 
Thread Tools Display Modes
Old Jun 30, 2007   #1
Dafe
Serious Business
 
4th Dan Black Belt
Join Date: Jul 2006
Posts: 618



[REL]Ghost trainer
This thread is the home of the ghost trainer script generator that I developed. The generator allows you to extract move sequences from replay files and put them into an LUA script. When run, Uke will select a sequence at random that you can train against in single player.

The current version (2) of the trainer generator can be found here:
http://www.mydistraction.net/Out/trainer2.htm


Update 7/6/2007:
(Not really) bug fix.

Trainer script- v2.1:
- Fixed the first round setting import issues. Settings are now properly imported from round one, if the use replay settings option is enabled. Generator reflects this change, and has no other updates.


Update 7/5/2007:

Some usability improvements.

Trainer generator - v2.1:
- Added the option to select a specific player from a replay to add to Uke's move list, so taking sequences from single player replays doesn't have to pollute your move set.
- Put the instructions on the page, outside of a dialog box, with hide and show controls to continue to allow users to simply select all text on the page.

Replaced the older version, so it can still be found here:
http://www.mydistraction.net/Out/trainer2.htm


Update 7/3/2007:
Made fairly major upgrades to the system in general.

Trainer script:
- Added support for grips
- Added option to display ghost source
- Added option to load related game settings and mods
* Loading game settings is ineffective in the first round, but works as expected thereafter (you may just want to skip the first round)
* dev note: imported entire header string and frame numbers for semi future-proofing

Configure options by opening up the LUA script and setting the variables below the general documentation to true or false. Instructions are enclosed.

Trainer generator:
Pretty much just made all of the changes required to extract the necessary information to support the additional functionality of the trainer script. Nothing about the frontend has changed, so use it exactly as before.

The new version of the trainer generator can be found here:
http://www.mydistraction.net/Out/trainer2.htm

Attached is a small sample mixed bag (sambo, kickbox, wushu) trainer to demonstrate the new functionality:
Mixed trainer

Update 7/1/2007:
I redid the LUA generator in JavaScript, honestly, to spare myself from having everyone uploading replays (and potentially other crap) to my server. It's pretty bootleg right now. I might touch it up with more features later. Feedback would be appreciated.

Usage:
- Paste replay file text into the text area in the upper left.
- Hit "Add Moves", and the replay will be converted into two sequences of moves and added to the generated LUA.
- Be mindful that move sequences from both players will be added, so multiplayer replays will produce the best results.
- Clear the text in the text area, and repeat to add moves from different replays as desired.
- When you're done adding moves, select all text on the page, and copy to your clipboard.
- Paste into a plaintext editor and save the file as a .lua file and place into your 'data/script' directory in your Toribash folder.

Incidentally, no information about framestep or distance is preserved, so if you want to make a wushu trainer, where you'll be working with a framestep of 50, and an engage distance of 250, try to only choose wushu replays.

If you generate any good trainers, I encourage you to share here.


Original Post:
These are a couple of sample scripts generated by a PHP script I wrote last night. The PHP parses a directory of replay files, converts each player's move sequences into an LUA table, and generates a table of those tables.

The LUA script picks a sequence from the table at random and puts in those inputs for Uke after each input freeze, so you can use it as a ghost of the players in the replays, and train against it.

It's mostly good for practicing against openers, as later stage stuff is more context sensitive.

I'll make improvements to the script over time, and I'll be building a frontend interface for the generator script or something so you guys can build your own trainers from replays that you pick.

These are for wushu, and you'll have to make your settings match. 250 engage distance / 500 frames / 50 framestep. The second one, I think, has a better spread of openers. The first was just generated for testing.


Enjoy.
Attached Files
File Type: lua wushuTrainer.lua (9.3 KB, 591 views)
File Type: lua wushuTrainer2.lua (11.4 KB, 912 views)
Radioactive torso's description should be, "You have cancer like wow."

Last edited by Dafe; Jul 13, 2007 at 07:30 AM.. Reason: Updated
Dafe is offline   Reply With Quote
Old Jul 1, 2007   #2
Ethereal
Senior Member
 
6th Dan Black Belt
Join Date: Jan 2007
Posts: 978



This is a really cool script, as it helps a lot with training Wushu, and, it's a lot of fun, as well... Good job
Ethereal is offline   Reply With Quote
Old Jul 1, 2007   #3
Mr-Deanster
Senior Member
 
3rd Dan Black Belt
Join Date: Jan 2007
Posts: 752



This ... is ... awesome... Good job man!
Jarmund>{#toribash} Dr-Meanster: finish your sentences before pressing enter.
Mr-Deanster is offline   Reply With Quote
Old Jul 1, 2007   #4
?ishi
does this look like the face of mercy?
 
Master Belt
Join Date: Aug 2006
Posts: 5,580
Clan: Tribe



Im currently making a sambo training, i will post it as soon as it is done


hello, hi
MESSATSU GOHADOUKEN
#TribeOn



Last edited by ishi; Oct 16, 2008 at 01:57 PM..
ishi is offline   Reply With Quote
Old Jul 1, 2007   #5
hampa
Invalid parameters
Originally Posted by Ishi View Post
Im currently making a sambo training, i will post it as soon as it is done

I made an updated version that sets the default sambo settings on start.
Attached Files
File Type: lua sambotrainer2.lua (8.7 KB, 189 views)
Catch the Yamanote line http://www.toribash.com/dev/macewindu/ 1.4
hampa is offline   Reply With Quote
Old Jul 1, 2007   #6
Mosier
FUCK THIS GAY EARTH
 
Master Belt
Join Date: Feb 2007
Posts: 4,606
Clan: NO



This is awesome... Now I can really get some new wushu openers going

Just one question though... Will this ever be updated with more moves and such?
5:13 PM - vasp: everybody's nuts is so good
[00:18:38] <&vespesi3n> you should see when i swallow
[21:49:37] <&vespesi3n> >my mouth when
[21:49:43] <&vespesi3n> >my tastebuds when
Mosier is offline   Reply With Quote
Old Jul 1, 2007   #7
Dafe
Serious Business
 
4th Dan Black Belt
Join Date: Jul 2006
Posts: 618



I included a generator HTML page so you can make your own trainers with replays that you pick. Check the first post for updates.
Radioactive torso's description should be, "You have cancer like wow."
Dafe is offline   Reply With Quote
Old Jul 3, 2007   #8
Dafe
Serious Business
 
4th Dan Black Belt
Join Date: Jul 2006
Posts: 618



I'm reserving the right to double post in this thread when I make major updates. Don't ban me, please.

Update 7/3/2007:
Made fairly major upgrades to the system in general.

Trainer script:
- Added support for grips
- Added option to display ghost source
- Added option to load related game settings and mods
* Loading game settings is ineffective in the first round, but works as expected thereafter (you may just want to skip the first round)
* dev note: imported entire header string and frame numbers for semi future-proofing

Configure options by opening up the LUA script and setting the variables below the general documentation to true or false. Instructions are enclosed.

Trainer generator:
Pretty much just made all of the changes required to extract the necessary information to support the additional functionality of the trainer script. Nothing about the frontend has changed, so use it exactly as before.

The new version of the trainer generator can be found here:
http://www.mydistraction.net/Out/trainer2.htm

Attached is a small sample mixed bag (sambo, kickbox, wushu) trainer to demonstrate the new functionality.

Enjoy.
Attached Files
File Type: lua mixedTrainer.lua (12.1 KB, 309 views)
Radioactive torso's description should be, "You have cancer like wow."

Last edited by Dafe; Jul 3, 2007 at 08:07 AM.. Reason: Formatting
Dafe is offline   Reply With Quote
Old Jul 3, 2007   #9
Mr-Deanster
Senior Member
 
3rd Dan Black Belt
Join Date: Jan 2007
Posts: 752



Dude awesome work, is that problem you were having with the hook the problem with game settings?
Jarmund>{#toribash} Dr-Meanster: finish your sentences before pressing enter.
Mr-Deanster is offline   Reply With Quote
Old Jul 3, 2007   #10
Dafe
Serious Business
 
4th Dan Black Belt
Join Date: Jul 2006
Posts: 618



Nope. That's unrelated. The enter_frame hook problem I was having was that I can't set joint states via the enter_frame hook. I'd wanted to do that so that I could make Uke do the right moves, regardless of your framestep setting.

The game settings issue is that when you call the "set ___" commands, they don't take effect until the next round. So there's no way to get the first round to match settings. But if you play consecutive rounds (and just skip the first by hitting R and then space), it works fine.

If I think about it, I could probably use the loadmod command in the script to skip the first round automatically, but the insertion point is a little awkward
Radioactive torso's description should be, "You have cancer like wow."

Last edited by Dafe; Jul 3, 2007 at 01:54 PM..
Dafe 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 12:34 PM.


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