PDA

View Full Version : Check to see if a CT entry is PC or NPC?



Oberoten
November 27th, 2008, 21:16
How and where do I see in the combat-tracker if an entry is a PC or a NPC?

I am probably just being blind but, seriously? I am going slightly insane.

I dropped THIS into my tracker's code and it works, except it also gives me GM ids for the PCS and I'd prefer to keep it to just shifting to NPCS.



function requestActivation(entry)
for k, v in ipairs(getWindows()) do
v.setActive(false);
end

entry.setActive(true);
entry.initresult.setValue(entry.initresult.getValu e() + entry.ActValue.getValue());

GmIdentityManager.addIdentity(entry.name.getValue( ));


end

PneumaPilot
November 29th, 2008, 06:12
What do you mean? Are you talking about whether or not the combat tracker shows a difference between NPC and PC? I don't understand the question.

Foen
November 29th, 2008, 06:37
Hi Obe

I think you should be able to use entry.getType() which returns "pc" or "npc" if your ruleset works like the base d20 one.

Foen

Oberoten
November 29th, 2008, 21:39
A bit clumsily it now makes NPC and monsters switch to their ID when it is their turn. (Good for absentminded GMs. :) )

... and when it is player-turn, switches to GM id. A bit crudely of course.



if entry.getType() ~="pc" then
GmIdentityManager.addIdentity(entry.name.getValue( ));
else
GmIdentityManager.addIdentity("GM");
end

Bidmaron
November 29th, 2008, 21:49
This is pretty clever. Any chance of getting this added to 3.5e_jpg? Moon_wizard are you copying this?

Oberoten
November 29th, 2008, 22:08
Well the idea I am proud of, but as per usual, I'd be stuck in a rockslide without Foen's able help.

The man is a Genius and deserves ALL credit he gets.

- Obe

Sorontar
November 29th, 2008, 23:43
Well I'm proud to say I taught Foen nothing that he knows now :D

Tenian
December 3rd, 2008, 03:20
I swiped this and converted it to work with 4E_JPG. The getType() method wasn't available, I ended up using the link to determine the objects class.

Oberoten
December 3rd, 2008, 14:54
Just glad to see I am not the only GM that forgets this. ;)

- Obe

Tenian
December 3rd, 2008, 16:05
I never really GM. But when I mentioned it yesterday, two other GMs were all excited about the possibility.

I think I need to add something to the CT clear function that clears the ID's as well. Deleting all those by hand seems pretty sucky :)

Moon Wizard
December 4th, 2008, 05:20
It seems like perhaps this feature should only add the current identity when that NPC becomes active, then removes it when they lose the active state. That way, you don't end up with the laundry list of identities over the night. And, you can always add an identity explicitly if you always want it there.

Cheers,
JPG

Tenian
December 4th, 2008, 11:18
Yeah that's probably cleaner...especially when you run that 1 Kobold Wyrmpriest and 16 kobold minions encounter :)

DEinspanjer
December 6th, 2008, 06:35
Sorry for being a little newb here, but I'd love to know a little more about what you guys are discussing here.

My group has a basic 3.5ed game that we've been running for a while using the basic install of FGII. The DM has been having trouble with the combat tracker, especially with the last update.

He wants to be able to see the party's stats in the CT, but we also want to have the locked battle map where we can show where we want our characters to go and then the DM "lets it happen" when it is the player's turn.
I've seen this described as being possible on the forums, but we haven't figured out how to get this to work yet.

I have a full version, so I suppose I could try this out on my own but I don't have any campaigns or anything so I thought that I'd ask for help and advice first.

Tenian
December 6th, 2008, 17:14
This thread is about setting the GM Identity when its an NPC turn. The Identity is the voice the GM uses to speak. This allows the GM to speak as a say "Thrak the Goblin Commander" instead of "GM". All this really changes is the name that prefaces the GM's text.

What you are describing is locked tokens. The GM should be able to set this by right clicking on the displayed map and selecting the option through the radials. The GM will be able to move tokens, but the player will only be able to plot movement lines (which the GM can then accept).

In groups I have played in, a combination of locked and unlocked tokens are used. Locked is usually used when the party is under initiative and running some sort of encounter, and unlocked is used when the party is exploring an area.

DEinspanjer
December 8th, 2008, 18:40
Gotcha. Sorry for my unintentional attempt to steal the thread. :) I found the link to the tutorial videos and they certainly indicate that what we want to do regarding a locked map while in an encounter while the DM is still able to see the party stats in the CT. Not sure if he is having troubles related to the update or if it is just a misunderstanding but I'll open a new thread if I need more help with that.

Thanks for your time Tenian!

Tenian
December 10th, 2008, 01:35
I added some code to remove the identity when the GM switches off the character. All this went into my combattracker.lua

First a function to clean the id....again I had no luck with the getType, so I used the link.



function cleanIdentity(entry)
if entry.link.getValue() ~="charsheet" then
GmIdentityManager.removeIdentity(entry.name.getVal ue());
end
end


Next I changed the nextActor function:



function nextActor()
local active = getActiveEntry();
if active then
local nextactor = getNextWindow(active);
if nextactor then
local activeinit = active.initresult.getValue();
local nextactorinit = nextactor.initresult.getValue();
if nextactorinit ~= activeinit then
for k, v in ipairs(getWindows()) do
v.effects.progressEffects(activeinit, nextactorinit);
end
end

requestActivation(nextactor);
else
nextRound();
end
cleanIdentity(active);
else
nextRound();
end
end


I'm not sure how close these functions are to the D20 versions, but hopefully someone can puzzle them out if they are interested.

Bidmaron
December 10th, 2008, 03:23
It seems like perhaps this feature should only add the current identity when that NPC becomes active, then removes it when they lose the active state. That way, you don't end up with the laundry list of identities over the night. And, you can always add an identity explicitly if you always want it there.

Cheers,
JPG
Does that mean you're putting this into d20_jpg? (hope, hope?)

shadowsama
December 20th, 2008, 05:07
Could someone please explain to me exactly how I might go about adding this to the WFRP2 ruleset (if the code even allows for it?)

I've tried every combination of the codes given in this thread and none of them seem to do anything except auto-close any NPC identities I have open after their turn is over in combat (but doesn't auto-open then when their turn begins, I might add).

Tenian
December 20th, 2008, 06:06
Well if the clean up code is working then this might work, as it uses the same method to determine if an entry is a PC

within the combattracker.lua locate: function requestActivation(entry)
Mine originally looked like:


function requestActivation(entry)
for k, v in ipairs(getWindows()) do
v.setActive(false);
end

entry.setActive(true);
end


I added a bit of code to the end of it to create the ID


function requestActivation(entry)
for k, v in ipairs(getWindows()) do
v.setActive(false);
end

entry.setActive(true);
-- Set the GM ID
if entry.link.getValue() ~="charsheet" then
GmIdentityManager.addIdentity(entry.name.getValue( ));
else
GmIdentityManager.addIdentity("GM");
end
end