Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] !createTerrain (UPDATE - 2nd Thread)

When I had initially created !createTerrain I had it require a character to drop the terrain below. In hindsight this was really unnecessary as all I need was the top/left of a token to know where to spawn the terrain. Here is a sample of the kind of terrains you can use and easily add more to. This is what the default script comes with: Here is the updated script that abolishes the need for a character and only now requires a token: /* createTerain Obstacle v1.2.1 By: Kastion Profile: <a href="https://app.roll20.net/users/3173313/kastion" rel="nofollow">https://app.roll20.net/users/3173313/kastion</a> --------------------------------------------------------- Create Obstacles / Elements Commands: --------------------------------------------------------- !create acid @{selected|token_id} !create ash @{selected|token_id} !create balls @{selected|token_id} !create blood @{selected|token_id} !create bramble @{selected|token_id} !create branches @{selected|token_id} !create burning @{selected|token_id} !create caltrops @{selected|token_id} !create coral @{selected|token_id} !create crack @{selected|token_id} !create crack2 @{selected|token_id} !create fire @{selected|token_id} !create foam @{selected|token_id} !create gas @{selected|token_id} !create glass @{selected|token_id} !create glue @{selected|token_id} !create grease @{selected|token_id !create gunpowder @{selected|token_id !create hole @{selected|token_id} !create ice @{selected|token_id} !create lava @{selected|token_id} !create marbles @{selected|token_id} !create marsh @{selected|token_id} !create mud @{selected|token_id} !create rocks @{selected|token_id} !create sand @{selected|token_id} !create shock @{selected|token_id} !create shrub @{selected|token_id} !create smoke @{selected|token_id} !create snow @{selected|token_id} !create water @{selected|token_id} !create web @{selected|token_id} */ var acid_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53695993/aLrdNuNBK_h23Do3k8RhEw/thumb.png?15260525125#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53695993/aLrdNuNBK_h23Do3k8RhEw/thumb.png?15260525125#.png</a>", ash_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55185107/4CgV7CuVU1uqPr9MWv290w/thumb.png?15279373045#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55185107/4CgV7CuVU1uqPr9MWv290w/thumb.png?15279373045#.png</a>", balls_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53683250/A3Z7szxzwhLulTNjvbxgBw/thumb.png?15260322965#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53683250/A3Z7szxzwhLulTNjvbxgBw/thumb.png?15260322965#.png</a>", blood_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53051008/Vno5kc8_em0yquxXltwbyQ/thumb.png?15251824175#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53051008/Vno5kc8_em0yquxXltwbyQ/thumb.png?15251824175#.png</a>", bramble_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55180902/0KS_rodI24Rh1RK97iuMgQ/thumb.png?15279287585#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55180902/0KS_rodI24Rh1RK97iuMgQ/thumb.png?15279287585#.png</a>", branches_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55185590/jpy0PDgpqncCzSBEV6FNsg/thumb.png?15279383345#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55185590/jpy0PDgpqncCzSBEV6FNsg/thumb.png?15279383345#.png</a>", burning_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/57889084/2vqyIrc35_2-5maf7kjIHA/thumb.png?15311839555#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/57889084/2vqyIrc35_2-5maf7kjIHA/thumb.png?15311839555#.png</a>", caltrops_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53524631/XAVdLxigZ12Z7FWOF_ZGww/thumb.png?15258058995#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53524631/XAVdLxigZ12Z7FWOF_ZGww/thumb.png?15258058995#.png</a>", coral_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55181488/tUBdPWQSPY39PPwfDggXDA/thumb.png?15279297745#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55181488/tUBdPWQSPY39PPwfDggXDA/thumb.png?15279297745#.png</a>", crack_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/57888916/tFQzuE7lnYGzNzInuU4pHw/thumb.png?15311837495#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/57888916/tFQzuE7lnYGzNzInuU4pHw/thumb.png?15311837495#.png</a>", crack2_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/57889557/iRya1sNagT2860w06RZRtQ/thumb.png?15311844425#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/57889557/iRya1sNagT2860w06RZRtQ/thumb.png?15311844425#.png</a>", fire_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53533619/ZbnZ992UHoJUQW2_KQJtiQ/thumb.png?15258157335#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53533619/ZbnZ992UHoJUQW2_KQJtiQ/thumb.png?15258157335#.png</a>", foam_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53695879/meu5NplQDGv3BeQThSOtEQ/thumb.png?15260522785#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53695879/meu5NplQDGv3BeQThSOtEQ/thumb.png?15260522785#.png</a>", gas_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55180737/mtxBaSuTdCbmNiTP_kEpqw/thumb.png?15279283675#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55180737/mtxBaSuTdCbmNiTP_kEpqw/thumb.png?15279283675#.png</a>", glass_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55185020/uyXWIPk86rhCWzXmumb4JA/thumb.png?15279371335#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55185020/uyXWIPk86rhCWzXmumb4JA/thumb.png?15279371335#.png</a>", glue_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53680978/dgB-IwYWgVEPKH8ERWZZYA/thumb.png?15260254695#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53680978/dgB-IwYWgVEPKH8ERWZZYA/thumb.png?15260254695#.png</a>", grease_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53682542/9ORQuNsS4yyhOpqxIfC4PQ/thumb.png?15260305355#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53682542/9ORQuNsS4yyhOpqxIfC4PQ/thumb.png?15260305355#.png</a>", gunpowder = "<a href="https://s3.amazonaws.com/files.d20.io/images/58130297/vRLQyWYQlHtYonj84PBB-Q/thumb.png?15314914965#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/58130297/vRLQyWYQlHtYonj84PBB-Q/thumb.png?15314914965#.png</a>", hole_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/57888591/1CA-3EKcfrsK7ddO--jh8g/thumb.png?15311834635#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/57888591/1CA-3EKcfrsK7ddO--jh8g/thumb.png?15311834635#.png</a>", ice_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53681599/Kn3UtkSE0gCgP6lKsOZRBg/thumb.png?15260276215#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53681599/Kn3UtkSE0gCgP6lKsOZRBg/thumb.png?15260276215#.png</a>", lava_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55180820/pSMl60oodiCtuRdWzJgzfA/thumb.png?15279285465#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55180820/pSMl60oodiCtuRdWzJgzfA/thumb.png?15279285465#.png</a>", marbles_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53682724/fMJvZqsUxeKUIm6GYYwSJQ/thumb.png?15260308385#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53682724/fMJvZqsUxeKUIm6GYYwSJQ/thumb.png?15260308385#.png</a>", marsh_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55181384/RbK_06n4FU4INd1f6ERxHw/thumb.png?15279295415#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55181384/RbK_06n4FU4INd1f6ERxHw/thumb.png?15279295415#.png</a>", mud_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55181722/hQ4SH17XauqJ-Uh3p96cKg/thumb.png?15279303345#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55181722/hQ4SH17XauqJ-Uh3p96cKg/thumb.png?15279303345#.png</a>", rocks_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53683086/t2AzEXFgS_3l9R6B-4vSRQ/thumb.png?15260318295#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53683086/t2AzEXFgS_3l9R6B-4vSRQ/thumb.png?15260318295#.png</a>", sand_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55181261/VWFZCLR5X53mqxehWQ0c5A/thumb.png?15279292895#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55181261/VWFZCLR5X53mqxehWQ0c5A/thumb.png?15279292895#.png</a>", shock_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53696347/8nn5PAtnHRLnteijUkENeA/thumb.png?15260531935#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53696347/8nn5PAtnHRLnteijUkENeA/thumb.png?15260531935#.png</a>", shrub_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55185658/nOOZ-UqN7991kP6G9_43Qg/thumb.png?15279384705#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55185658/nOOZ-UqN7991kP6G9_43Qg/thumb.png?15279384705#.png</a>", smoke_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53535877/cU_ESc0V25nr9YZyyGgJ6Q/thumb.png?15258182285#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53535877/cU_ESc0V25nr9YZyyGgJ6Q/thumb.png?15258182285#.png</a>", snow_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55181536/xPwWZ3TcLOPbIdh6DZ2k4g/thumb.png?15279299175#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55181536/xPwWZ3TcLOPbIdh6DZ2k4g/thumb.png?15279299175#.png</a>", water_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/53682782/VAEqPyecgXkYYCby4SmydA/thumb.png?15260309965#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53682782/VAEqPyecgXkYYCby4SmydA/thumb.png?15260309965#.png</a>", web_imgsrc = "<a href="https://s3.amazonaws.com/files.d20.io/images/55185406/dQ3z9PIEQujaKvs8PfuIkg/thumb.png?15279378895#.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55185406/dQ3z9PIEQujaKvs8PfuIkg/thumb.png?15279378895#.png</a>"; on('ready', function() { log("-=&gt; Create Terrain Script Loaded - (v1.2.1 - Last Edited by Kastion [July 13th 2018]) &lt;=-"); on('chat:message', function(msg) { //use !caltrops @{selected|token_id} to set drop caltrops on tokens location. if (msg.type == "api" &amp;&amp; msg.content.indexOf("!create") !== -1) { var terrain = msg.content.split(' ')[1]; var tokenid = msg.content.split(' ')[2]; var c = getObj('graphic',tokenid); if(c) { if (eval(terrain + "_imgsrc")) { var obj = createObj("graphic", { _pageid: c.get('_pageid'), layer: "objects", imgsrc: eval(terrain + "_imgsrc"), width: 70, height: 70, top: c.get('top'), left: c.get('left'), name: terrain }); toFront(obj); toFront(c); } else { sendChat('Create Terrain', '/w gm Incorrect terrain type specified. Types: acid, ash, balls, bramble, branches, blood, caltrops, coral, crack, foam, fire, gas, glass, glue, grease, hole, ice, lava, marbles, marsh, mud, rocks, sand, shock, shrub, smoke, snow, water, web'); } } else { sendChat('Create Terrain', '/w gm Player / Token error or unspecified.'); } } }) }); If you have any problems with the script or have suggestions for additional functionality to the script please let me know.
Just wanted to add that this command is best used with other API scripts. One of the things you can do just by itself though his have an NPC / Monster drop caltrops while running away or set strategic fire. This script works great with !token-mod and the !delay script I wrote. I'll post some examples of the synergy with other scripts shortly.