[ADD ON] D20 Light

Discussion concerning lmarkus' campaign framework for D&D3.x and Pathfinder.

Moderators: Azhrei, dorpond, trevor, giliath, Gamerdude, jay, Mr.Ice, lmarkus001

Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)
Post Reply
User avatar
aliasmask
Deity
Posts: 8578
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

[ADD ON] D20 Light

Post by aliasmask »

The idea is to quickly get a light that can be manipulated by the PCs and put it on the current map. Either during map design or on-the-fly.

This could be adapted for really any "type" of light (see Wiki: setLight()), but this one is specific to this framework and the lights under the D20 category.

The token contains an image of a lantern and has two macros on it. It is also owned by all and is not snapped to grid and tiny. You can put this token on your summon map or manually drag from library or cut/paste from another map.

Macros:
  • Set D20 Light - You chose which light source from your campaign lights in the D20 light type to be put on token (default Lamp - 15). Also set the light state to on or off.
  • Toggle D20 Light - This will switch the light on and off.
  • [spoiler=||| MACROS |||]

    Code: Select all

    @@ @<b>Toggle D20 Light</b>
    [
    H: lightState = 1 - getProperty("lightState")]
    [
    H: lightName = getProperty("lightName")]
    [
    H: setProperty("lightState",lightState)]
    [
    H: setLight("D20",lightName,lightState)]

    !!
    @@
     @Set D20 Light
    [H: D20Lights = json.get(json.get(getInfo("campaign"),"light sources"),"D20")]
    [
    H: D20Lights = json.sort(D20Lights,"a","name")]
    [
    H: lights = ""]
    [
    H: lightNames = ""]
    [
    H, foreach(light,D20Lights), code: {
       [H: rawName = json.get(light,"name")]
       [H: selectName = replace(rawName,"[^a-zA-Z0-9 ]","")]
       [H: lightNames = json.append(lightNames,rawName)]
       [H: lights = listAppend(lights,selectName)]
    }]
    [
    H: activeLight = getProperty("lightName")]
    [
    H: lightState = "0"+getProperty("lightState")]
    [
    H: select = json.indexOf(lightNames,activeLight)]
    [
    H: abort(input("lightIndex|"+lights+"|Select Light|LIST|SELECT="+select,"lightState|OFF,ON||RADIO|SPAN=TRUE ORIENT=H SELECT="+lightState))]
    [
    H: lightName = json.get(lightNames,lightIndex)]
    [
    H: setProperty("lightName",lightName)]
    [
    H: setProperty("lightState",lightState)]
    [
    H: setLight("D20",lightName,lightState)]

    !!
     
    [/spoiler]

If you don't want the PCs to use, just uncheck ownership for all players. You can change the image as you would any other token to represent your light source. If you don't want the PCs changing the light type you can add this line to the beginning of Set D20 Light:

Code: Select all

[H: abort(isGM())]

This will prevent non-GMs from running the macro.

keywords: amsave light
Attachments
D20 Light 1.rptok
(10.93 KiB) Downloaded 174 times
light lantern small.png
light lantern small.png (3.48 KiB) Viewed 2566 times

Elorebaen
Dragon
Posts: 364
Joined: Sat Dec 22, 2007 5:37 pm

Re: [ADD ON] D20 Light

Post by Elorebaen »

Thank you for sharing!

User avatar
JML
Dragon
Posts: 515
Joined: Mon May 31, 2010 7:03 am
Location: Blagnac, France

Re: [ADD ON] D20 Light

Post by JML »

Ditto :wink:

Post Reply

Return to “[D&D3.5 + Pathfinder] Campaign Macros”