mouseboyx

Member
  • Content count

    96
  • Joined

  • Last visited

  • Raffle Tickets

    0

Reputation Activity

  1. Calypso liked a post in a topic by mouseboyx in Currently Listening   
  2. ST34MF0X liked a post in a topic by mouseboyx in Sapp mysql client   
    DLL that can be loaded and used to perform mysql queries from a sapp lua script
    https://github.com/mouseboyx/sapp_mysql_client
     
    I had fun learning from ChatGPT to try to make this work.  I learned a little bit about thread safety and how to use a C++ mutex to lock a function.  And how to return a pointer to an instance of a C++ class to lua's strictly C ffi implementation by casting it as a void pointer.  The C++ sources for this dll are a great resource to learn from to implement other functionality like this in the future.
  3. mouseboyx liked a post in a topic by Sunstriker7 in Sapp mysql client   
    Not sure if you already know about them or if it'll even be helpful to you in this case, but if mutexes and threads really tickled your pickle you should also look at semaphores. C++ provides libraries for 2 types. Unlike mutexes, semaphores are not tied to the thread of execution.
  4. ST34MF0X liked a post in a topic by mouseboyx in Sapp mysql client   
    DLL that can be loaded and used to perform mysql queries from a sapp lua script
    https://github.com/mouseboyx/sapp_mysql_client
     
    I had fun learning from ChatGPT to try to make this work.  I learned a little bit about thread safety and how to use a C++ mutex to lock a function.  And how to return a pointer to an instance of a C++ class to lua's strictly C ffi implementation by casting it as a void pointer.  The C++ sources for this dll are a great resource to learn from to implement other functionality like this in the future.
  5. ST34MF0X liked a post in a topic by mouseboyx in Sapp mysql client   
    DLL that can be loaded and used to perform mysql queries from a sapp lua script
    https://github.com/mouseboyx/sapp_mysql_client
     
    I had fun learning from ChatGPT to try to make this work.  I learned a little bit about thread safety and how to use a C++ mutex to lock a function.  And how to return a pointer to an instance of a C++ class to lua's strictly C ffi implementation by casting it as a void pointer.  The C++ sources for this dll are a great resource to learn from to implement other functionality like this in the future.
  6. ST34MF0X liked a post in a topic by mouseboyx in Sapp mysql client   
    DLL that can be loaded and used to perform mysql queries from a sapp lua script
    https://github.com/mouseboyx/sapp_mysql_client
     
    I had fun learning from ChatGPT to try to make this work.  I learned a little bit about thread safety and how to use a C++ mutex to lock a function.  And how to return a pointer to an instance of a C++ class to lua's strictly C ffi implementation by casting it as a void pointer.  The C++ sources for this dll are a great resource to learn from to implement other functionality like this in the future.
  7. Takka liked a post in a topic by mouseboyx in Player Join/Leave Notification Sound   
    Scripts that play a custom notification sound when a player leaves or joins the server that you are currently playing on.
    I made this because I thought it would be nice to be able to join an empty server, then minimize halo and be able to be notified if a player joins, rather than needing to wait in the game for a player to join.
    May require Visual C++ 2019 redistributable
     
    Instructions in the readme.txt
     
     
    player_join_leave_notify.7z
  8. Takka liked a post in a topic by mouseboyx in Player Join/Leave Notification Sound   
    Scripts that play a custom notification sound when a player leaves or joins the server that you are currently playing on.
    I made this because I thought it would be nice to be able to join an empty server, then minimize halo and be able to be notified if a player joins, rather than needing to wait in the game for a player to join.
    May require Visual C++ 2019 redistributable
     
    Instructions in the readme.txt
     
     
    player_join_leave_notify.7z
  9. Takka liked a post in a topic by mouseboyx in Player Join/Leave Notification Sound   
    Scripts that play a custom notification sound when a player leaves or joins the server that you are currently playing on.
    I made this because I thought it would be nice to be able to join an empty server, then minimize halo and be able to be notified if a player joins, rather than needing to wait in the game for a player to join.
    May require Visual C++ 2019 redistributable
     
    Instructions in the readme.txt
     
     
    player_join_leave_notify.7z
  10. mouseboyx liked a post in a topic by Enclusion in Player Join/Leave Notification Sound   
    This is going to be so useful. I often idle for a vast amount of time on my server when I want to play, being able to do other things while I wait without having to constantly swap back and forth is something I've wanted for a while.
  11. Takka liked a post in a topic by mouseboyx in Player Join/Leave Notification Sound   
    Scripts that play a custom notification sound when a player leaves or joins the server that you are currently playing on.
    I made this because I thought it would be nice to be able to join an empty server, then minimize halo and be able to be notified if a player joins, rather than needing to wait in the game for a player to join.
    May require Visual C++ 2019 redistributable
     
    Instructions in the readme.txt
     
     
    player_join_leave_notify.7z
  12. Takka liked a post in a topic by mouseboyx in Player Join/Leave Notification Sound   
    Scripts that play a custom notification sound when a player leaves or joins the server that you are currently playing on.
    I made this because I thought it would be nice to be able to join an empty server, then minimize halo and be able to be notified if a player joins, rather than needing to wait in the game for a player to join.
    May require Visual C++ 2019 redistributable
     
    Instructions in the readme.txt
     
     
    player_join_leave_notify.7z
  13. Takka liked a post in a topic by mouseboyx in Player Join/Leave Notification Sound   
    Scripts that play a custom notification sound when a player leaves or joins the server that you are currently playing on.
    I made this because I thought it would be nice to be able to join an empty server, then minimize halo and be able to be notified if a player joins, rather than needing to wait in the game for a player to join.
    May require Visual C++ 2019 redistributable
     
    Instructions in the readme.txt
     
     
    player_join_leave_notify.7z
  14. ST34MF0X liked a post in a topic by mouseboyx in Make your own hit sound melody optic pack   
    I used an optic pack by Devieth for some of the functionality in script.lua.
     
    The default melody is the intro to Cannon in D.  I've included a JavaScript app that will convert guitar tabs to be used within the script.lua.  Convert the tab and replace melody={...} in script.lua with the line generated by the converter.
     
    The sound samples are simple square waves generated by audacity, starting at 82hz then incrementing by semitone up to 2637hz, using this pattern you can replace the samples with your own if you want to.  I would recommend a sample length of 0.150 seconds to 0.250 seconds.  The lower the better to avoid backing up the sound playing api.
     
    release_melody.zip
  15. mouseboyx liked a post in a topic by Kavawuvi in Demon   
    Demon is a reverse engineering project that aims to reimplement the Halo PC demo (AKA Halo Trial) executable as an open source and free reimplementation for anyone to use, modify, and learn from.
     
    The project repo is here: https://github.com/Aerocatia/demon
  16. Takka liked a post in a topic by mouseboyx in Asking ChatGPT to do sapp scripting   
    Of course this script doesn't actually work, but it's crazy how it can pull this out of thin air, among all the other language it can produce.  I first asked it if it was familiar with Halo combat evolved, asked it if it knew of the 3rd party extensions to halo, etc...   If this is an early model, I'm interested to see where this type of tech goes from here.
     
    Prompt: "Using sapp lua scripting can you write a script that replaces the assault rifle with the sniper rifle, using onobjectspawn"
     
    ChatGPT:
    Yes, here's an example script in SAPP Lua that replaces the assault rifle with the sniper rifle using the onObjectSpawn callback:
    api_version = "1.10.0" function OnScriptLoad() register_callback(cb['EVENT_OBJECT_SPAWN'], "OnObjectSpawn") end function OnObjectSpawn(PlayerIndex, MapID, ParentID, ObjectID) if MapID == 3 and ObjectID == 45 then -- Check for assault rifle spawn local new_object = spawn_object("weap", "weapons\\sniper rifle\\sniper rifle", 0, 0, 0) -- Spawn sniper rifle if new_object ~= nil then return new_object -- Return the new object's ID to replace the spawned assault rifle end end end This script checks for the spawn of an assault rifle (MapID 3, ObjectID 45) and replaces it with a sniper rifle by spawning a new sniper rifle object and returning its ID to replace the spawned assault rifle. Keep in mind that this script may not work in multiplayer games with anti-cheat measures.
     
  17. ST34MF0X liked a post in a topic by mouseboyx in (Development Example) Call C from Chimera Script   
    This script itself does nothing to extend the client.
    If you're not looking for a development example I would not recommend downloading and running this script.
    The code is really only a boilerplate of basic calls for someone to use as a starting point if they want to learn or figure out how to call C functions from a chimera lua script.
    I spent days trying to figure out how to do this, so I wanted to share the fruits of my labor in case someone else wants or needs this example.  I still don't fully understand how it works, but I know that the code runs.
     
    The instructions for calling C from lua are included in the readme.txt in the zip.
     
    https://www.lua.org/pil/24.htm
    Is a good starting point to learn more about how to call C from lua.
    chimeralib.zip
  18. Takka liked a post in a topic by mouseboyx in Asking ChatGPT to do sapp scripting   
    Of course this script doesn't actually work, but it's crazy how it can pull this out of thin air, among all the other language it can produce.  I first asked it if it was familiar with Halo combat evolved, asked it if it knew of the 3rd party extensions to halo, etc...   If this is an early model, I'm interested to see where this type of tech goes from here.
     
    Prompt: "Using sapp lua scripting can you write a script that replaces the assault rifle with the sniper rifle, using onobjectspawn"
     
    ChatGPT:
    Yes, here's an example script in SAPP Lua that replaces the assault rifle with the sniper rifle using the onObjectSpawn callback:
    api_version = "1.10.0" function OnScriptLoad() register_callback(cb['EVENT_OBJECT_SPAWN'], "OnObjectSpawn") end function OnObjectSpawn(PlayerIndex, MapID, ParentID, ObjectID) if MapID == 3 and ObjectID == 45 then -- Check for assault rifle spawn local new_object = spawn_object("weap", "weapons\\sniper rifle\\sniper rifle", 0, 0, 0) -- Spawn sniper rifle if new_object ~= nil then return new_object -- Return the new object's ID to replace the spawned assault rifle end end end This script checks for the spawn of an assault rifle (MapID 3, ObjectID 45) and replaces it with a sniper rifle by spawning a new sniper rifle object and returning its ID to replace the spawned assault rifle. Keep in mind that this script may not work in multiplayer games with anti-cheat measures.
     
  19. Takka liked a post in a topic by mouseboyx in Asking ChatGPT to do sapp scripting   
    Of course this script doesn't actually work, but it's crazy how it can pull this out of thin air, among all the other language it can produce.  I first asked it if it was familiar with Halo combat evolved, asked it if it knew of the 3rd party extensions to halo, etc...   If this is an early model, I'm interested to see where this type of tech goes from here.
     
    Prompt: "Using sapp lua scripting can you write a script that replaces the assault rifle with the sniper rifle, using onobjectspawn"
     
    ChatGPT:
    Yes, here's an example script in SAPP Lua that replaces the assault rifle with the sniper rifle using the onObjectSpawn callback:
    api_version = "1.10.0" function OnScriptLoad() register_callback(cb['EVENT_OBJECT_SPAWN'], "OnObjectSpawn") end function OnObjectSpawn(PlayerIndex, MapID, ParentID, ObjectID) if MapID == 3 and ObjectID == 45 then -- Check for assault rifle spawn local new_object = spawn_object("weap", "weapons\\sniper rifle\\sniper rifle", 0, 0, 0) -- Spawn sniper rifle if new_object ~= nil then return new_object -- Return the new object's ID to replace the spawned assault rifle end end end This script checks for the spawn of an assault rifle (MapID 3, ObjectID 45) and replaces it with a sniper rifle by spawning a new sniper rifle object and returning its ID to replace the spawned assault rifle. Keep in mind that this script may not work in multiplayer games with anti-cheat measures.
     
  20. Takka liked a post in a topic by mouseboyx in Asking ChatGPT to do sapp scripting   
    Of course this script doesn't actually work, but it's crazy how it can pull this out of thin air, among all the other language it can produce.  I first asked it if it was familiar with Halo combat evolved, asked it if it knew of the 3rd party extensions to halo, etc...   If this is an early model, I'm interested to see where this type of tech goes from here.
     
    Prompt: "Using sapp lua scripting can you write a script that replaces the assault rifle with the sniper rifle, using onobjectspawn"
     
    ChatGPT:
    Yes, here's an example script in SAPP Lua that replaces the assault rifle with the sniper rifle using the onObjectSpawn callback:
    api_version = "1.10.0" function OnScriptLoad() register_callback(cb['EVENT_OBJECT_SPAWN'], "OnObjectSpawn") end function OnObjectSpawn(PlayerIndex, MapID, ParentID, ObjectID) if MapID == 3 and ObjectID == 45 then -- Check for assault rifle spawn local new_object = spawn_object("weap", "weapons\\sniper rifle\\sniper rifle", 0, 0, 0) -- Spawn sniper rifle if new_object ~= nil then return new_object -- Return the new object's ID to replace the spawned assault rifle end end end This script checks for the spawn of an assault rifle (MapID 3, ObjectID 45) and replaces it with a sniper rifle by spawning a new sniper rifle object and returning its ID to replace the spawned assault rifle. Keep in mind that this script may not work in multiplayer games with anti-cheat measures.
     
  21. Takka liked a post in a topic by mouseboyx in Asking ChatGPT to do sapp scripting   
    Of course this script doesn't actually work, but it's crazy how it can pull this out of thin air, among all the other language it can produce.  I first asked it if it was familiar with Halo combat evolved, asked it if it knew of the 3rd party extensions to halo, etc...   If this is an early model, I'm interested to see where this type of tech goes from here.
     
    Prompt: "Using sapp lua scripting can you write a script that replaces the assault rifle with the sniper rifle, using onobjectspawn"
     
    ChatGPT:
    Yes, here's an example script in SAPP Lua that replaces the assault rifle with the sniper rifle using the onObjectSpawn callback:
    api_version = "1.10.0" function OnScriptLoad() register_callback(cb['EVENT_OBJECT_SPAWN'], "OnObjectSpawn") end function OnObjectSpawn(PlayerIndex, MapID, ParentID, ObjectID) if MapID == 3 and ObjectID == 45 then -- Check for assault rifle spawn local new_object = spawn_object("weap", "weapons\\sniper rifle\\sniper rifle", 0, 0, 0) -- Spawn sniper rifle if new_object ~= nil then return new_object -- Return the new object's ID to replace the spawned assault rifle end end end This script checks for the spawn of an assault rifle (MapID 3, ObjectID 45) and replaces it with a sniper rifle by spawning a new sniper rifle object and returning its ID to replace the spawned assault rifle. Keep in mind that this script may not work in multiplayer games with anti-cheat measures.
     
  22. AntiMomentum liked a post in a topic by mouseboyx in Game Replay   
    I like the idea, it seems difficult to do a seek feature with that though.  For each piece of data that didn't change it's true value could be any arbitrary length from the desired tick that's animating.  It becomes easier if there's an ID associated with each object that didn't change, then seek backward through the file until you find each piece of data that you need.  I can see how it would work, like if some float didn't change from the previous tick then write a single character in place of the float indicating to look to the previous tick, and do that every time it doesn't change.  It seems like a necessary tradeoff, the file size will be smaller, but PHP will have to work harder, rewinding the file, parsing each line, checking if the data is there until it finds everything, then sending it off to js.  js could then see that certain data hasn't changed from the seek position tick and fill that in as necessary.  It gets a little complicated while buffering the animation data too, as well as buffering data while the animation is playing in reverse.
     
    Lmao the optimization never ends, in all seriousness though I'm glad I'm getting feedback to improve this.
     
    In other news I figured out an ok method of latency compensation while using SJ.  Only have to set the camera's aim to a certain number of ticks in the future based on that player's ping.  Ended up having a toggle to switch to use either average ping or instantaneous ping from each tick (seems like it might be necessary for certain warping conditions)
     
    Edit (Progress):
    Added a simple yet effective way to save space, vehicles, and flags and oddballs are the main culprit for bloating the file, because they can sit idle for long periods of time.
    An example string of how a vehicle was saved previously:
    ObjectID,tag_name,obj_x_coord,obj_y_coord,obj_z_coord,obj_front_x,obj_front_y,obj_front_z,obj_up_x,obj_up_y,obj_up_z,player_in_vehicle 3800236052,mp_warthog,46.338062286377,-64.705101013184,1.4689781665802,0.64794391393661,-0.758948802948,-0.064540214836597,-0.04084175080061,-0.11922907084227,0.99202638864517,-1 If none of that data changes in the next tick it's reduced to:
    3799056386,p,69
    ObjectID, the character 'p' to indicate to look to previous data, and 69 as the line number of it's last known data change.
     
    PHP then finds all of the 'p' occurrences and fills in the the first and last line of buffer data with the appropriate true values, then echos out the same 3799056386,p,69 like data for the rest of the stuff that doesn't change, and JavaScript fills in the spaces based on the first and last line.  (I think this should work for reverse buffering because the last line true values are found based on the line numbers from the last line)
     
    With the latency compensation I'm going to add another toggle to compensate all player cameras and not only the SJ view.  As long as the positions and rotations of objects remains true to the current tick, then all player cameras can be set into the future by an individual compensation factor to show where any player is currently aiming via a 3D object.
     
     
  23. Takka liked a post in a topic by mouseboyx in info for event warp   
    A collection of tests that might help someone with event_warp in lua scripting.
     
    Put 'antiwarp 3' without quotes into the sapp init.txt to enable the firing of the EVENT_WARP callback.
     
    While continuously moving, on the 3rd time that a player warps, with 'antiwarp 3', event_warp is fired.  If the player stands still for a moment, there's a cooldown effect where they must move and warp 3 times again to trigger event_warp.
     
    Adding 200-300ms of latency then restoring a normal connection every 0.5-1.0 seconds is enough to trigger a warp event, but somewhere in the 180-220ms range and below the player can still warp, but the warp is very subtle and doesn't always trigger event_warp.  Adding and subtracting a network delay above 300ms will surely trigger event_warp if it's applied continuously.
     
    I was using this quick and dirty linux bash script to simulate warp through the localhost, there is a tool called clumsy for windows on github that can simulate delayed, dropped, etc, packets that can also be useful for testing.
    for i in {0..10000} do sudo tc qdisc del dev lo root netem delay 150ms sleep 0.5 sudo tc qdisc add dev lo root netem delay 150ms sleep 0.5 done Run:  sudo tc qdisc del dev lo root netem delay 150ms  after testing to restore normal latency.
     
     
    Pushing a player with a vehicle can trigger EVENT_WARP even if both players have a perfect connection.  I included an lua script that attempts to find warping distance of players who aren't in vehicles.  It works ok, but doesn't take into account all the variables of what can happen in a game, like gravity, falling, player speed, being pushed by a vehicle, walking up an incline, or other things like that.
     
    The main motivation for testing is, players who apply a warp cheat, then do flag runs, I was hoping there might be a way to auto-kick abusive players like that.  It may be possible, taking into account how many warp events happen in a time period, how far the player is warping each time, etc...  My main concern is that I wouldn't want a script solution to auto kick an innocent player.
     
    event_warp.lua
  24. Takka liked a post in a topic by mouseboyx in info for event warp   
    A collection of tests that might help someone with event_warp in lua scripting.
     
    Put 'antiwarp 3' without quotes into the sapp init.txt to enable the firing of the EVENT_WARP callback.
     
    While continuously moving, on the 3rd time that a player warps, with 'antiwarp 3', event_warp is fired.  If the player stands still for a moment, there's a cooldown effect where they must move and warp 3 times again to trigger event_warp.
     
    Adding 200-300ms of latency then restoring a normal connection every 0.5-1.0 seconds is enough to trigger a warp event, but somewhere in the 180-220ms range and below the player can still warp, but the warp is very subtle and doesn't always trigger event_warp.  Adding and subtracting a network delay above 300ms will surely trigger event_warp if it's applied continuously.
     
    I was using this quick and dirty linux bash script to simulate warp through the localhost, there is a tool called clumsy for windows on github that can simulate delayed, dropped, etc, packets that can also be useful for testing.
    for i in {0..10000} do sudo tc qdisc del dev lo root netem delay 150ms sleep 0.5 sudo tc qdisc add dev lo root netem delay 150ms sleep 0.5 done Run:  sudo tc qdisc del dev lo root netem delay 150ms  after testing to restore normal latency.
     
     
    Pushing a player with a vehicle can trigger EVENT_WARP even if both players have a perfect connection.  I included an lua script that attempts to find warping distance of players who aren't in vehicles.  It works ok, but doesn't take into account all the variables of what can happen in a game, like gravity, falling, player speed, being pushed by a vehicle, walking up an incline, or other things like that.
     
    The main motivation for testing is, players who apply a warp cheat, then do flag runs, I was hoping there might be a way to auto-kick abusive players like that.  It may be possible, taking into account how many warp events happen in a time period, how far the player is warping each time, etc...  My main concern is that I wouldn't want a script solution to auto kick an innocent player.
     
    event_warp.lua
  25. Takka liked a post in a topic by mouseboyx in info for event warp   
    A collection of tests that might help someone with event_warp in lua scripting.
     
    Put 'antiwarp 3' without quotes into the sapp init.txt to enable the firing of the EVENT_WARP callback.
     
    While continuously moving, on the 3rd time that a player warps, with 'antiwarp 3', event_warp is fired.  If the player stands still for a moment, there's a cooldown effect where they must move and warp 3 times again to trigger event_warp.
     
    Adding 200-300ms of latency then restoring a normal connection every 0.5-1.0 seconds is enough to trigger a warp event, but somewhere in the 180-220ms range and below the player can still warp, but the warp is very subtle and doesn't always trigger event_warp.  Adding and subtracting a network delay above 300ms will surely trigger event_warp if it's applied continuously.
     
    I was using this quick and dirty linux bash script to simulate warp through the localhost, there is a tool called clumsy for windows on github that can simulate delayed, dropped, etc, packets that can also be useful for testing.
    for i in {0..10000} do sudo tc qdisc del dev lo root netem delay 150ms sleep 0.5 sudo tc qdisc add dev lo root netem delay 150ms sleep 0.5 done Run:  sudo tc qdisc del dev lo root netem delay 150ms  after testing to restore normal latency.
     
     
    Pushing a player with a vehicle can trigger EVENT_WARP even if both players have a perfect connection.  I included an lua script that attempts to find warping distance of players who aren't in vehicles.  It works ok, but doesn't take into account all the variables of what can happen in a game, like gravity, falling, player speed, being pushed by a vehicle, walking up an incline, or other things like that.
     
    The main motivation for testing is, players who apply a warp cheat, then do flag runs, I was hoping there might be a way to auto-kick abusive players like that.  It may be possible, taking into account how many warp events happen in a time period, how far the player is warping each time, etc...  My main concern is that I wouldn't want a script solution to auto kick an innocent player.
     
    event_warp.lua