Skip to content

Instantly share code, notes, and snippets.

@mfaizsyahmi
Last active May 16, 2024 16:46
Show Gist options
  • Save mfaizsyahmi/6288808f5342ea6bac4ecbd6722f231a to your computer and use it in GitHub Desktop.
Save mfaizsyahmi/6288808f5342ea6bac4ecbd6722f231a to your computer and use it in GitHub Desktop.
Menagerie of Miscellaneous M.E.S.S. Machinations
{
"classname" "worldspawn"
"defaultteam" "0"
"newunit" "0"
"gametitle" "0"
"startdark" "0"
"MaxRange" "4096"
"sounds" "1"
"angles" "0 0 0"
"_mess_allow_rewrite_rules" "{}"
"origin" "0 0 0"
"mapversion" "220"
"wad" "/SteamLibrary/steamapps/common/Half-Life/valve/decals.wad;/SteamLibrary/steamapps/common/Half-Life/valve/halflife.wad;/SteamLibrary/steamapps/common/Half-Life/valve/liquids.wad;/SteamLibrary/steamapps/common/Half-Life/valve/xeno.wad;/Valve/JACK/common_res/wad/jp_dev.wad;/Valve/JACK/common_res/vhlt/zhlt.wad;/Valve/JACK/common_res/wad/nw_xeno.wad;/SteamLibrary/steamapps/common/Half-Life/gearbox/OPFOR.WAD;/Valve/JACK/common_res/wad/nw.wad;/SteamLibrary/steamapps/common/Half-Life/bshift/barney.wad;/Valve/JACK/common_res/wad/hl_extras.wad"
"_generator" "J.A.C.K. 1.1.3773 Freeware (vpHalfLife)"
"_CREDIT" "by mfaizsyahmi @ kimilil"
"_LICENSE" "(c) 2024 mfaizsyahmi @ kimilil, released under MIT license"
"_AUTHOR_URL" "https://twhl.info/user/view/7776"
}
{
"classname" "macro_insert"
"instance_offset" "{(char_spacing||16)*align/2} 0 0"
"scale" "1"
"angles" "0 0 0"
"instance_orientation" "0"
"instance_count" "1"
"template_name" "tpl_base"
"lines" "{message.split('\\n')}"
"line_spacing" "{line_spacing or 16}"
"char_spacing" "{char_spacing or 16}"
"offset_table" "{ ['<',32,'>',32] }"
"align" "{align or 0}"
"origin" "0 0 0"
}
{
"classname" "macro_insert"
"instance_offset" "0 0 {nth()*-line_spacing}"
"scale" "1"
"angles" "0 0 0"
"instance_orientation" "0"
"instance_count" "{lines.length}"
"line" "{lines[nth()]}"
"template_name" "tpl_line"
"offset_table" "{offset_table}"
"char_spacing" "{char_spacing}"
"line_width" "{lines[nth()].split('').slice(1,-1).map(c => offset_table.contains(c)?offset_table[offset_table.index(c)+1]:char_spacing).reduce((a,b)=>a+b)}"
"align" "{align}"
"origin" "32 0 0"
}
{
"classname" "macro_template"
"selection_weight" "1"
"anchor" "1"
"targetname" "tpl_base"
"angles" "0 0 0"
{
( 40 32 16 ) ( 40 32 -16 ) ( 40 16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 24 16 16 ) ( 24 16 -16 ) ( 24 32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 40 16 16 ) ( 40 16 -16 ) ( 24 16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 24 32 16 ) ( 24 32 -16 ) ( 40 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 24 32 -16 ) ( 24 16 -16 ) ( 40 32 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 40 16 16 ) ( 24 16 16 ) ( 40 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( 24 -32 16 ) ( 24 -32 -16 ) ( 24 -16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 40 -16 16 ) ( 40 -16 -16 ) ( 40 -32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 24 -16 16 ) ( 24 -16 -16 ) ( 40 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 40 -32 16 ) ( 40 -32 -16 ) ( 24 -32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 40 -32 16 ) ( 24 -32 16 ) ( 40 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 24 -16 -16 ) ( 24 -32 -16 ) ( 40 -16 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
}
{
"classname" "macro_template"
"selection_weight" "1"
"anchor" "1"
"targetname" "tpl_char"
"angles" "0 0 0"
{
( 88 120 16 ) ( 88 120 -16 ) ( 88 136 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 104 136 16 ) ( 104 136 -16 ) ( 104 120 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 88 136 16 ) ( 88 136 -16 ) ( 104 136 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 104 120 16 ) ( 104 120 -16 ) ( 88 120 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 104 120 16 ) ( 88 120 16 ) ( 104 136 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 88 136 -16 ) ( 88 120 -16 ) ( 104 136 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( 104 -120 16 ) ( 104 -120 -16 ) ( 104 -136 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 88 -136 16 ) ( 88 -136 -16 ) ( 88 -120 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 104 -136 16 ) ( 104 -136 -16 ) ( 88 -136 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 88 -120 16 ) ( 88 -120 -16 ) ( 104 -120 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 88 -120 -16 ) ( 88 -136 -16 ) ( 104 -120 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 104 -136 16 ) ( 88 -136 16 ) ( 104 -120 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
}
{
"classname" "macro_insert"
"instance_offset" "{-line_width*align/2 + line.substr(0,nth()).split('').slice(1,-1).map(c => offset_table.contains(c)?offset_table[offset_table.index(c)+1]:char_spacing).reduce((a,b)=>a+b)} 0 0"
"scale" "1"
"angles" "0 0 0"
"instance_orientation" "0"
"instance_count" "{line.length}"
"char" "{line[nth()]}"
"template_name" "tpl_char"
"targetname" "nextchar"
"instance_geometry_scale" "1 0 1"
"origin" "64 0 0"
}
{
"classname" "infodecal"
"texture" "{'\x7bSMALL#S' + char}"
"_mess_remove_if" "{!char.match('[0-9]')}"
"angles" "0 0 0"
"origin" "96 96 0"
}
{
"classname" "infodecal"
"texture" "{ '\x7bCAPS' + char }"
"_mess_remove_if" "{!char.match('[a-zA-Z]')}"
"angles" "0 0 0"
"origin" "96 112 0"
}
{
"classname" "macro_remove_if"
"angles" "0 0 0"
"condition" "1"
{
( 128 136 16 ) ( 128 136 -16 ) ( 128 120 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 112 120 16 ) ( 112 120 -16 ) ( 112 136 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 128 120 16 ) ( 128 120 -16 ) ( 112 120 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 112 136 16 ) ( 112 136 -16 ) ( 128 136 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 112 136 -16 ) ( 112 120 -16 ) ( 128 136 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 128 120 16 ) ( 112 120 16 ) ( 128 136 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( 112 -136 16 ) ( 112 -136 -16 ) ( 112 -120 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 128 -120 16 ) ( 128 -120 -16 ) ( 128 -136 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 112 -120 16 ) ( 112 -120 -16 ) ( 128 -120 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 128 -136 16 ) ( 128 -136 -16 ) ( 112 -136 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 128 -136 16 ) ( 112 -136 16 ) ( 128 -120 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 112 -120 -16 ) ( 112 -136 -16 ) ( 128 -120 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
}
{
"classname" "infodecal"
"texture" "{shot2"
"_mess_remove_if" "{char != '.'}"
"angles" "0 0 0"
"origin" "96 80 0"
}
{
"classname" "infodecal"
"texture" "{MOUSTACHE"
"_mess_remove_if" "{char != '@'}"
"angles" "0 0 0"
"origin" "96 48 0"
}
{
"classname" "infodecal"
"texture" "{LITTLEMAN"
"_mess_remove_if" "{char != '#'}"
"angles" "0 0 0"
"origin" "96 32 0"
}
{
"classname" "infodecal"
"texture" "{HAND1"
"_mess_remove_if" "{char != '!'}"
"angles" "0 0 0"
"origin" "96 16 0"
}
{
"classname" "infodecal"
"texture" "{ARROW_L"
"_mess_remove_if" "{char != '<'}"
"angles" "0 0 0"
"origin" "104 0 0"
}
{
"classname" "infodecal"
"texture" "{ARROW_R"
"_mess_remove_if" "{char != '>'}"
"angles" "0 0 0"
"origin" "104 -16 0"
}
{
"classname" "infodecal"
"texture" "{FOOT_R"
"_mess_remove_if" "{char != '\\'}"
"angles" "0 0 0"
"origin" "96 -48 0"
}
{
"classname" "infodecal"
"texture" "{FOOT_L"
"_mess_remove_if" "{char != '/'}"
"angles" "0 0 0"
"origin" "96 -32 0"
}
{
"classname" "info_null"
"targetname" "letters"
"angles" "0 0 0"
"origin" "120 112 0"
}
{
"classname" "info_null"
"targetname" "numbers"
"angles" "0 0 0"
"origin" "120 96 0"
}
{
"classname" "info_null"
"targetname" "dot == shot"
"angles" "0 0 0"
"origin" "120 80 0"
}
{
"classname" "info_null"
"targetname" "@ == mustache"
"angles" "0 0 0"
"origin" "120 48 0"
}
{
"classname" "info_null"
"targetname" "# == little man"
"angles" "0 0 0"
"origin" "120 32 0"
}
{
"classname" "info_null"
"targetname" "! == bloody handprint"
"angles" "0 0 0"
"origin" "120 16 0"
}
{
"classname" "info_null"
"targetname" "< == <--"
"angles" "0 0 0"
"origin" "120 0 0"
}
{
"classname" "info_null"
"targetname" "> == -->"
"angles" "0 0 0"
"origin" "120 -16 0"
}
{
"classname" "info_null"
"targetname" "/ == left footprint"
"angles" "0 0 0"
"origin" "120 -32 0"
}
{
"classname" "info_null"
"targetname" "\ == right footprint"
"angles" "0 0 0"
"origin" "120 -48 0"
}
{
"classname" "info_null"
"targetname" "asterisk == gauss shot"
"angles" "0 0 0"
"origin" "120 64 0"
}
{
"classname" "infodecal"
"texture" "{GAUSSSHOT1"
"_mess_remove_if" "{char != '*'}"
"angles" "0 0 0"
"origin" "96 64 0"
}
{
"classname" "macro_template"
"selection_weight" "1"
"anchor" "1"
"targetname" "tpl_line"
"angles" "0 0 0"
{
( 72 32 16 ) ( 72 32 -16 ) ( 72 16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 56 16 16 ) ( 56 16 -16 ) ( 56 32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 72 16 16 ) ( 72 16 -16 ) ( 56 16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 56 32 16 ) ( 56 32 -16 ) ( 72 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 56 32 -16 ) ( 56 16 -16 ) ( 72 32 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 72 16 16 ) ( 56 16 16 ) ( 72 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( 56 -32 16 ) ( 56 -32 -16 ) ( 56 -16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 72 -16 16 ) ( 72 -16 -16 ) ( 72 -32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 56 -16 16 ) ( 56 -16 -16 ) ( 72 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 72 -32 16 ) ( 72 -32 -16 ) ( 56 -32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 72 -32 16 ) ( 56 -32 16 ) ( 72 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 56 -16 -16 ) ( 56 -32 -16 ) ( 72 -16 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
}
// mtlx_decal_text.ted
// by mfaizsyahmi @ kimilil, 2024
// released under MIT License
//
// generates a bunch of infodecals oriented at given PYR representing stinciled text
//
// angles determine direction of text
// lines go down at (pitch-90 yaw roll)
// letters go across at (pitch yaw)
//
// SPECIAL DECAL LIST:
// . - bullet shot
// * - gauss shot
// ! - bloody hand
// @ - mustache
// # - little man
// < - left arrow
// > - right arrow
// / - left footprint
// \ - right footprint
//
// @MESS REWRITE:
// "classname" : "macro_insert"
// "template_map" : "{ted_dir() + '/mtlx_decal_text.map'}"
// @MESS;
@PointClass color(255 80 0) = mtlx_decal_text : "Stenciled text"
[
angles(string) : "Pitch Yaw Roll (Y Z X)" // : : "Lines go across at (pitch-90 yaw roll), letters go across at (pitch yaw)"
message(string) : "Text (\n for line break)"
line_spacing(integer) : "Line spacing (units)" : 16
char_spacing(integer) : "Letter spacing (units)" : 16
// horizontal alignment only. point is still where first line is
align(choices) : "Text alignment" : 0 =
[
0 : "Left"
1 : "Center"
2 : "Right"
]
// CREDITS
_sep(string) : " "
_CREDIT(string) : "by mfaizsyahmi @ kimilil"
_LICENSE(string) : "(c) 2024 mfaizsyahmi @ kimilil, released under MIT license"
_AUTHOR_URL(string) : "https://twhl.info/user/view/7776"
]
// mtlx_multi_manager.ted
// by mfaizsyahmi @ kimilil 2024
// released under MIT License
//
// a convinient template entity that translates to a regular multi_manager
// this one has proper targeting so you can select targets and visualize
// the connections in your editor
// target game: Half-Life
// supports sven-coop's # discriminator: no
// @MESS REWRITE AFTER_MACRO_EXPANSION:
// "classname" : "multi_manager"
// @IF "{t1}":
// "{t1}#n1": "{d1}"
// delete "t1"
// delete "d1"
// @ENDIF;
// @IF "{t2}":
// "{t2}#n2": "{d2}"
// delete "t2"
// delete "d2"
// @ENDIF;
// @IF "{t3}":
// "{t3}#n3": "{d3}"
// delete "t3"
// delete "d3"
// @ENDIF;
// @IF "{t4}":
// "{t4}#n4": "{d4}"
// delete "t4"
// delete "d4"
// @ENDIF;
// @IF "{t5}":
// "{t5}#n5": "{d5}"
// delete "t5"
// delete "d5"
// @ENDIF;
// @IF "{t6}":
// "{t6}#n6": "{d6}"
// delete "t6"
// delete "d6"
// @ENDIF;
// @IF "{t7}":
// "{t7}#n7": "{d7}"
// delete "t7"
// delete "d7"
// @ENDIF;
// @IF "{t8}":
// "{t8}#n8": "{d8}"
// delete "t8"
// delete "d8"
// @ENDIF;
// @IF "{t9}":
// "{t9}#n9": "{d9}"
// delete "t9"
// delete "d9"
// @ENDIF;
// @IF "{t10}":
// "{t10}#n10": "{d10}"
// delete "t10"
// delete "d10"
// @ENDIF;
// @IF "{t11}":
// "{t11}#n11": "{d11}"
// delete "t11"
// delete "d11"
// @ENDIF;
// @IF "{t12}":
// "{t12}#n12": "{d12}"
// delete "t12"
// delete "d12"
// @ENDIF;
// @IF "{t13}":
// "{t13}#n13": "{d13}"
// delete "t13"
// delete "d13"
// @ENDIF;
// @IF "{t14}":
// "{t14}#n14": "{d14}"
// delete "t14"
// delete "d14"
// @ENDIF;
// @IF "{t15}":
// "{t15}#n15": "{d15}"
// delete "t15"
// delete "d15"
// @ENDIF;
// @IF "{t16}":
// "{t16}#n16": "{d16}"
// delete "t16"
// delete "d16"
// @ENDIF;
// @MESS;
@PointClass color(255 128 0) iconsprite("sprites/multi_manager.spr") = mtlx_multi_manager : "MultiTarget Manager"
[
spawnflags(Flags) =
[
1 : "multithreaded" : 0
]
targetname(target_source) : "Name"
t1(target_destination) : "Target #1"
d1(string) : "Delay #1"
t2(target_destination) : "Target #2"
d2(string) : "Delay #2"
t3(target_destination) : "Target #3"
d3(string) : "Delay #3"
t4(target_destination) : "Target #4"
d4(string) : "Delay #4"
t5(target_destination) : "Target #5"
d5(string) : "Delay #5"
t6(target_destination) : "Target #6"
d6(string) : "Delay #6"
t7(target_destination) : "Target #7"
d7(string) : "Delay #7"
t8(target_destination) : "Target #8"
d8(string) : "Delay #8"
t9(target_destination) : "Target #9"
d9(string) : "Delay #9"
t10(target_destination) : "Target #10"
d10(string) : "Delay #10"
t11(target_destination) : "Target #11"
d11(string) : "Delay #11"
t12(target_destination) : "Target #12"
d12(string) : "Delay #12"
t13(target_destination) : "Target #13"
d13(string) : "Delay #13"
t14(target_destination) : "Target #14"
d14(string) : "Delay #14"
t15(target_destination) : "Target #15"
d15(string) : "Delay #15"
t16(target_destination) : "Target #16"
d16(string) : "Delay #16"
]
{
"classname" "worldspawn"
"defaultteam" "0"
"newunit" "0"
"gametitle" "0"
"startdark" "0"
"MaxRange" "4096"
"sounds" "1"
"angles" "0 0 0"
"_mess_allow_rewrite_rules" "{'mtlx_trigger_sequential'}"
"origin" "0 0 0"
"mapversion" "220"
"wad" "/SteamLibrary/steamapps/common/Half-Life/valve/decals.wad;/SteamLibrary/steamapps/common/Half-Life/valve/halflife.wad;/SteamLibrary/steamapps/common/Half-Life/valve/liquids.wad;/SteamLibrary/steamapps/common/Half-Life/valve/xeno.wad;/Valve/JACK/common_res/wad/jp_dev.wad;/Valve/JACK/common_res/vhlt/zhlt.wad;/Valve/JACK/common_res/wad/nw_xeno.wad;/SteamLibrary/steamapps/common/Half-Life/gearbox/OPFOR.WAD;/Valve/JACK/common_res/wad/nw.wad;/SteamLibrary/steamapps/common/Half-Life/bshift/barney.wad;/Valve/JACK/common_res/wad/hl_extras.wad"
"_generator" "J.A.C.K. 1.1.3773 Freeware (vpHalfLife)"
"_CREDIT" "by mfaizsyahmi @ kimilil"
"_LICENSE" "(c) 2024 mfaizsyahmi @ kimilil, released under MIT license"
"_AUTHOR_URL" "https://twhl.info/user/view/7776"
}
{
"classname" "macro_template"
"selection_weight" "1"
"anchor" "1"
"targetname" "tpl_step"
"angles" "0 0 0"
{
( 64 -32 16 ) ( 64 -32 -16 ) ( 64 -16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 96 -16 16 ) ( 96 -16 -16 ) ( 96 -32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 64 -16 16 ) ( 64 -16 -16 ) ( 96 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 96 -32 16 ) ( 96 -32 -16 ) ( 64 -32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 96 -32 16 ) ( 64 -32 16 ) ( 96 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 64 -16 -16 ) ( 64 -32 -16 ) ( 96 -16 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( 96 32 16 ) ( 96 32 -16 ) ( 96 16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 64 16 16 ) ( 64 16 -16 ) ( 64 32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 96 16 16 ) ( 96 16 -16 ) ( 64 16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 64 32 16 ) ( 64 32 -16 ) ( 96 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 64 32 -16 ) ( 64 16 -16 ) ( 96 32 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 96 16 16 ) ( 64 16 16 ) ( 96 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
}
{
"classname" "macro_insert"
"instance_offset" "0 {nth()*32/max(targets.length,1)} 0"
"scale" "1"
"angles" "0 0 0"
"instance_orientation" "0"
"instance_count" "{targets.length}"
"template_name" "tpl_step"
"inst_name" "{id()}_r{nth()}"
"inst_target" "{targets[nth()]}"
"inst_next" "{id()}_r{(nth()+1)%targets.length}"
"loop" "{loop}"
"is_last" "{nth() == targets.length-1}"
"inst_delay" "{delays[nth()] or 0}"
"base_relay" "{targetname}"
"inst_triggerstate" "{triggerstates[nth()] or 2}"
"targetname" "{id()}"
"origin" "40 0 0"
}
{
"classname" "trigger_relay"
"triggerstate" "2"
"delay" "0"
"targetname" "{targetname}"
"target" "{id()}_r0"
"angles" "0 0 0"
"origin" "0 0 0"
}
{
"classname" "trigger_relay"
"triggerstate" "{inst_triggerstate}"
"delay" "{inst_delay}"
"targetname" "{inst_name}"
"target" "{inst_target}"
"killtarget" "{!loop?inst_name:''}"
"angles" "0 0 0"
"_mess_allow_rewrite_rules" "{}"
"origin" "72 0 0"
}
{
"classname" "trigger_changetarget"
"delay" "0"
"targetname" "{inst_name}"
"target" "{base_relay}"
"m_iszNewTarget" "{inst_next}"
"_mess_remove_if" "{is_last&&!loop}"
"killtarget" "{is_last&&!loop?base_relay:''}"
"angles" "0 0 0"
"origin" "88 0 0"
}
{
"classname" "macro_template"
"selection_weight" "1"
"anchor" "1"
"targetname" "tpl_base"
"angles" "0 0 0"
{
( 48 -16 16 ) ( 48 -16 -16 ) ( 48 -32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 32 -32 16 ) ( 32 -32 -16 ) ( 32 -16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 48 -32 16 ) ( 48 -32 -16 ) ( 32 -32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 32 -16 16 ) ( 32 -16 -16 ) ( 48 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 32 -16 -16 ) ( 32 -32 -16 ) ( 48 -16 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 48 -32 16 ) ( 32 -32 16 ) ( 48 -16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( 32 16 16 ) ( 32 16 -16 ) ( 32 32 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 48 32 16 ) ( 48 32 -16 ) ( 48 16 16 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 32 32 16 ) ( 32 32 -16 ) ( 48 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 48 16 16 ) ( 48 16 -16 ) ( 32 16 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 48 16 16 ) ( 32 16 16 ) ( 48 32 16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 32 32 -16 ) ( 32 16 -16 ) ( 48 32 -16 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
}
{
"classname" "macro_insert"
"instance_offset" "0 0 0"
"scale" "1"
"angles" "0 0 0"
"instance_orientation" "0"
"instance_count" "1"
"template_name" "tpl_base"
"targets" "{_targets ? _targets.split(',').map(s => s.trim().matches('[\\w-]+(?=[#@])?')[0]) : targets}"
"delays" "{_targets ? _targets.split(',').map(s => s.trim().matches('(?<=@)[\\d.]+')[0]) : delays}"
"triggerstates" "{_targets ? _targets.split(',').map(s => s.trim().matches('(?<=#)[\\d.]+')[0]) : triggerstates}"
"loop" "{loop}"
"targetname" "{targetname}"
"origin" "24 -8 0"
}
// mtlx_trigger_sequence.ted
// by mfaizsyahmi @ kimilil 2024
// released under MIT License
//
// template entity that translates to a relay that fire its target in a sequence
// @//MESS REWRITE:
// "classname" : "macro_insert"
// "template_map" : "{ted_dir() + '/mtlx_trigger_sequential.map'}"
// @//MESS;
//@PointClass color(255 80 0) = mtlx_trigger_sequential_ex : "Every trigger, fire next target in given sequence"
//[
// targetname(target_source) : "Name"
// targets(string) : "Targets (array[string])" // : : "Enter MESS array of targets e.g. {['t1','t2','t3']}"
// delays(string) : "Delays before trigger (array[number])" // : : "Enter MESS array of delay values e.g. {[0,5,2]}"
// triggerstates(string) : "Trigger states (array[int])" // : : "Enter MESS array of trigger states e.g. {[2,1,2]}. (0=0ff 1=on 2=toggle)"
// loop(choices) : "Loops?" : 1 = // : "Whether to loop back to first target after the last" =
// [
// 0 : "No"
// 1 : "Yes"
// ]
//]
// alias to above entity, using a single field that supports a special syntax
// `target#state@delay, target2...`
// state values: 0=off 1=on 2=toggle
// delay is in seconds
//
// @MESS REWRITE:
// "classname" : "macro_insert"
// "template_map" : "{ted_dir() + '/mtlx_trigger_sequential.map'}"
// @MESS;
// template map should handle these
// "delays" : "{_targets.split(',').map(s => s.trim().matches('(?<=@)[\\d.]+')[0])}"
// "triggerstates" : "{_targets.split(',').map(s => s.trim().matches('(?<=#)\\d')[0])}"
// "TEST" : "{_targets.split(',').map(s => s.trim().matches('[\\w-]+(?=[#@])?')[0])}"
// "targets" : "{_targets.split(',').map(s => s.trim().matches('[\\w-]+(?=[#@])?')[0])}"
@PointClass color(255 80 0) = mtlx_trigger_sequential : "Every trigger, fire next target in given sequence"
[
targetname(target_source) : "Name"
_targets(string) : "Targets (target#state@delay, target2...)"
loop(choices) : "Loops?" : 1 = // : "Whether to loop back to first target after the last" =
[
0 : "No"
1 : "Yes"
]
// CREDITS
_sep(string) : " "
_CREDIT(string) : "by mfaizsyahmi @ kimilil"
_LICENSE(string) : "(c) 2024 mfaizsyahmi @ kimilil, released under MIT license"
_AUTHOR_URL(string) : "https://twhl.info/user/view/7776"
]
// @MESS REWRITE AFTER_MACRO_EXPANSION WHEN "{_speedfactor}":
// "speed": "{speed * _speedfactor}"
// @MESS;
// Scrolling textures can be applied to any brush entity, but only func_conveyor has an attribute for controlling the scroll speed.
// However, because the actual scrolling speed is stored in the 'rendercolor' attribute, it's still possible to control the scrolling speed
// in other entities, provided you know the format (R = scroll direction, G = scroll speed / 16, B = scroll speed * 16).
//
// This template behavior lets you set the scroll speed by adding a custom 'scrollspeed' attribute to a brush entity,
// and it will automatically convert that to the right format and store it in the 'rendercolor' attribute.
//
// "rendercolor": "{str([scrollspeed >= 0 ? 0 : 1, clamp(round(abs(scrollspeed) / 16), 0, 255), clamp(round((abs(scrollspeed) % 16) * 16), 0, 255)])}"
// @MESS REWRITE AFTER_MACRO_EXPANSION WHEN "{scrollspeed}":
// @IF "{!getglobal('MTL_DISABLE_SCROLLSPEED_PROPERTY')}":
// "rendercolor": "{str([scrollspeed >= 0 ? 0 : 1, clamp(floor(abs(scrollspeed) / 16), 0, 255), floor(abs(scrollspeed)*16) % 256 ])}"
// delete "scrollspeed"
// @ENDIF;
// @MESS;
// STRIPS UNUSED ZHLT KEYVALUES TO REDUCE WEIRD BEHAVIORS
// @MESS REWRITE AFTER_MACRO_EXPANSION WHEN "{zhlt_noclip == 0}":
// delete "zhlt_noclip"
// @MESS;
// @MESS REWRITE AFTER_MACRO_EXPANSION WHEN "{zhlt_invisible == 0}":
// delete "zhlt_invisible"
// @MESS;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment