From ae1db8a29de4f4c47de76c51fadcf445daf85c4f Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Tue, 17 Mar 2020 18:00:46 -0700 Subject: [PATCH] MOTD: Zombie Shield shows as first craftable --- _zm_reimagined.gsc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/_zm_reimagined.gsc b/_zm_reimagined.gsc index fe1fb686..f6d7a79f 100644 --- a/_zm_reimagined.gsc +++ b/_zm_reimagined.gsc @@ -2562,6 +2562,7 @@ buildcraftables() { buildcraftable( "alcatraz_shield_zm" ); buildcraftable( "packasplat" ); + changecraftableoption( 0 ); } else if(level.scr_zm_map_start_location == "tomb") { @@ -2572,6 +2573,38 @@ buildcraftables() } } +changecraftableoption( index ) +{ + foreach (craftable in level.a_uts_craftables) + { + if (craftable.equipname == "open_table") + { + craftable thread setcraftableoption( index ); + } + } +} + +setcraftableoption( index ) +{ + self endon("death"); + + while (self.a_uts_open_craftables_available.size <= 0) + { + wait 0.05; + } + + if (self.a_uts_open_craftables_available.size > 1) + { + self.n_open_craftable_choice = index; + self.equipname = self.a_uts_open_craftables_available[self.n_open_craftable_choice].equipname; + self.hint_string = self.a_uts_open_craftables_available[self.n_open_craftable_choice].hint_string; + foreach (trig in self.playertrigger) + { + trig sethintstring( self.hint_string ); + } + } +} + takecraftableparts( buildable ) { player = get_players()[ 0 ]; @@ -5161,6 +5194,18 @@ test() { while(1) { + i = 0; + foreach (craftable in level.a_uts_craftables) + { + if (isDefined(craftable.origin) && Distance(craftable.origin, self.origin) < 128) + { + i++; + //iprintln(craftable.equipname); + } + } + + iprintln(i); + wait 1; } } \ No newline at end of file