HTOTM: FUSION
Original Post
multiplayer restrictions on lua
I was wondering whether there are any rules on the type of lua scripts that are allowed to be used in multiplayer. For example, it is possible to create a bot script that will work in muiltiplayer (copying your opponents moves for instance), but is it allowed?

Also, I've noticed that some of the lua hooks such as exit_frame don't work in multiplayer. Is there any reference for which hooks work and which don't?
some of the stuff like getting the information of the server doesnt work and is restricted.
muiltiplayer (copying your opponents moves for instance)

That wouldnt work anyway, try it if you want, but it wont.
:D
I've tried it, and it does work. You can't copy your opponents current move but you can copy your opponents last opening for example. You could probably make a very effective bot for sumo or joust where the opening is very important.
You can't copy your opponents current move but you can copy your opponents last opening for example.

But not the exact move :P
Anyway. The joust bot would be interesting.
:D
Originally Posted by Blam View Post
But not the exact move :P

True (unless they press space)

Anyway. The joust bot would be interesting.

I'll give it go for fun, but I'm not sure if I'll release it here. I don't want to risk afk bot users abusing my code and spoiling jousting for everyone!
Last edited by flamflim; Jan 24, 2008 at 07:24 PM.
What? I had a script that read opponent moves, but it didn't load. (I tested with a keydown to echo "hi", and it didnt)
I have a fully functional joustbot that sorta has a learning rule (AI), but 15 recorded fights did not show any indication that it actually learned anything as compared to 4-5.

I can make a joustbot with set moves, but afaik, the "new_game" hook is not allowed.

I have a snippet of code to share, if you want it. It finds which player you are.

I'm taking a neural networks class, but I have yet to see any form of use for the types of networks i've learned.
I've got the basics done now. I've made a script that copies moves from the winner from the last match. Now all I have to do is build some actual AI. I'd be interested to know what your approach was here.

What? I had a script that read opponent moves, but it didn't load. (I tested with a keydown to echo "hi", and it didnt)

I used get_joint_info(player, minijoint).state and get_grip_info(player, BODYPARTS.L_HAND). You can check out the minitori2 script I posted recently to see it used in practice.

I can make a joustbot with set moves, but afaik, the "new_game" hook is not allowed.

The fact the "new_game" hook is not allowed is a pain, but you can get around it by using the "end_game" hook and checking the replay_status in the "draw_2d" hook. Basically, wait until the game has finished, then wait for the replay to finish playing. After this you can do your moves.
it was in 2.8 but i noticed that a grab lua can be used. i was in wushu and this guy suddenly grabbed my head and decapped me with grabby hands. (could be fixed in 3.06 and up, not sure) and the random script also works in multiplayer.
Originally Posted by FNugget View Post
I can make a joustbot with set moves, but afaik, the "new_game" hook is not allowed.

the hook for new multiplayer games is:
"new_mp_game"
for a list of hooks open up startup.lua

it was in 2.8 but i noticed that a grab lua can be used. i was in wushu and this guy suddenly grabbed my head and decapped me with grabby hands. (could be fixed in 3.06 and up, not sure) and the random script also works in multiplayer.

That has been fixed.
:D
Originally Posted by Blam View Post
the hook for new multiplayer games is:
"new_mp_game"
for a list of hooks open up startup.lua

Thanks for this. I've just tried "new_mp_game" but it only seems to get called when you enter a new room, not at the beginning of every match like new_game does.

I have a few more questions :-) :

Do you know what the "play" hook does?

In multiplayer is there anyway to skip the replay from lua?

Is there anyway to find out who won a match? I've tried end_game but that only gives the win type, i.e. 0 for win by damage, 1 for draw and 2 for dq.

Thanks