RPTools.net

Discussion and Support

Skip to content

It is currently Mon Jun 26, 2017 2:03 pm 






Reply to topic  [ 524 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 35  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6237
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 9:10 am 
DN, this is really elegant and very nice to look at. Incredible work.

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Wed Sep 03, 2008 11:34 am
Posts: 686
Location: The Junkyard
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 9:27 am 
Asturia wrote:
I think I have another bug.
My passive insight always stays 10.
But I trained Insight and have a total of 7 in it.
Even when I enter it as a passive bonus it doesn't change.


I could swear I fixed that! Again, pretty trivially easy to fix. So looks like I'll hand out new macros later today and do a 5.1 version in a week or so once I get a few more things.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Wed Sep 03, 2008 11:34 am
Posts: 686
Location: The Junkyard
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 9:33 am 
Rumble wrote:
DN, this is really elegant and very nice to look at. Incredible work.


Thanks! Given all the various things you've done I take that as pretty high praise.

I really wanted to include your die roller but realized the version I've been using is the same one I've been using for like a year and I didn't know what the current version looked like or even really anything beyond "It works for me!" and so pulled it out of the default campaign file. I still highly recommend it cause you do pretty awesome work.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6237
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 9:41 am 
DeviantNull wrote:
Rumble wrote:
DN, this is really elegant and very nice to look at. Incredible work.


Thanks! Given all the various things you've done I take that as pretty high praise.

I really wanted to include your die roller but realized the version I've been using is the same one I've been using for like a year and I didn't know what the current version looked like or even really anything beyond "It works for me!" and so pulled it out of the default campaign file. I still highly recommend it cause you do pretty awesome work.



Feel free to use it (or bash at it until it suits you!) I haven't updated the basic dicebox stuff in a while, except for the custom job I did to make it roll dice for the newest Warhammer Fantasy game system.

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sun Apr 19, 2009 4:49 pm
Posts: 98
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 10:35 am 
Great work on the FAQ write-up; it answered all my questions.

***

As a StarCraft 2 player, I'm all about hotkeys (to compensate for my crappy APM), so for anyone who is looking for a macro for taking damage/healing:

1. Duplicate the Character Sheet campaign macro
2. Right-click on the duplicate, click edit
3. Change the Label to "Health" (or whatever name you want)
4. Replace the Command with:

/self
[h, macro("Health@Lib:Execute"): json.set("", "ForceLoad", 1)]

5. Set a Hot Key (optional)


Still trying to work on a Mass Initiative macro that can roll 10+ NPC/monster initiatives at once...

EDIT: See DN's post for how to accomplish this in a way that is 10x more awesomer.

Peace,
-Darakonis

_________________
Visit the D&D Digest for RPG tips & reviews.

Listen to the adventures of a live MapTool voice-chat group: Dungeons & Drogans


Last edited by Darakonis on Fri Sep 03, 2010 1:18 pm, edited 1 time in total.

Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5405
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 12:22 pm 
Darakonis wrote:
Still trying to work on a Mass Initiative macro that can roll 10+ NPC/monster initiatives at once...


I did a generic one(ie, for no specific framework) that branched on the monsters level/role OR GM name so that you can group "like" creatures together in the init order. You might want to take a look at it for inspiration.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sun Apr 19, 2009 4:49 pm
Posts: 98
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 12:59 pm 
jfrazierjr wrote:
Darakonis wrote:
Still trying to work on a Mass Initiative macro that can roll 10+ NPC/monster initiatives at once...


I did a generic one(ie, for no specific framework) that branched on the monsters level/role OR GM name so that you can group "like" creatures together in the init order. You might want to take a look at it for inspiration.

Thanks, I'll check it out.

(After a few minutes spent trying to find it)

Uhm... link, please? :)

In the meantime, I'll post an updated health arc tutorial that works with the new framework...

Peace,
-Darakonis

_________________
Visit the D&D Digest for RPG tips & reviews.

Listen to the adventures of a live MapTool voice-chat group: Dungeons & Drogans


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Wed Sep 03, 2008 11:34 am
Posts: 686
Location: The Junkyard
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:02 pm 
Darakonis wrote:
/self
[h, macro("Health@Lib:Execute"): json.set("", "ForceLoad", 1)]

Still trying to work on a Mass Initiative macro that can roll 10+ NPC/monster initiatives at once...

EDIT: Also trying to figure out how to stop that health Macro from loading up the character sheet after applying the damage/healing...


First, I'm not really sure what you're wanting the health macro to do... just pull up the Health Entry dialog with a hotkey?

Second, I don't think you need the json.set("", "ForceLoad", 1) in there. That's Character Sheet loader specific and is mainly to force the character sheet to get far enough in the loading process without a token to load the frame code. Otherwise on a campaign start it doesn't do anything since it checks to see if you own the token... which you don't since there is no token and so it aborts.

You also can't stop it from reloading the sheet without removing or modifying the [H, macro("Sheet@Lib:Sheet"), json.set("", "Reload", 1)] at the tail end of the HealthRecord macro. All macros that modify information on the character sheet reload the character sheet in order to force it to reflect the changes made. The character sheet does a onChangeSelection that reloads, but there are checks to cut it off and stop the process in numerous circumstances to both prevent it displaying tokens you don't own as well as speed up moving tokens around so it has to be forced to reload. See the Q's about the token not reflecting changes done by others.

However, you could hotkey the Health Entry window directly; the Health macro does it indirectly by actually creating THIS exact link with the addition of an amount to set the default Health, TempHP, or Damage to.
Code:
[H, macro("Entry@Lib:Sheet"): json.set("", "WindowType", "Health", "MacroTarget", "Multiple")]


The breakdown on this is Entry is the global dialog window for everything (gets me around the nested {} limitation). It then checks the macro.args passed to it for a JSON key called "WindowType" which is the name of dialog window to call + "Entry". Thus passing it Health makes it call HealthEntry. It then passes all the macro.args onto the new macro. HealthEntry checks the macro.args for a JSON key named "MacroTarget" to determine if the macroLinkText needs to execute on all selected tokens or just the currentToken(). It only has 1 value, "Multiple". Anything else and it defaults to currentToken(). This is what allows it to execute on everything when invoked from the Multiple Token Select page. Finally HealthEntry calls HealthRecord.

HealthRecord does all the math, but it has a check at the very start that aborts if a token that the code is being run on either lacks the DNA_CharacterType or is not owned by the player (it uses isGM to override for GM's). After it sets all the new health values it does a [macro("Sheet@Lib:Sheet"): json.set("", "Reload", 1)] to force the sheet to reload and show the changes.

Whew... the point of all that? Well, you can do the same for Initiative since it works the same way and even has the MacroTarget/Multiple token code build in since it was designed to be invoked from the Multiple Token Select Page. Simply call
Code:
[H, macro("Entry@Lib:Sheet"): json.set("", "WindowType", "InitiativeCheck", "MacroTarget", "Multiple")]

and it will load an Initiative window that will apply to all selected tokens.


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sun Apr 19, 2009 4:49 pm
Posts: 98
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:04 pm 
I'm sure some of you have already made your own health bars for DN's framework, so this is for those who, like myself a few months ago, don't know how.

_____________________________

A Noob's Guide to Health Bars in DN's D&D4e Character Sheet Framework
-By a noob, for noobs

First, a referral to aliasmask's health arc. I used his aesthetically pleasing health arc image and colored it for my purposes. If you want to recreate his bar's functionality, then you can skip most of the rest of my post.
_____________________________

Objective: Create a simple health bar that shrinks as a PC take damages and changes color to reflect how injured she is.

Picture of result:
Image

Green: >80% HP
Yellow-green: 60-80% HP
Yellow: 40-60% HP
Orange: 20-40% HP
Orange-red: <20% HP
_____________________________

Pregame: An image of each color health arc is needed, in addition to the background red health arc that represents the percentage of lost HP (ie. at 15/20 HP, the right quarter of the health arc is red). aliasmask provides images of a green, yellow, and red health arc, so with some quick Photoshop magic I created the yellow-green, orange, and orange-red ones.

If you want to use the ones I made, here they are, along with the three originals from aliasmask:

http://img204.imageshack.us/img204/9476/temp100.png
http://img96.imageshack.us/img96/5567/orangey.png
http://img406.imageshack.us/img406/4207/low.png
http://img709.imageshack.us/img709/5673/littlea.png
http://img202.imageshack.us/img202/3669/health100.png
http://img339.imageshack.us/img339/6021/damage100.png
_____________________________

Once you have all the images you need, we can move on to...

Creating the Bars


  • In MapTool, open the campaign file you wish to use. Select Edit>Campaign Properties, then click on the Bars tab.

  • Select the Health bar by clicking on it. Change "Type" to "Two Image," and "Side" to "Top."

  • Click the upper "Add" button and navigate to the red health arc. This will be your base--the part that is revealed as your HP decreases.

  • Click the upper "Add" button once more and navigate to the green health arc.

  • To finish with that bar, click the lower "Update" button. We can end things here--you'll have a nice-looking green bar that shrinks as HP goes down, without having to change any coding. But let's not settle for silver when we can go for gold.

  • Next, we need to add a new bar for each of the four remaining health states. With the "Health" bar selected, type "Orange" into "Name," then select and delete the green "bar" but leave the red one. Click the upper "Add" button and select your orange bar. This time, click the lower "Add" button. Repeat this bullet point for the remaining three colors.

Once done, click "OK," and we'll proceed to...

Coding the Bars

By far the worst part for a code-noob like myself, it took me a couple hours to get these bars behaving as intended. The code I used is inelegant, inefficient, and filled with redundancy, but it gets the job done. If anyone would like to clean the code up, I'll gladly edit this post.

  • First, navigate to the map where you stored your "Lib:Execute" token. Create a backup by copying and pasting it, then renaming it to "Lib:Execute Backup."

  • With "Lib:Execute" selected, select Window>Selected. In the menu that pops up, locate the "HPRecord" macro button under the "Health" subsection. Right click on "HPRecord" and click "Edit." Scroll to the bottom of the "Command" box and locate the section titled <!--Health bar-->. Delete the ensuing line(s), and replace them with:

    [H, macro("HealthBar@Lib:Execute"): ""]

  • Repeat the above step with the SurgeRecord and RestRecord macros.

  • Create a new macro on the "Lib:Execute" Selected's menu by right-clicking near "HPRecord" and selecting "Add new macro." For Label, write "HealthBar" (sans quotes), and in the "Command" box, input:

    Code:
    <!--Health bar-->
    <!--Initially hide all bars--this could possibly be removed-->
    <!--"Health" is the green bar, "Little" is yellow-green, "Yellow" is the yellow, "Orange" is orange, "Low" is orange-red-->
    <!--Use the names that you used when creating your bars; the names above are what I used for my bars-->
    [H: setBarVisible("Health",0)]
    [H: setBarVisible("Yellow",0)]
    [H: setBarVisible("Orange",0)]
    [H: setBarVisible("Low",0)]
    [H: setBarVisible("Little",0)]
    <!--The following ensures that only one bar is being displayed at a time-->
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints <= 0.6): bar.Yellow = (DNA_HitPoints-DNA_CurrentDamage)/DNA_HitPoints]
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints <= 0.4): setBarVisible("Yellow",0)]
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints <= 0.8): bar.Little = (DNA_HitPoints- DNA_CurrentDamage)/ DNA_HitPoints)]
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints <= 0.6): setBarVisible("Little",0)]
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints <= 0.4): bar.Orange = (DNA_HitPoints- DNA_CurrentDamage)/ DNA_HitPoints]
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints <= 0.2): setBarVisible("Orange",0)]
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints > 0.8): bar.Health = (DNA_HitPoints- DNA_CurrentDamage)/ DNA_HitPoints]
    [H, if((DNA_HitPoints - DNA_CurrentDamage) / DNA_HitPoints <= 0.2): bar.Low = (DNA_HitPoints- DNA_CurrentDamage)/ DNA_HitPoints]
    <!--The following turns off the bars for NPCs. Delete these lines if you want NPCs to display health bars-->
    [H, if(isNPC()==1): setBarVisible("Health",0)]
    [H, if(isNPC()==1): setBarVisible("Yellow",0)]
    [H, if(isNPC()==1): setBarVisible("Orange",0)]
    [H, if(isNPC()==1): setBarVisible("Little",0)]
    [H, if(isNPC()==1): setBarVisible("Low",0)]

  • Pay attention to my notes in the code, annotated with <!--(...)-->. Make the necessary modifications to your code--you will probably have to change "Little" to "Yellogreen," for instance.

Once done, click "OK." Test to make sure it works by damaging/healing a token, and we're done. Congratulations; you are now as qualified to explain this to other people as I am.

Peace,
-Darakonis

_________________
Visit the D&D Digest for RPG tips & reviews.

Listen to the adventures of a live MapTool voice-chat group: Dungeons & Drogans


Last edited by Darakonis on Fri Sep 03, 2010 2:03 pm, edited 1 time in total.

Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sun Apr 19, 2009 4:49 pm
Posts: 98
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:17 pm 
DeviantNull wrote:
(Wonderful explanation)

Wow, that works brilliantly! From that, I can even make a macro for Rests, or Healing surges, or Saving Throws... And I hadn't even realized there was a "multiple token select" menu that comes up when you try to bring up the character sheet with multi tokens selected... This just keeps getting better and better. Amazing work.

Peace,
-Darakonis

_________________
Visit the D&D Digest for RPG tips & reviews.

Listen to the adventures of a live MapTool voice-chat group: Dungeons & Drogans


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5405
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:22 pm 
Darakonis wrote:

Uhm... link, please? :)



Hmm was not hard to find, but here :http://forums.rptools.net/viewtopic.php?f=20&t=13705&p=146722&hilit=NPC#p146722

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sun Apr 19, 2009 4:49 pm
Posts: 98
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:28 pm 
Ah, whoops; I was searching through the User Creations section. Cheers.

Peace,
-Darakonis

_________________
Visit the D&D Digest for RPG tips & reviews.

Listen to the adventures of a live MapTool voice-chat group: Dungeons & Drogans


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Wed Sep 03, 2008 11:34 am
Posts: 686
Location: The Junkyard
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:32 pm 
Darakonis wrote:
[*]With "Lib:Execute" selected, select Window>Selected. In the menu that pops up, locate the "HPRecord" macro button under the "Health" subsection. Right click on "HPRecord" and click "Edit." Scroll to the bottom of the "Command" box and locate the section titled <!--Health bar-->. Delete the ensuing line(s), and replace them with:


First, why didn't I know folks were doing swanky stuff like this? :shock:
I really must not pay attention...

Second, For that step right there, since this version has Health management split into HealthRecord, SurgeRecord, and RestRecord it likely needs to be replaced on all three macros.

It's far easier to copy your code into another macro, say a macro named HealthBar on the Lib:Execute, and then in the three macros above that i mentioned replace their HealthBar code with

Code:
[H, macro("HealthBar@Lib:Execute"): ""]


and be done.

Why yes, I did quickly just scurry off and try this... I'm not sure if I like top or bottom for health bars though. I might try flipping them in GIMP.


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Mon Feb 16, 2009 7:12 pm
Posts: 234
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:38 pm 
So, I edited the Alignment rules macro in Lib:Information, and executed the macro. The alignment list remains the same, though (including "Super Evil" still). Am I doing this wrong?

Edit/Update: Aha. Found the problem. The first line of the macro should be
Code:
[H: setLibProperty("AlignmentList", json.append("",
and the last should be
Code:
), "Lib:Information")]
Changing it to these seems to get it working.

_________________
I made a framework for Exalted 2.5E.


Last edited by Venatius on Fri Sep 03, 2010 9:44 pm, edited 5 times in total.

Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sun Apr 19, 2009 4:49 pm
Posts: 98
 Post subject: Re: DN's D&D4e Character Sheet Framework
PostPosted: Fri Sep 03, 2010 1:58 pm 
DeviantNull wrote:
Second, For that step right there, since this version has Health management split into HealthRecord, SurgeRecord, and RestRecord it likely needs to be replaced on all three macros.

It's far easier to copy your code into another macro, say a macro named HealthBar on the Lib:Execute, and then in the three macros above that i mentioned replace their HealthBar code with

Code:
[H, macro("HealthBar@Lib:Execute"): ""]


and be done.

Why yes, I did quickly just scurry off and try this... I'm not sure if I like top or bottom for health bars though. I might try flipping them in GIMP.

Oh wow, I didn't realize that using healing surges and rests wouldn't change the health bar. That would have been an unpleasant surprise tomorrow night.

Your new code works great; I'll update my tutorial to include it.

As for the top/bottom; I figure putting it at the top lowers the risk of it interfering with token states, since few states appear at the top, and the health bar is big enough to partially obscure token states.

Peace,
-Darakonis

_________________
Visit the D&D Digest for RPG tips & reviews.

Listen to the adventures of a live MapTool voice-chat group: Dungeons & Drogans


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 524 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 35  Next

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