PDA

View Full Version : 2E Ruleset Questions



Varsuuk
February 11th, 2020, 05:54
(Generic title in case can stick in small questions without constantly starting new threads)


Celestian,

I notice in several places that when an effect has sUnits set to "minute", it treats it as if it were Turns (10 mins) and when sUnit is null, it is treated as "minute"s
Is there a reason for this sort of thing? I see that Hour and Day are not reinterpreted.


examples:


...
if sUnits == "minute" then
sDuration = sDuration .. " turn";
...
function adndOnEffectAddStart(rNewEffect)
--Debug.console("manager_effect_adnd.lua","adndOnEffectAddStart","rNewEffect",rNewEffect);
rNewEffect.nDuration = rNewEffect.nDuration or 1;
if rNewEffect.sUnits == "minute" then
rNewEffect.nDuration = rNewEffect.nDuration * nTIME_TURN;
elseif rNewEffect.sUnits == "hour" then
rNewEffect.nDuration = rNewEffect.nDuration * nTIME_HOUR;
elseif rNewEffect.sUnits == "day" then
rNewEffect.nDuration = rNewEffect.nDuration * nTIME_DAY;
end
rNewEffect.sUnits = "";

damned
February 11th, 2020, 06:05
in AD&D 1E/2E there were combat turns and exploration turns.
combat turns were 1min

celestian
February 11th, 2020, 06:44
Damned is correct.

5E has round/minute/hour
AD&D has round/turn/hour

AD&D doesn't use minute as a duration, its rounds, turns or hours/days. Effectively round=minute in AD&D. I think in 5e a round is 6 seconds?

Instead of re-writing all that code I changed the display so that I could continue to use updates/etc from new revisions. Similarly the descending/ascending AC... up/down, it's all the same. Just make sure the players see what they expect.

Varsuuk
February 11th, 2020, 12:19
Gotcha. It was to reduce changes to diff on updates.

I don’t recall the round/minute thing difference in 5E, but easy enough to check once home. It all blends ;)

Varsuuk
February 24th, 2020, 03:32
CombatTracker -> is <inventorylist> node an appendix thing, left over from when it used to be use?

Tracing effects, noticed I would get called from char sheet, but never CT. Looking, realized no real "inventory in current CT - there is "actions" where inventory items (weapons) are placed but that isn't same thing. Was it there once and you cleaned it up for whatever reasons and the two ways to it were left? - or am I missing a path that requires some "CT add item" type button I didn't see?



...
-- watch the combatracker/npc inventory list
DB.addHandler("combattracker.list.*.inventorylist.*.carried", "onUpdate", inventoryUpdateItemEffects);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. effect", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. durdice", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. durmod", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. name", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. durunit", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. visibility", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. actiononly", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.isidentified", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist", "onChildDeleted", updateFromDeletedInventory);

-- watch the character/pc inventory list
DB.addHandler("charsheet.*.inventorylist.*.carried", "onUpdate", inventoryUpdateItemEffects);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.effect", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.durdice", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.durmod", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.name", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.durunit", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.visibilit y", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.actiononl y", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.isidentified", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist", "onChildDeleted", updateFromDeletedInventory);
end
...


If there isn't a way to add inventory to the CT, then removing the first set would be safe, correct?

celestian
February 24th, 2020, 05:19
CombatTracker -> is <inventorylist> node an appendix thing, left over from when it used to be use?

Tracing effects, noticed I would get called from char sheet, but never CT. Looking, realized no real "inventory in current CT - there is "actions" where inventory items (weapons) are placed but that isn't same thing. Was it there once and you cleaned it up for whatever reasons and the two ways to it were left? - or am I missing a path that requires some "CT add item" type button I didn't see?



...
-- watch the combatracker/npc inventory list
DB.addHandler("combattracker.list.*.inventorylist.*.carried", "onUpdate", inventoryUpdateItemEffects);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. effect", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. durdice", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. durmod", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. name", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. durunit", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. visibility", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.effectlist.*. actiononly", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist.*.isidentified", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("combattracker.list.*.inventorylist", "onChildDeleted", updateFromDeletedInventory);

-- watch the character/pc inventory list
DB.addHandler("charsheet.*.inventorylist.*.carried", "onUpdate", inventoryUpdateItemEffects);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.effect", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.durdice", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.durmod", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.name", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.durunit", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.visibilit y", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.effectlist.*.actiononl y", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist.*.isidentified", "onUpdate", updateItemEffectsForEdit);
DB.addHandler("charsheet.*.inventorylist", "onChildDeleted", updateFromDeletedInventory);
end
...


If there isn't a way to add inventory to the CT, then removing the first set would be safe, correct?

You add it to the NPC or the Character. For NPCs that's their version of a character sheet.

Varsuuk
February 24th, 2020, 14:40
PS: In response to "You add it to the NPC or the Character. For NPCs that's their version of a character sheet.", I meant the question is that there is no way to add an item to CT "inventory" that I could see. That results in an inventorylist entry in the CT (which is what is being tracked for NPCs)
-------
I was trying to see what triggers the two handler calls.

For example, editing an item's effects on a character sheet -> the edit handler is called (per keystroke ;) ) When I do that on same item which is in the inventory of an npc in CT, nothing happens.

This appears to be because effects in CT is not setup like the handler. It is not setup in a path under inventory. Inventory is not "a thing" for CT as far as I can see?
So if we want the same type of behavior, then different thins have to be monitored, right? Otherwise, you just modify the npc inventory, remove him from CT and re-add to CT to get new effects?

Same behavior seen with update to carried by dragging new item or clicking from char/npc (yes/no) an item to be carried or not.

If my interpretation is wrong, how do I trigger the logging of those (or either) two handler methods? How do I fire them with NPCs? (i.e., handling a CT change)




...
-- run from addHandler for updated item effect options
function inventoryUpdateItemEffects(nodeField)
Debug.console("manager_effect_adnd.lua","inventoryUpdateItemEffects","nodeField",nodeField);
Debug.console("manager_effect_adnd.lua","inventoryUpdateItemEffects","DB.getChild(nodeField, ..",DB.getChild(nodeField, ".."));
updateItemEffects(DB.getChild(nodeField, ".."));
end
-- update single item from edit for *.effect handler
function updateItemEffectsForEdit(nodeField)
Debug.console(">> updateItemEffectsForEdit -----");
if nodeField then
...

celestian
February 24th, 2020, 15:27
PS: In response to "You add it to the NPC or the Character. For NPCs that's their version of a character sheet.", I meant the question is that there is no way to add an item to CT "inventory" that I could see. That results in an inventorylist entry in the CT (which is what is being tracked for NPCs)
-------
I was trying to see what triggers the two handler calls.

For example, editing an item's effects on a character sheet -> the edit handler is called (per keystroke ;) ) When I do that on same item which is in the inventory of an npc in CT, nothing happens.

This appears to be because effects in CT is not setup like the handler. It is not setup in a path under inventory. Inventory is not "a thing" for CT as far as I can see?
So if we want the same type of behavior, then different thins have to be monitored, right? Otherwise, you just modify the npc inventory, remove him from CT and re-add to CT to get new effects?

[/code]

NPC sheets reside under the combattracker.* node path. combattracker.list.id-0001.inventorylist.*

The reason the handler is there is if the npc has a item with an effect tied to it and changes carried state or the effect on it is modified.

Varsuuk
February 24th, 2020, 18:54
Celestian, that is what I expected - to see "inventorylist" under CT. However, in the campaign db.xml, I do not see this. I see the following for the Ankheg:

As you can see, I tossed a few items on this ant for it to swing ;). They have effects, the effects get applied to the CT, no problem.
But, changing them or adding them on the NPC Sheet has no effect on CT (not hits the callback for edit) - only changes to charsheet because that path with inventorylist does exist in character sheet. That path does not exist (for me?) in CT sheet for the NPC.

31754

31755

celestian
February 24th, 2020, 20:06
This is what I see.

https://i.imgur.com/CEpixQs.gif

You can see the effect being applied and removed as I toggle the item on/off.

Varsuuk
February 24th, 2020, 21:14
UPDATE (written after the stuff below):
I removed my two softlinks in ruleset dir (to CoreRPG and 2E) and restored saved .pak files for 2E/Core.

My pak files are a bit old. Core is from Jan 3rd and 2E is from Feb 7th.


Steps:
1. New Campaign, 2E
2. Load PHB, DMG, MM
3. Open NPC
4. Selecte 3HD Ankheg, open sheet
5. Open Items, scroll to Longsword +3, Frostbrand
6. Drag Longsword to Ankheg sheet in the Inventory section.
7. Drag Ankheg (3HD) to CT.

I see in chat log that the effect of resist fire applied. Also see it in CT
I click the sword "carried" shirt to bag or empty. No change in chat log or CT. I cycle and cycle, no change.

Tried the above adding it with not equipped on sword and it does not add the effect. Then clicking to equip it on NPC Sheet does not effect the npc in CT.

I spelled it all out in case I am NOT doing it in right way/order/steps?

I'll try this on my main PC when get home. That one has NO lua coding on it. >>>> I do NOT doubt you Celestian <<<<< you showed me it works. So if you didn't recently fix it, it appears my environ is hosed and have to figure out why this is happening (probably: why it is not adding the required nodes under CT for item and only puts in effects.)



======

OK - just tried the click on bag/shirt/blank thing.
Nothing in console log, nothing in chat log and no changes in CT.

Adding an npc (anklet) with the three items "equipped" does cause the chat log to print the adding of effect, the effects are in the CT and the log of "carried" callback triggers.

I can only imagine, after seeing it live with you clicking that your db.xml has that CT....inventorylist...effects... etc path.
Only thing I can think of then is that since you didn't say "oh yeah, I fixed that 3 months back" that it isn't I am running a behind the updates one (prob 1-3 months max) but it is that I somehow modified something when adding logging that I didn't mean to.

I have the stuff in a local git every time I update from Smiteworks (after expanding the zipped files) so will see if that points out the problem.
Definitely NO inventorylist appears for NEITHER char or npc in CT tree.

Sorry, it seems this will be again my issue. Will update once I find what is changed. Ah, even easier than diffing - I will move the unzipped dir out of the folder so it uses the 2e.dat instead and while I won't hav the console trace logging, I can see it in chatlog and in the updated db.xml ct path.

BRB with update on that first.

Varsuuk
February 25th, 2020, 00:20
Have to help son, just got home - but short of it is:

When testing on Character, opened sheet and equipped/unequipped. All clear.
When doing NPC, opened NPC Sheet, dragged to CT - whatever was on NPC was registered effects-wise on CT. Good so far and a BIG CLUE...

When changed an effect on NPC Sheet (note, the SOURCE of what dragged to CT, not the CT npc...) nothing happened. Celestian mentioned "just make sure you are equipping on npc ct entry not npc record..." so yeah, with his help it is solved now.

I was clicking in wrong place. Verified works now as expected. Will continue working tonight if can stay awake after the game.

Thanks again, Celestian.

==============
EDIT: Update for any who were not aware of Celestian's CT optimization and are checking campaign xml files:

If you edit an existing (module/ruleset) npc it marks it with the pencil icon to indicate it has been modified. If you drag this to the CT, it creates an entry and runs the on carried (if item with effect is carried) callback for the effects.

However, no entry is made in CT for "inventorylist" which can fool you if you do a /save right after adding it. Instead, you need to first click on the npc in the CT to make it generate the inventorylist entry (and others - since Celestian has an optimization in CT to load lazily)

The same goes for ones you copy first before adding to the CT.