RPTools.net

Discussion and Support

Skip to content

It is currently Sat Dec 16, 2017 3:52 pm 




Forum rules


Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)



Reply to topic  [ 3 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7968
Location: Bay Area
 Post subject: [ADD ON] D20 Light
PostPosted: Sat Nov 10, 2012 10:07 pm 
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.
  • Code:
    @@ @<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)]

    !!
     

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:
[H: abort(isGM())]

This will prevent non-GMs from running the macro.

keywords: amsave light


D20 Light 1.rptok [10.93 KiB]
Downloaded 146 times
light lantern small.png
light lantern small.png [ 3.48 KiB | Viewed 1688 times ]

_________________
Downloads:
Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Dec 22, 2007 5:37 pm
Posts: 358
 Post subject: Re: [ADD ON] D20 Light
PostPosted: Fri Nov 16, 2012 2:11 pm 
Thank you for sharing!


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Mon May 31, 2010 6:03 am
Posts: 515
Location: Blagnac, France
 Post subject: Re: [ADD ON] D20 Light
PostPosted: Sat Nov 17, 2012 5:40 am 
Ditto :wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman