![]() First we need to make the function that will be called, simply put the echo(“Winning… part into a new function, like so: function winning() To make it be called every time we enter a freeze (when you edit joints inbetween the frames) we need to change it a bit. Player2_Score = get_player_info(0).injuryĮlseif(Player2_Score > Player1_Score) then Player1_Score = get_player_info(1).injury ![]() So using the code from the last tutorial, we can make a script to echo the current winner quite easily. You can find a list of hooks in a in the events table, but for now we shall just be using the “enter_freeze” hook. So what can they do? Well hooks can do anything from allow you to draw text on the screen, to echo who is winning at the end of each set of frames. “hook description” -> Simply there to be used when you want to remove a hook, can be anything but it’s best not to have two with the same description and hook name.įunctiontocall -> The function the hook will run every time the hook runs. “hook name” -> The name of the hook, I’ll explain where you find these names just a bit further down □ Hooks can be defined like this: add_hook( "hook name", "hook description", functiontocall) Hooks are another important aspect of lua, they enable you to run certain functions periodically at certain times, like when a game is over or when you enter the joint setting stage of the game. Make a script that echoes who is winning at the end of each freeze.In this tutorial I will be covering hooks and how to debug your scripts
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |