From 59940067a1b5753552589f41f0382a3dc0b5494c Mon Sep 17 00:00:00 2001 From: Apollo Date: Fri, 2 Feb 2024 21:58:33 -0700 Subject: [PATCH 1/7] fix: lobby colliding issues, entity cramming, lobby messaging, and player visibility. --- scripts/lobby_scripts/lobby_menu.dsc | 74 +++++++++++++++------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/scripts/lobby_scripts/lobby_menu.dsc b/scripts/lobby_scripts/lobby_menu.dsc index 70508b4..66c1ae2 100644 --- a/scripts/lobby_scripts/lobby_menu.dsc +++ b/scripts/lobby_scripts/lobby_menu.dsc @@ -4,11 +4,10 @@ test: type: task debug: false script: - - define msg "<&c><&l>[!] Resourcepack download failed. - <&f>Sup nerd, the Nimnite resourcepack is <&n>required<&r> to play. + - define msg "<&c><&l>[!] Resourcepack Failed! + <&f>Uh oh, the Nimnite resourcepack is <&n><&l>required<&r> to play! If you think this is a <&c>bug<&r>, please report it in our <&9><&l><&n>Discord<&r> server! - <&b><&n>https://discord.gg/RB5a7WvHeP<&r> - (idk how to make the link clickable rip)" + <&b><&n>https://discord.gg/nimsy<&r>" - kick reason:<[msg]> fort_lobby_handler: @@ -145,6 +144,7 @@ fort_lobby_handler: - adjust fly_speed:0.02 - invisible state:true + - adjust collidable:false - inventory clear - sidebar remove @@ -155,12 +155,19 @@ fort_lobby_handler: - run fort_lobby_handler.lobby_tp - stop - #cancel the emote + # cancel the emote - flag player fort.in_menu:! - flag player fort.emote:! - if == QUIT: - stop + on player chats: + - determine passively cancelled + + # This prevents players from being damaged in the lobby. + on player damaged: + - determine passively cancelled + #in case they hit a player and not click a block on player damages entity flagged:fort.in_menu priority:-10: - determine passively cancelled @@ -171,21 +178,21 @@ fort_lobby_handler: #the attack cooldown is removed via rp - inject fort_lobby_handler.button_press - # - (temp whitelist) - # - on player prelogin: - - define name - - if ! || ]>: - - stop - #].formatted> - - define time_left <&l>].formatted_words.to_uppercase> - - define msg "<&f>SUP HOMOSAPIEN.<&l>THIS SERVER IS PUBLIC IN <&a><&l><[time_left]><&r>!Meanwhile, - check out my <&e>latest video<&r> about the server on <&c><&l>YouTube<&r>. - Stay tuned for some <&e>test runs <&r>this week on my <&5><&l>Twitch<&r>. - <&c>YouTube.com/Nimsy - <&5>Twitch.tv/FlimsyNimsy" - - determine passively KICKED:<[msg]> - - announce "<&e>Kicked <&r><[name]><&e>." to_console + # Deprecated at 2/2/24 - We're now in open beta. + # on player prelogin: + # - define name + # - if ! || ]>: + # - stop + # #].formatted> + # - define time_left <&l>].formatted_words.to_uppercase> + # - define msg "<&f>SUP HOMOSAPIEN.<&l>THIS SERVER IS PUBLIC IN <&a><&l><[time_left]><&r>!Meanwhile, + # check out my <&e>latest video<&r> about the server on <&c><&l>YouTube<&r>. + # Stay tuned for some <&e>test runs <&r>this week on my <&5><&l>Twitch<&r>. + # <&c>YouTube.com/Nimsy + # <&5>Twitch.tv/FlimsyNimsy" + # - determine passively KICKED:<[msg]> + # - announce "<&e>Kicked <&r><[name]><&e>." to_console #### - [ OPTIMIZE / PRETTIFY THIS CODE ] ### on player join: @@ -193,7 +200,11 @@ fort_lobby_handler: - determine passively NONE - define name - - announce "<&chr[0001].font[denizen:announcements]> <&9><[name]>" + # hide player from other players. + - adjust hide_from_players + + ## This shit is so annoying + # - announce "<&chr[0001].font[denizen:announcements]> <&9><[name]>" - announce to_console "<&8><&lb><&a>+<&8><&rb> <&f><[name]>" - teleport @@ -218,8 +229,6 @@ fort_lobby_handler: #- [ ! ] Warning: RP is being downloaded every time players join lobby server (even when returning from game) #can be fixed with new snapshot stuff from 1/18/23 - # - - define hash #add a rp prompt? - resourcepack url:http://mc.nimsy.live:4000/latest.zip hash:<[hash]> forced @@ -234,38 +243,36 @@ fort_lobby_handler: - wait 3s on resource pack status: - #SUCCESSFULLY_LOADED, DECLINED, FAILED_DOWNLOAD, ACCEPTED + # SUCCESSFULLY_LOADED, DECLINED, FAILED_DOWNLOAD, ACCEPTED - define status - #-for test server + # - For test server - define status SUCCESSFULLY_LOADED if: - # - choose : - case SUCCESSFULLY_LOADED: - #reset loading text + # Reset title and remove blindness. - title title:<&sp> subtitle:<&sp> fade_in:1 stay:1 fade_out:1 - cast blindness remove - #in case they moved during rp load + # If the player moves while loading the resource pack, teleport them back to the middle. - teleport - inject fort_lobby_setup.player_setup - wait 2s - #-non-vanilla client risk message + # Check if the player's client ruins the hud, if so we warn them. - define client - define client_blacklist - if && <[client].contains_any_text[<[client_blacklist]>]>: - playsound sound:BLOCK_NOTE_BLOCK_PLING pitch:1.5 - define line <&8>].repeat[80].strikethrough> - narrate <[line]> - - narrate "<&c><&l>[!] Warning [!] <&c>You're running on a client that probably f**ks with your UI in-game." + - narrate "<&c><&l>Warning <&r><&c>You're using a client that could ruin your in-game HUD." - narrate "<&7>Your client: <&c>" - narrate "<&8>Known clients that cause issues: <&7><[client_blacklist].separated_by[<&8>, <&7>]>" - narrate <[line]> - case DECLINED FAILED_DOWNLOAD: - define msg "<&c><&l>[!] Resourcepack download failed. - <&f>Sup nerd, the Nimnite resourcepack is <&n>required<&r> to play. - If you think this is a <&c>bug<&r>, please report it in our <&9><&l><&n>Discord<&r> server! - <&b><&n>https://discord.gg/RB5a7WvHeP<&r> - (idk how to make the link clickable rip)" + <&f>Uh oh... The Nimnite resourcepack is <&c><&n><&l>required<&r> to play. + If you think this is a <&c>bug<&r>, please report it in our <&9><&l><&n>DISCORD<&r> server! + <&b><&n>https://discord.gg/nimsy<&r>" - kick reason:<[msg]> ## - [ MAKE THIS CLEANER ] - ## @@ -620,7 +627,6 @@ fort_lobby_setup: debug: false definitions: cube|loops|type|name script: - #-reset previous entities - foreach play|mode|vid as:button_type: - if _button_hitboxes]>: From d57c1458fed2f98cc5a62af959190bb2b8806118 Mon Sep 17 00:00:00 2001 From: Apollo Date: Fri, 2 Feb 2024 22:06:47 -0700 Subject: [PATCH 2/7] fix: Added shears to vanilla list when using the fortnite pickaxe. --- scripts/game_server_scripts/items/pickaxe.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/game_server_scripts/items/pickaxe.dsc b/scripts/game_server_scripts/items/pickaxe.dsc index 0419552..ebe43f5 100644 --- a/scripts/game_server_scripts/items/pickaxe.dsc +++ b/scripts/game_server_scripts/items/pickaxe.dsc @@ -97,6 +97,8 @@ fort_pic_handler: - define block - define mat <[block].material.name> + - if <[mat].contains_any_text[wool|leaves]>: + - define tool shears - if <[mat].contains_any_text[oak|spruce|birch|jungle|acacia|dark_oak|mangrove|warped|barrel|bamboo]>: - define tool netherite_axe - else: From e863d5d7c45c8ddd29f501ffed4eafdc3466a4e8 Mon Sep 17 00:00:00 2001 From: Apollo Date: Fri, 2 Feb 2024 22:09:25 -0700 Subject: [PATCH 3/7] fix: Added shears to the fortnite pickaxe. --- scripts/game_server_scripts/items/pickaxe.dsc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/game_server_scripts/items/pickaxe.dsc b/scripts/game_server_scripts/items/pickaxe.dsc index 7a25370..bd94017 100644 --- a/scripts/game_server_scripts/items/pickaxe.dsc +++ b/scripts/game_server_scripts/items/pickaxe.dsc @@ -97,12 +97,13 @@ fort_pic_handler: - define block - define mat <[block].material.name> - - if <[mat].contains_any_text[wool|leaves]>: + - if <[mat].contains_any_text[wool]>: - define tool shears - - if <[mat].contains_any_text[oak|spruce|birch|jungle|acacia|dark_oak|mangrove|warped|barrel|bamboo]>: - - define tool netherite_axe - else: - - define tool netherite_pickaxe + - if <[mat].contains_any_text[oak|spruce|birch|jungle|acacia|dark_oak|mangrove|warped|barrel|bamboo]>: + - define tool netherite_axe + - else: + - define tool netherite_pickaxe - if <[i].material.name> != <[tool]>: - inventory adjust slot: material:<[tool]> From c59a231e5d5319603910a1edab8b4c217f5c8ddf Mon Sep 17 00:00:00 2001 From: Apollo Date: Fri, 2 Feb 2024 22:28:13 -0700 Subject: [PATCH 4/7] feat: Added cooldowns to grenades and impulse grenades --- scripts/game_server_scripts/items/explosives.dsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/game_server_scripts/items/explosives.dsc b/scripts/game_server_scripts/items/explosives.dsc index d025edd..f50dbca 100644 --- a/scripts/game_server_scripts/items/explosives.dsc +++ b/scripts/game_server_scripts/items/explosives.dsc @@ -20,13 +20,14 @@ fort_explosive_handler: - foreach stop - wait 1t - on player left clicks block with:fort_item_impulse_grenade flagged:!fort.item_dropped: + on player left clicks block with:fort_item_impulse_grenade flagged:!fort.item_dropped|!using_impulse_grenade: - define i - define eye_loc - define origin <[eye_loc].relative[-0.25,0,0.35]> - define target_loc <[eye_loc].ray_trace[default=air;range=100]> - define points <[origin].points_between[<[target_loc]>].distance[0.75]> + - flag fort.using_impulse_grenade expire:2s - playsound sound:ENTITY_SNOWBALL_THROW pitch:0.9 - take slot: @@ -67,13 +68,14 @@ fort_explosive_handler: - foreach <[entities]> as:e: - adjust <[e]> velocity:<[e].location.above[1].sub[<[grenade_loc]>]> - on player left clicks block with:fort_item_grenade flagged:!fort.item_dropped: + on player left clicks block with:fort_item_grenade flagged:!fort.item_dropped|!fort.using_grenade: - define i - define eye_loc - define origin <[eye_loc].relative[-0.25,0,0.35]> - define target_loc <[eye_loc].ray_trace[default=air;range=100]> - define points <[origin].points_between[<[target_loc]>].distance[0.75]> + - flag fort.using_grenade expire:1.5s - playsound sound:ENTITY_SNOWBALL_THROW pitch:0.9 #item:<[item]> doesn't work for some reason From b61728582c46570e51df7c7c4dde4175dfa784be Mon Sep 17 00:00:00 2001 From: Apollo Date: Sat, 3 Feb 2024 02:05:12 -0700 Subject: [PATCH 5/7] fix: Netherite Shovel in Fortnite Pickaxe & Typo --- scripts/game_server_scripts/items/pickaxe.dsc | 17 ++++++----- scripts/lobby_scripts/lobby_menu.dsc | 29 ++++--------------- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/scripts/game_server_scripts/items/pickaxe.dsc b/scripts/game_server_scripts/items/pickaxe.dsc index bd94017..69f27c1 100644 --- a/scripts/game_server_scripts/items/pickaxe.dsc +++ b/scripts/game_server_scripts/items/pickaxe.dsc @@ -97,16 +97,19 @@ fort_pic_handler: - define block - define mat <[block].material.name> - - if <[mat].contains_any_text[wool]>: - - define tool shears + - if <[mat].contains_any_text[sand]>: + - define tool netherite_shovel - else: - - if <[mat].contains_any_text[oak|spruce|birch|jungle|acacia|dark_oak|mangrove|warped|barrel|bamboo]>: - - define tool netherite_axe + - if <[mat].contains_any_text[wool]>: + - define tool shears - else: - - define tool netherite_pickaxe + - if <[mat].contains_any_text[oak|spruce|birch|jungle|acacia|dark_oak|mangrove|warped|barrel|bamboo]>: + - define tool netherite_axe + - else: + - define tool netherite_pickaxe - - if <[i].material.name> != <[tool]>: - - inventory adjust slot: material:<[tool]> + - if <[i].material.name> != <[tool]>: + - inventory adjust slot: material:<[tool]> #in case they switched from another item - cast FAST_DIGGING remove diff --git a/scripts/lobby_scripts/lobby_menu.dsc b/scripts/lobby_scripts/lobby_menu.dsc index ac26c66..a9f6974 100644 --- a/scripts/lobby_scripts/lobby_menu.dsc +++ b/scripts/lobby_scripts/lobby_menu.dsc @@ -4,7 +4,7 @@ test: type: task debug: false script: - - define msg "<&c><&l>[!] Resourcepack Failed! + - define msg "<&c><&l>RESOURCE PACK FAILED TO APPLY <&f>Uh oh, the Nimnite resourcepack is <&n><&l>required<&r> to play! If you think this is a <&c>bug<&r>, please report it in our <&9><&l><&n>Discord<&r> server! <&b><&n>https://discord.gg/nimsy<&r>" @@ -179,22 +179,6 @@ fort_lobby_handler: #the attack cooldown is removed via rp - inject fort_lobby_handler.button_press - # - (temp whitelist) - # - # Deprecated at 2/2/24 - We're now in open beta. - # on player prelogin: - # - define name - # - if ! || ]>: - # - stop - # #].formatted> - # - define time_left <&l>].formatted_words.to_uppercase> - # - define msg "<&f>SUP HOMOSAPIEN.<&l>THIS SERVER IS PUBLIC IN <&a><&l><[time_left]><&r>!Meanwhile, - # check out my <&e>latest video<&r> about the server on <&c><&l>YouTube<&r>. - # Stay tuned for some <&e>test runs <&r>this week on my <&5><&l>Twitch<&r>. - # <&c>YouTube.com/Nimsy - # <&5>Twitch.tv/FlimsyNimsy" - # - determine passively KICKED:<[msg]> - # - announce "<&e>Kicked <&r><[name]><&e>." to_console - #### - [ OPTIMIZE / PRETTIFY THIS CODE ] ### on player join: #player join message @@ -214,7 +198,7 @@ fort_lobby_handler: #used to prevent collision - team name:lobby_player add: - #-for test server + # for test server - if : - run fort_lobby_setup.player_setup - stop @@ -241,12 +225,10 @@ fort_lobby_handler: - define hash #add a rp prompt? - resourcepack url:http://mc.nimsy.live:4000/latest.zip hash:<[hash]> forced - - #put this inside the tick loop too, or nah - cast BLINDNESS duration:infinite hide_particles no_icon no_ambient - define subtitle "bare with me" - while && ! || : - - title "title:<&e>Downloading Resourcepack..." subtitle:<&7><[subtitle]> fade_in:1 stay:1 fade_out:1 + - title "title:<&e><&l>DOWNLOADING RESOURCEPACK..." subtitle:<&7><[subtitle]> fade_in:1 stay:1 fade_out:1 - define subtitle twitch.tv/flimsynimsy|you ever just realize how handsome nimsy is?|fun fact: 1 year of a degen<&sq>s life was spent on this|y are u still here|please donate me money PLEASE|isn<&sq>t nimsy like- the best?].random> #wait 1s for a "flashing" effect - wait 3s @@ -267,6 +249,7 @@ fort_lobby_handler: - wait 2s # Check if the player's client ruins the hud, if so we warn them. - define client + - announce to_console "Player is using: <[client]>" - define client_blacklist - if && <[client].contains_any_text[<[client_blacklist]>]>: - playsound sound:BLOCK_NOTE_BLOCK_PLING pitch:1.5 @@ -278,7 +261,7 @@ fort_lobby_handler: - narrate <[line]> - case DECLINED FAILED_DOWNLOAD: - - define msg "<&c><&l>[!] Resourcepack download failed. + - define msg "<&c><&l>RESOURCEPACK FAILED TO DOWNLOAD <&f>Uh oh... The Nimnite resourcepack is <&c><&n><&l>required<&r> to play. If you think this is a <&c>bug<&r>, please report it in our <&9><&l><&n>DISCORD<&r> server! <&b><&n>https://discord.gg/nimsy<&r>" @@ -454,7 +437,7 @@ fort_lobby_handler: - run fort_lobby_handler.match_info def.option:remove - - adjust <[name_text]> "text:<&c>Not ready" if:<[name_text].equals[null].not> + - adjust <[name_text]> "text:<&c>Not Ready" if:<[name_text].equals[null].not> - playsound sound:BLOCK_NOTE_BLOCK_BASS pitch:1 - flag player fort.in_queue:! From a97280f8db20e99d6ded15ddee652233893f1349 Mon Sep 17 00:00:00 2001 From: Apollo Date: Sat, 3 Feb 2024 03:15:03 -0700 Subject: [PATCH 6/7] fix!: infinite ammo glitch (aka negative ammo) & stop reloading if shooting --- scripts/game_server_scripts/items/guns.dsc | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/scripts/game_server_scripts/items/guns.dsc b/scripts/game_server_scripts/items/guns.dsc index 2e0126f..58be489 100644 --- a/scripts/game_server_scripts/items/guns.dsc +++ b/scripts/game_server_scripts/items/guns.dsc @@ -131,7 +131,7 @@ fort_gun_handler: #if gun is empty when picking it up, reload - define loaded_ammo .loaded_ammo]> - - if <[loaded_ammo]> == 0: + - if <[loaded_ammo]> <= 0: - run fort_gun_handler.reload def:]> on player drops gun_*: @@ -322,6 +322,7 @@ fort_gun_handler: - flag player fort.<[gun_name]>.cooldown duration:<[gun].flag[cooldown]>s - flag player is_shooting + - flag player fort.reloading_gun:! - while && && == <[gun_uuid]>: #do 1 instead of 0 so there's no delay on the first shot - if <[loop_index].mod[<[ticks_between_shots]>]> == <[mod_value]>: @@ -769,7 +770,7 @@ fort_gun_handler: #run, not inject, since there are waits in it - run update_hud - - if <[loaded_ammo]> == 0: + - if <[loaded_ammo]> <= 0: - run fort_gun_handler.reload def:]> - while stop @@ -833,13 +834,15 @@ fort_gun_handler: - define auto_reload <[data].get[auto_reload]||false> - - if <[total_ammo]> == 0: + # disallow player to reload if negative or equal to 0 ammo + - if <[total_ammo]> <= 0: + # ensure the player has 0 ammo and not negative ammo + - flag player fort.ammo.<[ammo_type]>:0 #auto reload just makes it so the "no reload" text doesn't appear every time you hold the item - if !<[auto_reload]>: - cast FAST_DIGGING amplifier:9999 duration:1s no_icon no_ambient hide_particles - - title "subtitle:<&c>No reload ammo." fade_in:0 stay:1 fade_out:15t + - title "subtitle:<&c>No ammo to reload with." fade_in:0 stay:1 fade_out:15t - playsound sound:UI_BUTTON_CLICK pitch:1.8 - - stop - flag player fort.reloading_gun @@ -851,7 +854,12 @@ fort_gun_handler: - cast SLOW_DIGGING amplifier:255 duration:9999999s no_icon no_ambient hide_particles if:<[gun_name].equals[rocket_launcher].not> - repeat <[reload_time].div[3]>: - #if they hold it and it's, it'll auto reload + # check if the player has stopped reloading during the sequence + - if !: + - define cancelled True + - repeat stop + + # if they hold it and it's, it'll auto reload - if != <[gun_uuid]>: - define cancelled True - repeat stop @@ -875,10 +883,18 @@ fort_gun_handler: - define new_loaded_ammo <[mag_size]> - define new_total_ammo <[total_ammo].sub[<[mag_size].sub[<[current_loaded_ammo]>]>]> + # ensure that new_loaded_ammo is 0 and not negative. + - if <[new_loaded_ammo]> < 0: + - define <[new_loaded_ammo]> 0 + + # ensure that new_total_ammo is 0 and not negative. + - if <[new_total_ammo]> < 0: + - define <[new_total_ammo]> 0 + - flag server fort.temp.<[gun_uuid]>.loaded_ammo:<[new_loaded_ammo]> - flag player fort.ammo.<[ammo_type]>:<[new_total_ammo]> - #"return" rocket into gun + # "return" rocket into gun - if <[gun].script.name.after[gun_]> == rocket_launcher: - inventory adjust slot: custom_model_data:20 @@ -892,7 +908,6 @@ fort_gun_handler: - cast SLOW_DIGGING remove - flag player fort.reloading_gun:! - shoot_fx: #default origin - define particle_origin ]> From 4a8b0ec769e7ecf9e693efe92148a1a47945afff Mon Sep 17 00:00:00 2001 From: Apollo Date: Sat, 3 Feb 2024 03:51:53 -0700 Subject: [PATCH 7/7] fix!: entity cramming in lobby --- scripts/lobby_scripts/lobby_menu.dsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/lobby_scripts/lobby_menu.dsc b/scripts/lobby_scripts/lobby_menu.dsc index a9f6974..2948d21 100644 --- a/scripts/lobby_scripts/lobby_menu.dsc +++ b/scripts/lobby_scripts/lobby_menu.dsc @@ -107,6 +107,9 @@ fort_lobby_handler: - waituntil max:10s #-in case the server crashed/it was incorrectly shut down + # prevents entity cramming of entities. + - gamerule maxEntityCramming 0 + - ~mongo id:nimnite_playerdata connect: database:Nimnite collection:Playerdata - narrate "<&b>[Nimnite]<&r> Connected to Nimnite database."