Light vision Illumination Generator Tool (Excel)

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Light vision Illumination

Post by wolph42 »

Crusufix wrote:This is very cool, unfortunately I don't see your attached XLS sheet, which is a shame cause I'd like to get this to work for other colours as well.
hmm good point, I'm sure I attached it... here is it again. I don't know if it will work in google docs due to the HEX2DEC and DEC2HEX functions I use (for which you need the Excel Analysis Tool Pack, or build them yourself...).

Note the sheet contains a lot more then just the auras/light stuff but it all in the sheet auras.

ahhh I quote:
The extension xls is not allowed.
I must have missed that the last time and just clicked it away.

Edit: Sheet in next post works without analysis toolpack as well.
Attachments
table2MTxml v1.0 TABLE EDITING 10 and lots more.xls.zip
(195.34 KiB) Downloaded 131 times
Last edited by wolph42 on Fri Nov 13, 2009 4:43 am, edited 1 time in total.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Light vision Illumination

Post by wolph42 »

Ok I've updated the GoogleDoc now it works:

Humbly submitting the Light Source Gradient calculator 8) :
http://spreadsheets.google.com/ccc?key= ... VeHc&hl=en

Attached is an excelsheet that should work with open office as well.

Edit: just for the fun of it, the Hex2Dec function written in excel lingo looks like this:
easy pickle

Code: Select all

=IF(ISERROR(INT((MID($D4,1,1)))),INT(CODE(MID($D4,1,1))-87),MID($D4,1,1))*16^5+IF(ISERROR(INT((MID($D4,2,1)))),INT(CODE(MID($D4,2,1))-87),MID($D4,2,1))*16^4+IF(ISERROR(INT((MID($D4,3,1)))),INT(CODE(MID($D4,3,1))-87),MID($D4,3,1))*16^3+IF(ISERROR(INT((MID($D4,4,1)))),INT(CODE(MID($D4,4,1))-87),MID($D4,4,1))*16^2+IF(ISERROR(INT((MID($D4,5,1)))),INT(CODE(MID($D4,5,1))-87),MID($D4,5,1))*16^1+IF(ISERROR(INT((MID($D4,6,1)))),INT(CODE(MID($D4,6,1))-87),MID($D4,6,1))
And that was the easy one, the other way round (Dec2Hex) was the real pickle.
Attachments
auras.zip
(22 Bytes) Downloaded 87 times

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Re: Light vision Illumination

Post by trevor »

Very awesome.

I'm always amazed what you all come up with !
Dreaming of a 1.3 release

User avatar
lmarkus001
Great Wyrm
Posts: 1867
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Re: Light vision Illumination

Post by lmarkus001 »

Very cool, thanks!

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Light vision Illumination

Post by wolph42 »

you're welcome, maybe you want to sticky this as well?
Or shall I update the other sticky post of me with this?

User avatar
CyrusStonecypher
Giant
Posts: 158
Joined: Thu Nov 26, 2009 1:22 am
Location: Columbus, IN, U.S.A.

Re: Light vision Illumination Generator Tool (Excel)

Post by CyrusStonecypher »

This looks pretty sweet! I'm looking for way to display threat range for a barbarian lugging around an oversized greatsword that gives her a 10' threat range.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Light vision Illumination Generator Tool (Excel)

Post by wolph42 »

CyrusStonecypher wrote:This looks pretty sweet! I'm looking for way to display threat range for a barbarian lugging around an oversized greatsword that gives her a 10' threat range.
Well.. You've found you're way :-)

User avatar
bmcoomes
Kobold
Posts: 23
Joined: Wed Jan 27, 2010 9:27 pm
Location: Ephrata, WA

Re: Light vision Illumination Generator Tool (Excel)

Post by bmcoomes »

I've ran with this idea and applied it to SR4 but I'm needing help to update the macro. I'm looking for something like Wolph42's but with a pull down maybe selecting the weapon type.

Thanks,
Brent
Firearm Ranges

Code: Select all

Automatics
----
Assault Rifle Long : aura cone arc=45 350#ff0000 
SMG Medium : aura cone arc=45 40#aa0000 
Machine Pistol Extreme : aura cone arc=45 50#800000 
SMG Extreme : aura cone arc=45 150#800000 
Assault Rifle Short : aura cone arc=45 50#cc0000 
SMG Long : aura cone arc=45 80#ff0000 
SMG Short : aura cone arc=45 10#cc0000 
Machine Pistol Long : aura cone arc=45 30#ff0000 
Assault Rifle Medium : aura cone arc=45 150#aa0000 
Assault Rifle Extreme : aura cone arc=45 550#800000 
Machine Pistol Short : aura cone arc=45 5#cc0000 
Machine Pistol Medium : aura cone arc=45 15#aa0000 

Heavy Weapons
----
MMG Extreme : aura cone arc=45 1,200#800000 
MMG Long : aura cone arc=45 750#ff0000 
LMG Medium : aura cone arc=45 200#aa0000 
HMG Extreme : aura cone arc=45 1,200#800000 
HMG Long : aura cone arc=45 750#ff0000 
Assault Cannon Extreme : aura cone arc=45 1,500#800000 
Assault Cannon Medium : aura cone arc=45 300#aa0000 
HMG Short : aura cone arc=45 80#cc0000 
Assault Cannon Long : aura cone arc=45 750#ff0000 
LMG Short : aura cone arc=45 75#cc0000 
HMG Medium : aura cone arc=45 250#aa0000 
Assault Cannon Short : aura cone arc=45 100#cc0000 
LMG Extreme : aura cone arc=45 800#800000 
MMG Short : aura cone arc=45 80#cc0000 
LMG Long : aura cone arc=45 400#ff0000 
MMG Medium : aura cone arc=45 250#aa0000 

Pistol Ranges
----
Light Pistol Medium : aura cone arc=45 15#aa0000 
Taser Extreme : aura cone arc=45 20#800000 
Heavy Pistol Extreme : aura cone arc=45 60#800000 
Light Pistol Short : aura cone arc=45 5#cc0000 
Taser Medium : aura cone arc=45 10#aa0000 
Heavy Pistol Medium : aura cone arc=45 20#aa0000 
Hold-out Long : aura cone arc=45 30#ff0000 
Light Pistol Long : aura cone arc=45 30#ff0000 
Heavy Pistol Short : aura cone arc=45 5#cc0000 
Ligh Pistol Extreme : aura cone arc=45 50#800000 
Taser Long : aura cone arc=45 15#ff0000 
Hold-out Short : aura cone arc=45 5#cc0000 
Taser Short : aura cone arc=45 5#cc0000 
Heavy Pistol Long : aura cone arc=45 40#ff0000 
Hold-out Extreme : aura cone arc=45 50#800000 
Hold-out Medium : aura cone arc=45 15#aa0000 

Longarms
----
Shotgun (Slug) Long : aura cone arc=45 80#ff0000 
Sporting Rifle Short : aura cone arc=45 100#cc0000 
Shotgun (Flechette) Extreme : aura cone arc=45 60#800000 
Sniper Rifle Extreme : aura cone arc=45 1,500#800000 
Shotgun (Flechette) Medium : aura cone arc=45 25#aa0000 
Shotgun (Slug) Extreme : aura cone arc=45 150#800000 
Sporting Rifle Long : aura cone arc=45 500#ff0000 
Sporting Rifle Medium : aura cone arc=45 250#aa0000 
Sniper Rifle Short : aura cone arc=45 150#cc0000 
Sporting Rifle Extreme : aura cone arc=45 750#800000 
Sniper Rifle Medium : aura cone arc=45 350#aa0000 
Shotgun (Slug) Short : aura cone arc=45 10#cc0000 
Shotgun (Slug) Medium : aura cone arc=45 40#aa0000 
Shotgun (Flechette) Short : aura cone arc=45 10#cc0000 
Sniper Rifle Long : aura cone arc=45 800#ff0000 
Shotgun (Flechette) Long : aura cone arc=45 40#ff0000 
Wolph42's Toggle Range

Code: Select all

[h:Range = json.get(PrimaryWeapon, "Range")]
[r,if(Range=="" || Range==0):"Doesn't carry ranged weapon";"Range = "+Range]<br>
[h, if(hasLightSource("Ranges", "Range "+Range)), CODE:{
   [h: setLight("Ranges", "Range "+Range, 0)]
   [h: setLight("Ranges", "Range "+Range+"s", 0)]
   [h: setLight("Ranges", "Range "+Range+"l", 0)]
   };{
   [h: setLight("Ranges", "Range "+Range, 1)]
   [h: setLight("Ranges", "Range "+Range+"s", 1)]
   [h: setLight("Ranges", "Range "+Range+"l", 1)]
}]

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Light vision Illumination Generator Tool (Excel)

Post by wolph42 »

That doesn't sound too hard. What you need first is to build a json object library of your weapons.

Code: Select all

[h:newWeaponName = "Shotgun"]
[h:newWeaponObject = json.set("{}", "Category","Ranged", "Group","Solid Projectile", "Class","Basic", "Range",30, "SingleShot",1, "SemiBurst",0, "FullBurst",0, "WpnDamDice",1, "WpnDamDiceType",10, "WpnDamMod",4, "DamType","Impact", "Penetration",0,"Clip",0,"ClipSize",2,"NumClips",0, "ClipType","-","RldTime","2 Full", "TwoHanded",1, "Special","Reliable, Scatter", "Weight",5, "Cost",60, "Availability","Common", "Page",133, "Source","Dark Heresy")]
[h:WeaponLibrary= json.set(WeaponLibrary,newWeaponName,newWeaponObject)]

[h:newWeaponName = "Hand Bow"]
[h:newWeaponObject = json.set("{}", "Category","Ranged", "Group","Primitive", "Class","Pistol", "Range",15, "SingleShot",1, "SemiBurst",0, "FullBurst",0, "WpnDamDice",1, "WpnDamDiceType",10, "WpnDamMod",2, "DamType","Impact", "Penetration",0,"Clip",0,"ClipSize",1,"NumClips",0, "ClipType","-","RldTime","1 Full", "TwoHanded",0, "Special","Primitive, ", "Weight",1, "Cost",200, "Availability","Rare", "Page",135, "Source","Dark Heresy")]
[h:WeaponLibrary= json.set(WeaponLibrary,newWeaponName,newWeaponObject)]

etc.
Then you can use json.fields function to create a weapon list from the library:

Code: Select all

wpnList = json.fields(WeaponLibrary)
, this list you can feed into an input function:

Code: Select all

[h:status=input("whichWpn|"+wpnList+"|Choose Weapon to Display|LIST|SELECT=0")]
[h:abort(status)]
Then retrieve the details from the json object of the weapon

Code: Select all

primaryWeapon = json.get(WeaponLibrary,whichWpn)
Finally you need to adjust my code you're referring at a bit, change the "l" and "s" into "long" and "short" and add "extreme". And you can feed primaryWeapon into the code.
Last edited by wolph42 on Fri Feb 05, 2010 3:38 am, edited 1 time in total.

User avatar
bmcoomes
Kobold
Posts: 23
Joined: Wed Jan 27, 2010 9:27 pm
Location: Ephrata, WA

Re: Light vision Illumination Generator Tool (Excel)

Post by bmcoomes »

OK sound great! But is there a tutorial for an example how to start learning this? I have a vage idea on how to go about it but after the library token I start getting lost.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Light vision Illumination Generator Tool (Excel)

Post by wolph42 »

erm... probably yes, but I do not know of a single tutorial that covers this all. This will require you to 'get started' the wiki is a thankfull place find a lot of answers and here as well ofcourse.

However I had another look at your light setting and noticed that you're doing it a completely other way then I did so my earlier post isn't very helpfull. Obviously I would advice you to do it more my way :mrgreen: but then again every one should learn this their own way!

So:
You need to store a list of the weapons on a library token property.
eg. WeaponList : "SMG, Shotgun, Assault rifle"

The input function will then be:

Code: Select all

<!--the dropdownlist-->
[h:status=input("Wpn|"+WeaponList +"|Choose Weapon to Display|LIST|SELECT=0")]
[h:abort(status)]
<!--and the light settings-->
[h, if(hasLightSource("Automatics", Wpn+" Short")), CODE:{
   [h: setLight("Automatics", Wpn+" Short", 0)]
   [h: setLight("Automatics", Wpn+" Medium", 0)]
   [h: setLight("Automatics", Wpn+" Long", 0)]
   };{
   [h: setLight("Automatics", Wpn+" Short", 1)]
   [h: setLight("Automatics", Wpn+" Medium", 1)]
   [h: setLight("Automatics", Wpn+" Long", 1)]
}] 
im forgetting the get the WeaponList from the library token, check the wiki, but I believe its something like:
WeaponList = getLibProperty(WeaponList , "lib:WhateverYouCallIt")
better yet not to use the same names so probly call the property WeaponLibrary : "Shotgun, SMG, etc"
and then
WeaponList = getLibProperty(WeaponLibrary , "lib:WhateverYouCallIt")

User avatar
bmcoomes
Kobold
Posts: 23
Joined: Wed Jan 27, 2010 9:27 pm
Location: Ephrata, WA

Re: Light vision Illumination Generator Tool (Excel)

Post by bmcoomes »

OK I'm geting an error. Here is what I did. I started small.

Library token property. WeponLibrary : Assault Rifle, SMG, Machine Pistol

then on the campaign tab I have the WeaponImput

Code: Select all

<!--the dropdownlist-->
[h:status=input("Wpn|"+WeaponList+"|Choose Weapon to Display|LIST|SELECT=0")]
[h:abort(status)]
<!--and the light settings-->
[h, if(hasLightSource("Automatics", Wpn+" Short")), CODE:{
   [h: setLight("Automatics", Wpn+" Short", 0)]
   [h: setLight("Automatics", Wpn+" Medium", 0)]
   [h: setLight("Automatics", Wpn+" Long", 0)]
   [h: setLight("Automatics", Wpn+"Extreme", 0)]
   };{
   [h: setLight("Automatics", Wpn+" Short", 1)]
   [h: setLight("Automatics", Wpn+" Medium", 1)]
   [h: setLight("Automatics", Wpn+" Long", 1)]
   [h: setLight("Automatics", Wpn+"Extreme",1)]
}] 
then on the Selection tab I have the WeaponList

Code: Select all

[h: WeaponList = getLibProperty(Weaponlibrary, "Lib:SR4")]
and this is what I get in the chat window.
 Invalid condition in IF(hasLightSource("Automatics", Wpn+" Short")) roll option.       Statement options (if any): h, if(hasLightSource("Automatics", Wpn+" Short")), CODE       Statement Body (first 200 characters): { [h: setLight("Automatics", Wpn+" Short", 0)] [h: setLight("Automatics", Wpn+" Medium", 0)] [h: setLight("Automatics", Wpn+" Long", 0)] [h: setLight("Automatics", Wpn+"Extreme", 0)] }

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Light vision Illumination Generator Tool (Excel)

Post by wolph42 »

well... this is the other 50% of the coding: debugging.
I can't find any syntax errors, but then again I might overlook them as well.
First of
hen on the Selection tab I have the WeaponList

Code: Select all

[h: WeaponList = getLibProperty(Weaponlibrary, "Lib:SR4")]
What do you mean with that?

The macro in its enitirety should be:

Code: Select all

<!--retrieve library-->
[h: WeaponList = getLibProperty(Weaponlibrary, "Lib:SR4")]

<!--the dropdownlist-->
[h:status=input("Wpn|"+WeaponList+"|Choose Weapon to Display|LIST|SELECT=0")]
[h:abort(status)]
<!--and the light settings-->
[h, if(hasLightSource("Automatics", Wpn+" Short")), CODE:{
   [h: setLight("Automatics", Wpn+" Short", 0)]
   [h: setLight("Automatics", Wpn+" Medium", 0)]
   [h: setLight("Automatics", Wpn+" Long", 0)]
   [h: setLight("Automatics", Wpn+"Extreme", 0)]
   };{
   [h: setLight("Automatics", Wpn+" Short", 1)]
   [h: setLight("Automatics", Wpn+" Medium", 1)]
   [h: setLight("Automatics", Wpn+" Long", 1)]
   [h: setLight("Automatics", Wpn+"Extreme",1)]
}]  
Now if that doesn't work, start with putting something in the if() statement to see if the code block actually works, e.g.:
[h, if(0), CODE:{
and see if the lights go on, then
[h, if(1), CODE:{
to see if they go off again.
If so, the problem is in the if statement... go from there :wink:

edit: you miss a space before "Extreme" that will generate an error (not THE error, but an error).

User avatar
bmcoomes
Kobold
Posts: 23
Joined: Wed Jan 27, 2010 9:27 pm
Location: Ephrata, WA

Re: Light vision Illumination Generator Tool (Excel)

Post by bmcoomes »

wolph42 wrote:well... this is the other 50% of the coding: debugging.
I can't find any syntax errors, but then again I might overlook them as well.
First of
Then on the Selection tab I have the WeaponList

Code: Select all

[h: WeaponList = getLibProperty(Weaponlibrary, "Lib:SR4")]
What do you mean with that?
That is perfectly OK, in being a nood at this I had it as it's own macro instead of it with the other coding.
wolph42 wrote:The macro in its enitirety should be:
Spoiler

Code: Select all

<!--retrieve library-->
[h: WeaponList = getLibProperty(Weaponlibrary, "Lib:SR4")]

<!--the dropdownlist-->
[h:status=input("Wpn|"+WeaponList+"|Choose Weapon to Display|LIST|SELECT=0")]
[h:abort(status)]
<!--and the light settings-->
[h, if(hasLightSource("Automatics", Wpn+" Short")), CODE:{
   [h: setLight("Automatics", Wpn+" Short", 0)]
   [h: setLight("Automatics", Wpn+" Medium", 0)]
   [h: setLight("Automatics", Wpn+" Long", 0)]
   [h: setLight("Automatics", Wpn+"Extreme", 0)]
   };{
   [h: setLight("Automatics", Wpn+" Short", 1)]
   [h: setLight("Automatics", Wpn+" Medium", 1)]
   [h: setLight("Automatics", Wpn+" Long", 1)]
   [h: setLight("Automatics", Wpn+"Extreme",1)]
}]  
Now if that doesn't work, start with putting something in the if() statement to see if the code block actually works, e.g.:
[h, if(0), CODE:{
and see if the lights go on, then
[h, if(1), CODE:{
to see if they go off again.
If so, the problem is in the if statement... go from there :wink:

edit: you miss a space before "Extreme" that will generate an error (not THE error, but an error).
I fixed the space, and I'm moving on to the testing. I'm geting now a pop up window asking for Input Value for Lib:SR4 "Value For WeaponLibrary" and then it asked Choose Weapon to Display: >dropdown< with only a "0"
The chat output is impersonated "Lib:SR4" with a black entry.

Thanks,
Edit: it's looking like it's not generating the WeaponList so it's not accessing the WeaponLibrary.

Edit 2: I have the idea of attching the campiagn file so you can see whats going on.
Attachments
Testing.cmpgn
(23.35 KiB) Downloaded 67 times

User avatar
bmcoomes
Kobold
Posts: 23
Joined: Wed Jan 27, 2010 9:27 pm
Location: Ephrata, WA

Re: Light vision Illumination Generator Tool (Excel)

Post by bmcoomes »

I've fixed the Lib token property I had it formatted wrong so now it's get that information but only have a "0" in the dropdown to "Choose Weapon to Display".

Edit: I found that it's the:

Code: Select all

<!--the dropdownlist-->
[h:status=input("Wpn|"+WeaponList +"|Choose Weapon to Display|LIST|SELECT=0")]
[h:abort(status)]
Portion, in that it's not listing the wepon library which should be Assault Rifle, SMG, Machine Pistol. I can remove it and input the type manually and it works.[/color]

Post Reply

Return to “MapTool”