| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953 |
- <!doctype html>
- <html lang="en" class="no-js">
- <head>
-
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1">
-
-
-
-
- <link rel="prev" href="lock-key-system.html">
-
-
- <link rel="next" href="connection-rules.html">
-
-
- <link rel="icon" href="../assets/images/favicon.ico">
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.11">
-
-
-
- <title>Injecting Special Tiles - DunGen</title>
-
-
-
- <link rel="stylesheet" href="../assets/stylesheets/main.4af4bdda.min.css">
-
-
- <link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
-
-
-
-
-
- <script src="https://unpkg.com/iframe-worker/shim"></script>
-
-
-
-
-
-
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
- <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
-
-
-
- <link rel="stylesheet" href="../stylesheets/extra.css">
-
- <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
-
-
-
-
-
- </head>
-
-
-
-
-
-
-
- <body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="black" data-md-color-accent="cyan">
-
-
- <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
- <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
- <label class="md-overlay" for="__drawer"></label>
- <div data-md-component="skip">
-
-
- <a href="#advanced-features-injecting-special-tiles" class="md-skip">
- Skip to content
- </a>
-
- </div>
- <div data-md-component="announce">
-
- </div>
-
-
-
-
- <header class="md-header md-header--shadow" data-md-component="header">
- <nav class="md-header__inner md-grid" aria-label="Header">
- <a href="../index.html" title="DunGen" class="md-header__button md-logo" aria-label="DunGen" data-md-component="logo">
- <svg width="100%" height="100%" viewBox="0 0 258 272" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <path d="M79,20.998C103.163,20.998 126.827,20.993 150.49,21.002C156.512,21.004 156.994,21.502 157,27.603C157.008,36.435 157.275,45.279 156.89,54.094C156.689,58.68 158.685,61.484 161.849,64.242C170.723,71.978 179.515,79.812 188.188,87.772C190.849,90.214 193.071,93.217 195.28,95.995C199.425,101.209 199.993,100.532 203.73,100.441C209.056,100.311 214.403,100.217 219.713,100.549C222.988,100.754 224.083,99.873 224.059,96.517C223.93,78.354 223.952,60.189 224.044,42.025C224.059,38.949 223.341,37.434 219.868,37.603C214.383,37.872 208.877,37.791 203.381,37.715C199.579,37.663 197.517,38.715 197.907,43.168C198.327,47.964 197.807,52.836 198.065,57.655C198.263,61.366 196.432,62.919 193.348,61.885C188.656,60.311 184.193,58.029 179.724,55.858C179.188,55.598 179.033,54.157 179.028,53.262C178.979,44.43 179.007,35.598 178.995,26.766C178.99,22.857 180.241,20.823 184.822,20.897C200.816,21.158 216.816,20.988 232.814,21.004C239.132,21.01 240.996,22.894 240.998,29.241C241.006,56.07 241.005,82.9 240.998,109.729C240.997,114.795 238.959,117.469 233.922,117.935C228.649,118.423 223.32,118.407 218.015,118.42C208.355,118.444 198.68,117.994 189.04,118.408C184.225,118.615 181.96,116.755 180.231,112.653C175.241,100.811 167.104,91.401 156.54,84.26C153.778,82.394 150.001,81.189 146.67,81.142C126.51,80.86 106.344,81.107 86.182,80.92C81.723,80.878 80.502,82.453 80.517,86.753C80.64,122.394 80.606,158.037 80.499,193.679C80.487,197.764 81.821,199.148 86.047,199.093C103.375,198.866 120.707,198.998 138.038,198.998C159.059,198.998 178.198,184.319 182.849,163.942C184.15,158.243 183.93,152.135 183.91,146.215C183.896,141.846 185.254,139.882 189.885,139.936C204.381,140.105 218.88,139.974 233.378,140.01C238.862,140.024 240.989,142.215 240.993,147.822C241.011,180.317 241.012,212.813 240.992,245.308C240.988,250.939 238.967,252.977 233.218,252.985C205.722,253.022 178.226,253.017 150.73,252.989C145.524,252.983 144.074,251.47 144.001,246.325C143.982,244.992 144.14,243.641 143.973,242.329C143.34,237.341 146.132,235.979 150.411,235.99C160.395,236.016 171.06,236.112 181.183,236.112C181.349,229.59 181.592,223.106 181.957,216.723C182.112,214.015 183.166,213.054 185.926,212.937C199.005,212.385 199.002,212.308 199.002,225.465C199.002,236.846 199.003,236.883 210.211,236.618C214.669,236.512 219.122,236.203 223.998,235.966L223.998,215.809C223.998,197.812 223.911,179.813 224.071,161.817C224.103,158.195 223.211,156.729 219.348,156.922C213.399,157.218 207.424,157 201.518,157C200.995,162.216 201.49,167.296 200.093,171.982C197.761,179.807 196.375,184.335 192.2,189.003C186.463,195.42 180.539,202.401 173.212,206.467C165.218,210.904 155.809,213.982 146.533,214.772C140.003,215.328 133.915,215.112 127.586,214.988C124.239,214.923 122.845,216.06 122.934,219.622C123.145,228.116 123.005,236.618 123.001,245.117C122.998,251.059 121.128,252.977 115.061,252.989C97.897,253.025 80.733,253.002 63.568,253.002C51.404,253.002 39.239,253.028 27.074,252.99C21.11,252.972 19.972,251.911 19.969,246.171C19.952,212.512 20.027,178.852 19.931,145.193C19.92,141.244 21.512,139.936 25.206,139.967C36.037,140.056 46.872,139.868 57.7,140.066C61.659,140.139 62.704,138.654 62.9,134.816C63.079,131.328 63.031,127.859 62.985,124.329C62.92,119.388 61.017,118.259 56.858,118.302C47.864,118.397 38.869,118.381 29.875,118.42C29.044,118.424 28.21,118.569 27.382,118.535C20.483,118.255 19.854,117.626 19.858,110.743C19.874,83.582 19.901,56.422 19.946,29.261C19.957,22.709 21.747,21.005 28.509,21.001C45.173,20.992 61.836,20.998 79,20.998M40.806,37.592C39.579,39.018 37.305,40.427 37.283,41.871C37.009,60.012 37.047,78.158 37.045,96.302C37.045,98.812 38.187,100.243 40.973,100.24C46.626,100.235 52.281,100.327 57.93,100.537C61.815,100.681 63.165,99.043 63.06,95.156C62.832,86.672 62.99,78.177 63.001,69.687C63.01,63.101 65.168,60.989 71.882,60.989C92.36,60.99 112.837,60.999 133.315,60.997C139.718,60.996 139.987,60.711 139.998,54.125C140.004,50.629 139.757,47.111 140.059,43.642C140.457,39.073 138.568,37.373 134.101,37.395C103.319,37.551 72.535,37.595 40.806,37.592M62.997,200.455C62.997,187.472 63.078,174.487 62.886,161.507C62.863,159.996 61.38,157.25 60.476,157.208C52.923,156.859 45.347,157.01 37.87,157.01C37.87,182.364 37.917,206.983 37.817,231.602C37.803,235.205 39.289,236.074 42.623,236.055C62.599,235.939 82.576,236.005 102.552,235.977C103.642,235.975 104.732,235.678 105.997,235.493C105.997,229.703 105.875,224.216 106.048,218.738C106.137,215.898 105.136,214.958 102.315,214.998C93.661,215.12 85.004,215.009 76.348,215.006C62.998,215 62.998,215.006 62.997,200.455Z" style="fill:currentColor;fill-rule:nonzero;"/>
- <g transform="matrix(1,0,0,1,91.4761,179.778)">
- <text x="0px" y="0px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:110px;fill:currentColor;">D</text>
- </g>
- </svg>
- </a>
- <label class="md-header__button md-icon" for="__drawer">
-
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
- </label>
- <div class="md-header__title" data-md-component="header-title">
- <div class="md-header__ellipsis">
- <div class="md-header__topic">
- <span class="md-ellipsis">
- DunGen
- </span>
- </div>
- <div class="md-header__topic" data-md-component="header-topic">
- <span class="md-ellipsis">
-
- Injecting Special Tiles
-
- </span>
- </div>
- </div>
- </div>
-
-
-
-
-
-
-
- </nav>
-
- </header>
-
- <div class="md-container" data-md-component="container">
-
-
-
-
-
-
- <main class="md-main" data-md-component="main">
- <div class="md-main__inner md-grid">
-
-
-
- <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
- <div class="md-sidebar__scrollwrap">
- <div class="md-sidebar__inner">
-
- <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
- <label class="md-nav__title" for="__drawer">
- <a href="../index.html" title="DunGen" class="md-nav__button md-logo" aria-label="DunGen" data-md-component="logo">
- <svg width="100%" height="100%" viewBox="0 0 258 272" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <path d="M79,20.998C103.163,20.998 126.827,20.993 150.49,21.002C156.512,21.004 156.994,21.502 157,27.603C157.008,36.435 157.275,45.279 156.89,54.094C156.689,58.68 158.685,61.484 161.849,64.242C170.723,71.978 179.515,79.812 188.188,87.772C190.849,90.214 193.071,93.217 195.28,95.995C199.425,101.209 199.993,100.532 203.73,100.441C209.056,100.311 214.403,100.217 219.713,100.549C222.988,100.754 224.083,99.873 224.059,96.517C223.93,78.354 223.952,60.189 224.044,42.025C224.059,38.949 223.341,37.434 219.868,37.603C214.383,37.872 208.877,37.791 203.381,37.715C199.579,37.663 197.517,38.715 197.907,43.168C198.327,47.964 197.807,52.836 198.065,57.655C198.263,61.366 196.432,62.919 193.348,61.885C188.656,60.311 184.193,58.029 179.724,55.858C179.188,55.598 179.033,54.157 179.028,53.262C178.979,44.43 179.007,35.598 178.995,26.766C178.99,22.857 180.241,20.823 184.822,20.897C200.816,21.158 216.816,20.988 232.814,21.004C239.132,21.01 240.996,22.894 240.998,29.241C241.006,56.07 241.005,82.9 240.998,109.729C240.997,114.795 238.959,117.469 233.922,117.935C228.649,118.423 223.32,118.407 218.015,118.42C208.355,118.444 198.68,117.994 189.04,118.408C184.225,118.615 181.96,116.755 180.231,112.653C175.241,100.811 167.104,91.401 156.54,84.26C153.778,82.394 150.001,81.189 146.67,81.142C126.51,80.86 106.344,81.107 86.182,80.92C81.723,80.878 80.502,82.453 80.517,86.753C80.64,122.394 80.606,158.037 80.499,193.679C80.487,197.764 81.821,199.148 86.047,199.093C103.375,198.866 120.707,198.998 138.038,198.998C159.059,198.998 178.198,184.319 182.849,163.942C184.15,158.243 183.93,152.135 183.91,146.215C183.896,141.846 185.254,139.882 189.885,139.936C204.381,140.105 218.88,139.974 233.378,140.01C238.862,140.024 240.989,142.215 240.993,147.822C241.011,180.317 241.012,212.813 240.992,245.308C240.988,250.939 238.967,252.977 233.218,252.985C205.722,253.022 178.226,253.017 150.73,252.989C145.524,252.983 144.074,251.47 144.001,246.325C143.982,244.992 144.14,243.641 143.973,242.329C143.34,237.341 146.132,235.979 150.411,235.99C160.395,236.016 171.06,236.112 181.183,236.112C181.349,229.59 181.592,223.106 181.957,216.723C182.112,214.015 183.166,213.054 185.926,212.937C199.005,212.385 199.002,212.308 199.002,225.465C199.002,236.846 199.003,236.883 210.211,236.618C214.669,236.512 219.122,236.203 223.998,235.966L223.998,215.809C223.998,197.812 223.911,179.813 224.071,161.817C224.103,158.195 223.211,156.729 219.348,156.922C213.399,157.218 207.424,157 201.518,157C200.995,162.216 201.49,167.296 200.093,171.982C197.761,179.807 196.375,184.335 192.2,189.003C186.463,195.42 180.539,202.401 173.212,206.467C165.218,210.904 155.809,213.982 146.533,214.772C140.003,215.328 133.915,215.112 127.586,214.988C124.239,214.923 122.845,216.06 122.934,219.622C123.145,228.116 123.005,236.618 123.001,245.117C122.998,251.059 121.128,252.977 115.061,252.989C97.897,253.025 80.733,253.002 63.568,253.002C51.404,253.002 39.239,253.028 27.074,252.99C21.11,252.972 19.972,251.911 19.969,246.171C19.952,212.512 20.027,178.852 19.931,145.193C19.92,141.244 21.512,139.936 25.206,139.967C36.037,140.056 46.872,139.868 57.7,140.066C61.659,140.139 62.704,138.654 62.9,134.816C63.079,131.328 63.031,127.859 62.985,124.329C62.92,119.388 61.017,118.259 56.858,118.302C47.864,118.397 38.869,118.381 29.875,118.42C29.044,118.424 28.21,118.569 27.382,118.535C20.483,118.255 19.854,117.626 19.858,110.743C19.874,83.582 19.901,56.422 19.946,29.261C19.957,22.709 21.747,21.005 28.509,21.001C45.173,20.992 61.836,20.998 79,20.998M40.806,37.592C39.579,39.018 37.305,40.427 37.283,41.871C37.009,60.012 37.047,78.158 37.045,96.302C37.045,98.812 38.187,100.243 40.973,100.24C46.626,100.235 52.281,100.327 57.93,100.537C61.815,100.681 63.165,99.043 63.06,95.156C62.832,86.672 62.99,78.177 63.001,69.687C63.01,63.101 65.168,60.989 71.882,60.989C92.36,60.99 112.837,60.999 133.315,60.997C139.718,60.996 139.987,60.711 139.998,54.125C140.004,50.629 139.757,47.111 140.059,43.642C140.457,39.073 138.568,37.373 134.101,37.395C103.319,37.551 72.535,37.595 40.806,37.592M62.997,200.455C62.997,187.472 63.078,174.487 62.886,161.507C62.863,159.996 61.38,157.25 60.476,157.208C52.923,156.859 45.347,157.01 37.87,157.01C37.87,182.364 37.917,206.983 37.817,231.602C37.803,235.205 39.289,236.074 42.623,236.055C62.599,235.939 82.576,236.005 102.552,235.977C103.642,235.975 104.732,235.678 105.997,235.493C105.997,229.703 105.875,224.216 106.048,218.738C106.137,215.898 105.136,214.958 102.315,214.998C93.661,215.12 85.004,215.009 76.348,215.006C62.998,215 62.998,215.006 62.997,200.455Z" style="fill:currentColor;fill-rule:nonzero;"/>
- <g transform="matrix(1,0,0,1,91.4761,179.778)">
- <text x="0px" y="0px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:110px;fill:currentColor;">D</text>
- </g>
- </svg>
- </a>
- DunGen
- </label>
-
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../index.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Introduction
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../changelog.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Changelog
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
-
-
- <div class="md-nav__link md-nav__container">
- <a href="../getting-started/index.html" class="md-nav__link ">
-
-
-
- <span class="md-ellipsis">
- Getting Started
-
- </span>
-
- </a>
-
-
- <label class="md-nav__link " for="__nav_3" id="__nav_3_label" tabindex="0">
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- </div>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
- <label class="md-nav__title" for="__nav_3">
- <span class="md-nav__icon md-icon"></span>
- Getting Started
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../getting-started/1-creating-tiles.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- 1. Creating Tiles
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../getting-started/2-doorways.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- 2. Doorways
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../getting-started/3-dungeon-flow.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- 3. Dungeon Flow Basics
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../getting-started/4-scene-setup.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- 4. Scene Setup & First Generation
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
-
-
- <div class="md-nav__link md-nav__container">
- <a href="../core-concepts/index.html" class="md-nav__link ">
-
-
-
- <span class="md-ellipsis">
- Core Concepts
-
- </span>
-
- </a>
-
-
- <label class="md-nav__link " for="__nav_4" id="__nav_4_label" tabindex="0">
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- </div>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
- <label class="md-nav__title" for="__nav_4">
- <span class="md-nav__icon md-icon"></span>
- Core Concepts
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/tiles.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Tiles & Tile Component
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/weighting.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Weighting
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/tile-sets.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Tile Sets
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/archetypes.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Archetypes
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/doorways.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Doorways
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/dungeon-flow.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Dungeon Flow Asset
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/flow-editor.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Flow Editor
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../core-concepts/dungeon-generator.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Dungeon Generator
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--active md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" checked>
-
-
- <div class="md-nav__link md-nav__container">
- <a href="index.html" class="md-nav__link ">
-
-
-
- <span class="md-ellipsis">
- Advanced Features
-
- </span>
-
- </a>
-
-
- <label class="md-nav__link " for="__nav_5" id="__nav_5_label" tabindex="0">
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- </div>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="true">
- <label class="md-nav__title" for="__nav_5">
- <span class="md-nav__icon md-icon"></span>
- Advanced Features
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="props-variety.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Props for Variety
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="doors.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Doors
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="multiple-floors.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Multiple Floors
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="lock-key-system.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Lock & Key System
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--active">
-
- <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
-
-
-
-
-
- <label class="md-nav__link md-nav__link--active" for="__toc">
-
-
-
- <span class="md-ellipsis">
- Injecting Special Tiles
-
- </span>
-
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- <a href="injecting-tiles.html" class="md-nav__link md-nav__link--active">
-
-
-
- <span class="md-ellipsis">
- Injecting Special Tiles
-
- </span>
-
- </a>
-
-
- <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
-
-
-
-
-
-
- <label class="md-nav__title" for="__toc">
- <span class="md-nav__icon md-icon"></span>
- Table of contents
- </label>
- <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
-
- <li class="md-nav__item">
- <a href="#method-1-tile-injection-via-inspector" class="md-nav__link">
- <span class="md-ellipsis">
- Method 1: Tile Injection via Inspector
- </span>
- </a>
-
- </li>
-
- <li class="md-nav__item">
- <a href="#method-2-tile-injection-through-code" class="md-nav__link">
- <span class="md-ellipsis">
- Method 2: Tile Injection Through Code
- </span>
- </a>
-
- <nav class="md-nav" aria-label="Method 2: Tile Injection Through Code">
- <ul class="md-nav__list">
-
- <li class="md-nav__item">
- <a href="#the-injectedtile-class" class="md-nav__link">
- <span class="md-ellipsis">
- The InjectedTile Class:
- </span>
- </a>
-
- </li>
-
- <li class="md-nav__item">
- <a href="#attaching-the-delegate" class="md-nav__link">
- <span class="md-ellipsis">
- Attaching the Delegate:
- </span>
- </a>
-
- </li>
-
- </ul>
- </nav>
-
- </li>
-
- <li class="md-nav__item">
- <a href="#when-to-use-which-method" class="md-nav__link">
- <span class="md-ellipsis">
- When to Use Which Method
- </span>
- </a>
-
- </li>
-
- </ul>
-
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="connection-rules.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Tile Connection Rules
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="attached-dungeons.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Generating Attached Dungeons
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="additional-collisions.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Avoid Collisions With the Scene
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="runtime-events.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Runtime Events & Code Execution
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="post-processing.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Custom Post-Processing
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="character-component.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- DunGen Character Component
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
-
-
- <div class="md-nav__link md-nav__container">
- <a href="../optimization/index.html" class="md-nav__link ">
-
-
-
- <span class="md-ellipsis">
- Optimization
-
- </span>
-
- </a>
-
-
- <label class="md-nav__link " for="__nav_6" id="__nav_6_label" tabindex="0">
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- </div>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
- <label class="md-nav__title" for="__nav_6">
- <span class="md-nav__icon md-icon"></span>
- Optimization
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../optimization/culling.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Built-in Culling
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../optimization/tile-pooling.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Tile Pooling
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
-
-
- <div class="md-nav__link md-nav__container">
- <a href="../pathfinding/index.html" class="md-nav__link ">
-
-
-
- <span class="md-ellipsis">
- Pathfinding
-
- </span>
-
- </a>
-
-
- <label class="md-nav__link " for="__nav_7" id="__nav_7_label" tabindex="0">
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- </div>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
- <label class="md-nav__title" for="__nav_7">
- <span class="md-nav__icon md-icon"></span>
- Pathfinding
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../pathfinding/unity-navmesh.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Unity NavMesh Components
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../pathfinding/astar-pathfinding.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- A* Pathfinding Project Pro
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../pathfinding/custom-adapters.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Custom Adapters
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
-
-
- <div class="md-nav__link md-nav__container">
- <a href="../integrations/index.html" class="md-nav__link ">
-
-
-
- <span class="md-ellipsis">
- Integrations
-
- </span>
-
- </a>
-
-
- <label class="md-nav__link " for="__nav_8" id="__nav_8_label" tabindex="0">
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- </div>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
- <label class="md-nav__title" for="__nav_8">
- <span class="md-nav__icon md-icon"></span>
- Integrations
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../integrations/sectr.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- SECTR Portal Culling
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../integrations/playmaker.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- PlayMaker Actions
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
-
-
- <div class="md-nav__link md-nav__container">
- <a href="../troubleshooting/index.html" class="md-nav__link ">
-
-
-
- <span class="md-ellipsis">
- Troubleshooting
-
- </span>
-
- </a>
-
-
- <label class="md-nav__link " for="__nav_9" id="__nav_9_label" tabindex="0">
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- </div>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
- <label class="md-nav__title" for="__nav_9">
- <span class="md-nav__icon md-icon"></span>
- Troubleshooting
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../troubleshooting/limitations.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Limitations & Considerations
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../troubleshooting/analysis.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Analysis
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item md-nav__item--nested">
-
-
-
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
-
-
- <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
-
-
-
- <span class="md-ellipsis">
- Reference
-
- </span>
-
- <span class="md-nav__icon md-icon"></span>
- </label>
-
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
- <label class="md-nav__title" for="__nav_10">
- <span class="md-nav__icon md-icon"></span>
- Reference
- </label>
- <ul class="md-nav__list" data-md-scrollfix>
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../reference/faq.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- FAQ
-
- </span>
-
- </a>
- </li>
-
-
-
-
-
-
-
-
-
- <li class="md-nav__item">
- <a href="../reference/cookbook.html" class="md-nav__link">
-
-
-
- <span class="md-ellipsis">
- Cookbook
-
- </span>
-
- </a>
- </li>
-
-
-
- </ul>
- </nav>
-
- </li>
-
-
- </ul>
- </nav>
- </div>
- </div>
- </div>
-
-
-
- <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
- <div class="md-sidebar__scrollwrap">
- <div class="md-sidebar__inner">
-
- <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
-
-
-
-
-
-
- <label class="md-nav__title" for="__toc">
- <span class="md-nav__icon md-icon"></span>
- Table of contents
- </label>
- <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
-
- <li class="md-nav__item">
- <a href="#method-1-tile-injection-via-inspector" class="md-nav__link">
- <span class="md-ellipsis">
- Method 1: Tile Injection via Inspector
- </span>
- </a>
-
- </li>
-
- <li class="md-nav__item">
- <a href="#method-2-tile-injection-through-code" class="md-nav__link">
- <span class="md-ellipsis">
- Method 2: Tile Injection Through Code
- </span>
- </a>
-
- <nav class="md-nav" aria-label="Method 2: Tile Injection Through Code">
- <ul class="md-nav__list">
-
- <li class="md-nav__item">
- <a href="#the-injectedtile-class" class="md-nav__link">
- <span class="md-ellipsis">
- The InjectedTile Class:
- </span>
- </a>
-
- </li>
-
- <li class="md-nav__item">
- <a href="#attaching-the-delegate" class="md-nav__link">
- <span class="md-ellipsis">
- Attaching the Delegate:
- </span>
- </a>
-
- </li>
-
- </ul>
- </nav>
-
- </li>
-
- <li class="md-nav__item">
- <a href="#when-to-use-which-method" class="md-nav__link">
- <span class="md-ellipsis">
- When to Use Which Method
- </span>
- </a>
-
- </li>
-
- </ul>
-
- </nav>
- </div>
- </div>
- </div>
-
-
-
- <div class="md-content" data-md-component="content">
- <article class="md-content__inner md-typeset">
-
-
- <h1 id="advanced-features-injecting-special-tiles">Advanced Features: Injecting Special Tiles</h1>
- <p>Sometimes, the standard random selection of tiles based on <a href="../core-concepts/tile-sets.html">Tile Sets</a> and <a href="../core-concepts/archetypes.html">Archetypes</a> isn't enough. You might need to guarantee that a specific type of tile (like a boss room, a unique quest location, or a special challenge room) appears in the dungeon, perhaps only once, or within a specific area.</p>
- <p>This is where <strong>Tile Injection</strong> comes in. It allows you to "inject" tiles from a specified Tile Set into the dungeon generation process, overriding the normal selection based on a set of rules you define.</p>
- <p>There are two main ways to implement Tile Injection:</p>
- <ol>
- <li><strong>Using the Inspector (Simple Rules):</strong> Configure injection rules directly on your <a href="../core-concepts/dungeon-flow.html">Dungeon Flow</a> asset for common scenarios.</li>
- <li><strong>Using Code (Complex Rules):</strong> Write custom logic to add injection rules dynamically for maximum flexibility.</li>
- </ol>
- <hr />
- <h2 id="method-1-tile-injection-via-inspector">Method 1: Tile Injection via Inspector</h2>
- <p>For straightforward injection rules based on location within the dungeon, you can configure them directly in the <strong>Special Tile Injection</strong> section of your <code>Dungeon Flow</code> asset inspector.</p>
- <ol>
- <li>Select your <code>Dungeon Flow</code> asset in the Project view.</li>
- <li>Find the <strong>Special Tile Injection</strong> foldout in the Inspector.</li>
- <li>Click <strong>"Add New Rule"</strong> to create an injection entry.</li>
- </ol>
- <p>Each rule defines conditions under which a tile from a specified Tile Set should be injected:</p>
- <ul>
- <li><strong>Tile Set (e.g., "Special Tiles"):</strong> Drag the Tile Set asset containing the tile(s) you want to inject here. When this rule triggers, DunGen will randomly select <strong>one</strong> tile from this Tile Set to place.</li>
- <li><strong>Is Required?</strong><ul>
- <li><strong>Checked:</strong> This tile <em>must</em> be successfully placed according to the rules. If DunGen fails to generate a valid dungeon layout that includes this required injection (e.g., due to restrictive placement rules or collisions), it will <strong>retry the entire dungeon generation</strong> until it succeeds.</li>
- <li><strong>Unchecked:</strong> DunGen will <em>attempt</em> to place this tile according to the rules, but if it fails (e.g., no suitable location found within the depth range), generation will continue without it.</li>
- </ul>
- <div class="admonition warning">
- <p class="admonition-title">Performance Impact</p>
- <p>Using <code>Is Required?</code> can increase generation time, especially if the placement rules (<code>Path Depth</code>, <code>Branch Depth</code>) are very narrow or if collisions are likely. Use it only when placement is absolutely essential.</p>
- </div>
- </li>
- <li><strong>Can appear on Main Path?</strong> If checked, this rule allows the tile to be injected somewhere along the main path (Start to Goal).</li>
- <li><strong>Can appear on Branch Path?</strong> If checked, this rule allows the tile to be injected somewhere along an optional branch path.</li>
- <li><strong>Locked:</strong> If checked, the entrance to this tile will be locked.</li>
- <li><strong>Lock Type:</strong> Which lock from the <code>KeyManager</code> to use.</li>
- <li><strong>Path Depth:</strong> Defines the normalized range along the <strong>main path</strong> where this injection is allowed.<ul>
- <li><code>0</code> represents the Start tile location.</li>
- <li><code>1</code> represents the Goal tile location.</li>
- <li>A range of <code>0.4</code> to <code>0.6</code> means the tile can only be injected near the middle of the main path.</li>
- </ul>
- </li>
- <li><strong>Branch Depth:</strong> (Only used if <code>Can appear on Branch Path</code> is checked) Defines the normalized range along a <strong>branch path</strong> where this injection is allowed.<ul>
- <li><code>0</code> represents the first tile of the branch (connected to the main path).</li>
- <li><code>1</code> represents the final tile (dead end) of the branch.</li>
- <li>A range of <code>0.9</code> to <code>1.0</code> means the tile can only be injected near the end of a branch.</li>
- </ul>
- </li>
- </ul>
- <p>You can add multiple rules to inject different types of special tiles under various conditions.</p>
- <hr />
- <h2 id="method-2-tile-injection-through-code">Method 2: Tile Injection Through Code</h2>
- <p>For more advanced scenarios where injection rules depend on dynamic game state, complex logic, or need more fine-grained control, you can inject tiles via code.</p>
- <p>This involves creating a method that matches the <code>TileInjectionDelegate</code> signature and adding it to the <code>TileInjectionMethods</code> list on the <code>DungeonGenerator</code> instance.</p>
- <p><strong>The Delegate Signature:</strong></p>
- <div class="language-C# highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c1">// Your method needs to match this pattern</span>
- </span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="k">void</span><span class="w"> </span><span class="nf">MyInjectionLogic</span><span class="p">(</span><span class="n">DunGen</span><span class="p">.</span><span class="n">RandomStream</span><span class="w"> </span><span class="n">randomStream</span><span class="p">,</span><span class="w"> </span><span class="k">ref</span><span class="w"> </span><span class="n">List</span><span class="o"><</span><span class="n">InjectedTile</span><span class="o">></span><span class="w"> </span><span class="n">tilesToInject</span><span class="p">);</span>
- </span></code></pre></div>
- <ul>
- <li><code>randomStream</code>: The <code>DunGen.RandomStream</code> instance used for the current dungeon generation. Use this if your injection logic needs randomness consistent with the dungeon seed.</li>
- <li><code>tilesToInject</code>: A list of <code>InjectedTile</code> objects. Your method must add new <code>InjectedTile</code> instances to this list. DunGen will then process this list during generation.</li>
- </ul>
- <hr />
- <h3 id="the-injectedtile-class">The InjectedTile Class:</h3>
- <p>You create instances of <code>InjectedTile</code> to represent the tiles you want to inject. The <code>InjectedTile</code> class has the following properties:</p>
- <ul>
- <li><strong>TileSet (<code>TileSet</code>):</strong> The TileSet to inject.</li>
- <li><strong>NormalizedPathDepth (<code>float</code>):</strong> Normalized (0-1) depth along the main path that this tile should be spawned (0 = Start, 1 = Goal).</li>
- <li><strong>NormalizedBranchDepth (<code>float</code>):</strong> (Only valid if spawned on a branch) Normalized (0-1) depth along the branch that this tile should be spawned (0 = Branch Entrance, 1 = Branch Cap)</li>
- <li><strong>IsOnMainPath (<code>bool</code>):</strong> Should this tile be spawned on the main path? If false, it will be spawned on a branch.</li>
- <li><strong>IsRequired (<code>bool</code>):</strong> If true, DunGen will regenerate the dungeon if it fails to spawn this injected tile.</li>
- <li><strong>IsLocked (<code>bool</code>):</strong> Should the entrance to this tile be locked using the <a href="lock-key-system.html">Lock & Key System</a>?</li>
- <li><strong>LockID (<code>int</code>):</strong> (Only used if <code>IsLocked</code> is true) The ID of the lock to use. This is the index of the lock found in the <code>KeyManager</code>.</li>
- </ul>
- <details class="example">
- <summary>Example Implementation</summary>
- <p>In this example, we will inject a random tile from the <code>TileSet</code> assigned to <code>MySpecialTileSet</code> onto the end of the first branch encountered after the halfway point of the main path.</p>
- <div class="language-C# highlight"><span class="filename">CustomTileInjector.cs</span><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="k">using</span><span class="w"> </span><span class="nn">UnityEngine</span><span class="p">;</span>
- </span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="k">using</span><span class="w"> </span><span class="nn">DunGen</span><span class="p">;</span>
- </span><span id="__span-1-3"><a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="k">using</span><span class="w"> </span><span class="nn">System.Collections.Generic</span><span class="p">;</span>
- </span><span id="__span-1-4"><a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a>
- </span><span id="__span-1-5"><a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="k">public</span><span class="w"> </span><span class="k">class</span><span class="w"> </span><span class="nc">CustomTileInjector</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">MonoBehaviour</span>
- </span><span id="__span-1-6"><a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="p">{</span>
- </span><span id="__span-1-7"><a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="w"> </span><span class="c1">// Assign your Runtime Dungeon Generator here</span>
- </span><span id="__span-1-8"><a id="__codelineno-1-8" name="__codelineno-1-8" href="#__codelineno-1-8"></a><span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="p">;</span>
- </span><span id="__span-1-9"><a id="__codelineno-1-9" name="__codelineno-1-9" href="#__codelineno-1-9"></a>
- </span><span id="__span-1-10"><a id="__codelineno-1-10" name="__codelineno-1-10" href="#__codelineno-1-10"></a><span class="w"> </span><span class="c1">// Assign the TileSet containing your special tile(s)</span>
- </span><span id="__span-1-11"><a id="__codelineno-1-11" name="__codelineno-1-11" href="#__codelineno-1-11"></a><span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="n">TileSet</span><span class="w"> </span><span class="n">MySpecialTileSet</span><span class="p">;</span>
- </span><span id="__span-1-12"><a id="__codelineno-1-12" name="__codelineno-1-12" href="#__codelineno-1-12"></a>
- </span><span id="__span-1-13"><a id="__codelineno-1-13" name="__codelineno-1-13" href="#__codelineno-1-13"></a>
- </span><span id="__span-1-14"><a id="__codelineno-1-14" name="__codelineno-1-14" href="#__codelineno-1-14"></a><span class="w"> </span><span class="k">private</span><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">Start</span><span class="p">()</span>
- </span><span id="__span-1-15"><a id="__codelineno-1-15" name="__codelineno-1-15" href="#__codelineno-1-15"></a><span class="w"> </span><span class="p">{</span>
- </span><span id="__span-1-16"><a id="__codelineno-1-16" name="__codelineno-1-16" href="#__codelineno-1-16"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">RuntimeDungeon</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="k">null</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="p">.</span><span class="n">Generator</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="k">null</span><span class="p">)</span>
- </span><span id="__span-1-17"><a id="__codelineno-1-17" name="__codelineno-1-17" href="#__codelineno-1-17"></a><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="p">.</span><span class="n">Generator</span><span class="p">.</span><span class="n">TileInjectionMethods</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">InjectMySpecialTile</span><span class="p">;</span>
- </span><span id="__span-1-18"><a id="__codelineno-1-18" name="__codelineno-1-18" href="#__codelineno-1-18"></a><span class="w"> </span><span class="k">else</span>
- </span><span id="__span-1-19"><a id="__codelineno-1-19" name="__codelineno-1-19" href="#__codelineno-1-19"></a><span class="w"> </span><span class="n">Debug</span><span class="p">.</span><span class="n">LogError</span><span class="p">(</span><span class="s">"RuntimeDungeon or its Generator is not assigned"</span><span class="p">);</span>
- </span><span id="__span-1-20"><a id="__codelineno-1-20" name="__codelineno-1-20" href="#__codelineno-1-20"></a><span class="w"> </span><span class="p">}</span>
- </span><span id="__span-1-21"><a id="__codelineno-1-21" name="__codelineno-1-21" href="#__codelineno-1-21"></a>
- </span><span id="__span-1-22"><a id="__codelineno-1-22" name="__codelineno-1-22" href="#__codelineno-1-22"></a><span class="w"> </span><span class="c1">// This method matches the TileInjectionDelegate</span>
- </span><span id="__span-1-23"><a id="__codelineno-1-23" name="__codelineno-1-23" href="#__codelineno-1-23"></a><span class="w"> </span><span class="k">private</span><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">InjectMySpecialTile</span><span class="p">(</span><span class="n">RandomStream</span><span class="w"> </span><span class="n">randomStream</span><span class="p">,</span><span class="w"> </span><span class="k">ref</span><span class="w"> </span><span class="n">List</span><span class="o"><</span><span class="n">InjectedTile</span><span class="o">></span><span class="w"> </span><span class="n">tilesToInject</span><span class="p">)</span>
- </span><span id="__span-1-24"><a id="__codelineno-1-24" name="__codelineno-1-24" href="#__codelineno-1-24"></a><span class="w"> </span><span class="p">{</span>
- </span><span id="__span-1-25"><a id="__codelineno-1-25" name="__codelineno-1-25" href="#__codelineno-1-25"></a><span class="w"> </span><span class="c1">// Define the injection parameters</span>
- </span><span id="__span-1-26"><a id="__codelineno-1-26" name="__codelineno-1-26" href="#__codelineno-1-26"></a><span class="w"> </span><span class="kt">bool</span><span class="w"> </span><span class="n">tryOnMainPath</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">false</span><span class="p">;</span><span class="w"> </span><span class="c1">// Let's target a branch path in this example</span>
- </span><span id="__span-1-27"><a id="__codelineno-1-27" name="__codelineno-1-27" href="#__codelineno-1-27"></a><span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">targetPathDepth</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.5f</span><span class="p">;</span><span class="w"> </span><span class="c1">// We want this to spawn at the halfway point of the main path</span>
- </span><span id="__span-1-28"><a id="__codelineno-1-28" name="__codelineno-1-28" href="#__codelineno-1-28"></a><span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">targetBranchDepth</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.0f</span><span class="p">;</span><span class="w"> </span><span class="c1">// Target the very end of the branch</span>
- </span><span id="__span-1-29"><a id="__codelineno-1-29" name="__codelineno-1-29" href="#__codelineno-1-29"></a><span class="w"> </span><span class="kt">bool</span><span class="w"> </span><span class="n">mustBePlaced</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">false</span><span class="p">;</span><span class="w"> </span><span class="c1">// It's okay if this tile isn't placed</span>
- </span><span id="__span-1-30"><a id="__codelineno-1-30" name="__codelineno-1-30" href="#__codelineno-1-30"></a>
- </span><span id="__span-1-31"><a id="__codelineno-1-31" name="__codelineno-1-31" href="#__codelineno-1-31"></a><span class="w"> </span><span class="kt">var</span><span class="w"> </span><span class="n">tileToInject</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">InjectedTile</span><span class="p">(</span><span class="n">MySpecialTileSet</span><span class="p">,</span><span class="w"> </span><span class="n">tryOnMainPath</span><span class="p">,</span><span class="w"> </span><span class="n">targetPathDepth</span><span class="p">,</span><span class="w"> </span><span class="n">targetBranchDepth</span><span class="p">,</span><span class="w"> </span><span class="n">mustBePlaced</span><span class="p">);</span>
- </span><span id="__span-1-32"><a id="__codelineno-1-32" name="__codelineno-1-32" href="#__codelineno-1-32"></a>
- </span><span id="__span-1-33"><a id="__codelineno-1-33" name="__codelineno-1-33" href="#__codelineno-1-33"></a><span class="w"> </span><span class="c1">// Add it to the list DunGen will process</span>
- </span><span id="__span-1-34"><a id="__codelineno-1-34" name="__codelineno-1-34" href="#__codelineno-1-34"></a><span class="w"> </span><span class="n">tilesToInject</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="n">tileToInject</span><span class="p">);</span>
- </span><span id="__span-1-35"><a id="__codelineno-1-35" name="__codelineno-1-35" href="#__codelineno-1-35"></a><span class="w"> </span><span class="p">}</span>
- </span><span id="__span-1-36"><a id="__codelineno-1-36" name="__codelineno-1-36" href="#__codelineno-1-36"></a>
- </span><span id="__span-1-37"><a id="__codelineno-1-37" name="__codelineno-1-37" href="#__codelineno-1-37"></a><span class="w"> </span><span class="c1">// Unsubscribe when the object is destroyed</span>
- </span><span id="__span-1-38"><a id="__codelineno-1-38" name="__codelineno-1-38" href="#__codelineno-1-38"></a><span class="w"> </span><span class="k">private</span><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">OnDestroy</span><span class="p">()</span>
- </span><span id="__span-1-39"><a id="__codelineno-1-39" name="__codelineno-1-39" href="#__codelineno-1-39"></a><span class="w"> </span><span class="p">{</span>
- </span><span id="__span-1-40"><a id="__codelineno-1-40" name="__codelineno-1-40" href="#__codelineno-1-40"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">RuntimeDungeon</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="k">null</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="p">.</span><span class="n">Generator</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="k">null</span><span class="p">)</span>
- </span><span id="__span-1-41"><a id="__codelineno-1-41" name="__codelineno-1-41" href="#__codelineno-1-41"></a><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="p">.</span><span class="n">Generator</span><span class="p">.</span><span class="n">TileInjectionMethods</span><span class="w"> </span><span class="o">-=</span><span class="w"> </span><span class="n">InjectMySpecialTile</span><span class="p">;</span>
- </span><span id="__span-1-42"><a id="__codelineno-1-42" name="__codelineno-1-42" href="#__codelineno-1-42"></a><span class="w"> </span><span class="p">}</span>
- </span><span id="__span-1-43"><a id="__codelineno-1-43" name="__codelineno-1-43" href="#__codelineno-1-43"></a><span class="p">}</span>
- </span></code></pre></div>
- </details>
- <h3 id="attaching-the-delegate">Attaching the Delegate:</h3>
- <p>You typically add your custom injection method to the <code>TileInjectionMethods</code> list before generation begins, often in a <code>Start()</code> or <code>Awake()</code> method after getting a reference to the <code>DungeonGenerator</code>. Remember to unsubscribe (-=) in <code>OnDestroy()</code> or <code>OnDisable()</code> to prevent issues if the generator object persists longer than your injector script.</p>
- <hr />
- <h2 id="when-to-use-which-method">When to Use Which Method</h2>
- <ul>
- <li>
- <p><strong>Inspector:</strong> Best for simple, static rules based purely on placement depth (main/branch path ranges) and whether the tile is required. Easy to set up and manage without code.</p>
- </li>
- <li>
- <p><strong>Code:</strong> Necessary when injection logic is complex, depends on external factors (game state, player progress), requires dynamic calculation of placement, or needs to inject multiple different tiles based on intricate conditions. Offers ultimate flexibility but requires scripting knowledge.</p>
- </li>
- </ul>
- <p>Tile Injection is a powerful tool for adding specific, authored moments or structures within your otherwise randomized dungeons.</p>
-
- </article>
- </div>
-
-
- <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
- <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
- </div>
-
- <button type="button" class="md-top md-icon" data-md-component="top" hidden>
-
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
- Back to top
- </button>
-
- </main>
-
- <footer class="md-footer">
-
-
-
- <nav class="md-footer__inner md-grid" aria-label="Footer" >
-
-
- <a href="lock-key-system.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: Lock & Key System">
- <div class="md-footer__button md-icon">
-
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
- </div>
- <div class="md-footer__title">
- <span class="md-footer__direction">
- Previous
- </span>
- <div class="md-ellipsis">
- Lock & Key System
- </div>
- </div>
- </a>
-
-
-
- <a href="connection-rules.html" class="md-footer__link md-footer__link--next" aria-label="Next: Tile Connection Rules">
- <div class="md-footer__title">
- <span class="md-footer__direction">
- Next
- </span>
- <div class="md-ellipsis">
- Tile Connection Rules
- </div>
- </div>
- <div class="md-footer__button md-icon">
-
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg>
- </div>
- </a>
-
- </nav>
-
-
- <div class="md-footer-meta md-typeset">
- <div class="md-footer-meta__inner md-grid">
- <div class="md-copyright">
-
- <div class="md-copyright__highlight">
- Copyright © Aegon Games Ltd.
- </div>
-
-
- Made with
- <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
- Material for MkDocs
- </a>
-
- </div>
-
- </div>
- </div>
- </footer>
-
- </div>
- <div class="md-dialog" data-md-component="dialog">
- <div class="md-dialog__inner md-typeset"></div>
- </div>
-
-
-
-
- <script id="__config" type="application/json">{"base": "..", "features": ["content.code.annotate", "content.code.copy", "content.tabs.link", "announce.dismiss", "header.autohide", "navigation.footer", "navigation.indexes", "navigation.top", "navigation.tracking"], "search": "../assets/javascripts/workers/search.f8cc74c7.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
-
-
- <script src="../assets/javascripts/bundle.c8b220af.min.js"></script>
-
-
- </body>
- </html>
|