PDA

View Full Version : Displaying Round Count



ShaneLeahy
April 26th, 2007, 16:49
I am wondering if this is something take could be done through scripting or something that has to be done within the software itself.

Currently when using the Combat Tracker and you scroll through the combatants, it shows in the Chat Window. Would it be possible to include the Round count with that also?

Player 1 Round 2

For example.

Also to add the NPCs/Monsters, just so the players know whose turn it is currently.

Thanks

richvalle
April 26th, 2007, 17:03
The problem with sharing is that some DM's (like me) might not want the players to either know the bad guys name or type.

ie if you have ghoul1-6 and ghast1 on your tracker the players will quickly know what is what. :)

What we have done in the past is to either open up a new, small window that fits under the chat window and place another set of player and monster tokens there in init order. Or just place extra's on the map and place in init order going top to bottom on the side of the battle.

rv

joshuha
April 26th, 2007, 17:22
This can be done via scripting since this is how the combattracker is built anyways.

In the D20 script folder you should see a file called combattracker_entry.lua and in that file you should see the following section:


function setActive(state)
active.setState(state);

if state and charactertype == "pc" then
-- Turn notification
local msg = {};
msg.text = name.getValue();
msg.font = "narratorfont";
msg.icon = "indicator_flag";

ChatManager.deliverMessage(msg);
end
end


Removing the

and charactertype == "pc" part should work although I am not sure if NPCs use the same name.getValue() to get thier name tag.

To get the counter working try

msg.text = name.GetValue() .. " Round " .. window.roundcounter.getValue()

greowhiste
April 26th, 2007, 17:34
That is why I think it is important to have aliases.

Aliases would solve many problems for DMs trying to keep anonymity. Every creature that goes into the combat tracker, or Personalities window could be given a true name and an alias. The alias will always be used when popping up to PCs and the true name could be in all DM's listings. It would further be an awesome function if there was a simple button that could toggle the feature for the PCs, ie when selected the true name you've assigned it could be revealed to the PCs (if/when they identify it, or have learned it's name or whatever).

Thoughts on this idea?

Culdraug
April 26th, 2007, 17:48
Thats an interesting syntax joshuha. I havent looked into lua scripting yet but my first instinct is to try and understand what the if statement is looking for. Breaking down the first line

{if state and charactertype == "pc" then}

Is it looking for a combination of state and charactertype to be equal to "pc" or for both state and charactertype each to equal "pc"? Or the more likely answer is check state for true false and test if charactertype equals "pc"?

either way removing the whole section {and charactertype == "pc"} will leave you with

{if state then}

At this point I would hope that state is a boolean.

Can you please explain how this works?

Thanks!

richvalle
April 26th, 2007, 17:49
Sounds good. Someone make it so!

rv

joshuha
April 26th, 2007, 17:52
You are correct that state is a boolean. It represents if the character is the active one.

If you trace all of this from the combattracker.lua file you find the nextActor() function loops through all the actors until then end and then calls the nextRound() function. The nextActor() function calls a requestActiviation() function which sets the current actor to false and then sets the new one to true via entry.setActive(true); which calls that function above.

ShaneLeahy
April 26th, 2007, 18:47
Thanks, I will try this tonight if I have time.