I created this script to create a terrain or effect underneath a targeted token / character. It is suppose to serve 2 purposes: 1) Set up rough terrain obstacles long before the players go to this 2) Have an npc drop terrain effects as they move An example of situation #2 goes like this: have an NPC like a kobold spill grease on the ground as he moves. Next turn have him spawn "fire" with this command, right next to the grease. All the grease catches fire and the NPCs can use all sorts of other terrain effects / obstacles to funnel the party where they want them to go. Here's the script: /* createTerain v0.71
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|character_id}
!create ash @{selected|character_id}
!create balls @{selected|character_id}
!create bramble @{selected|character_id}
!create branches @{selected|character_id}
!create blood @{selected|character_id}
!create caltrops @{selected|character_id}
!create coral @{selected|character_id}
!create fire @{selected|character_id}
!create foam @{selected|character_id}
!create gas @{selected|character_id}
!create glass @{selected|character_id}
!create glue @{selected|character_id}
!create grease @{selected|character_id}
!create ice @{selected|character_id}
!create lava @{selected|character_id}
!create marbles @{selected|character_id}
!create marsh @{selected|character_id}
!create mud @{selected|character_id}
!create rocks @{selected|character_id}
!create sand @{selected|character_id}
!create shock @{selected|character_id}
!create shrub @{selected|character_id}
!create smoke @{selected|character_id}
!create snow @{selected|character_id}
!create water @{selected|character_id}
!create web @{selected|character_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>",
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>",
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>",
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>",
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>",
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("-=> Create Terrain Script Loaded - (Last Edited by Kastion [02/06/2018]) <=-");
on('chat:message', function(msg) {
if (msg.type == "api" && playerIsGM(msg.playerid) && msg.content.indexOf("!create") !== -1) {
var terrain = msg.content.split(' ')[1];
var charid = msg.content.split(' ')[2];
var c = getObj('character',charid);
var t = findObjs({
_type: 'graphic',
represents: charid
})[0];
if(c) {
if (eval(terrain + "_imgsrc")) {
createObj("graphic", {
_pageid: t.get('_pageid'),
layer: "objects",
imgsrc: eval(terrain + "_imgsrc"),
width: 70,
height: 70,
top: t.get('top'),
left: t.get('left'),
name: terrain
});
} else {
sendChat('Create Terrain', '/w gm Incorrect terrain type specified. Types: acid, ash, balls, bramble, branches, blood, caltrops, coral, foam, fire, gas, glass, glue, grease, 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 suggestions or ideas for new terrain or elemental effects of sort let me know and I'll try to add them to the function.