GMGEN Experience Plugin fails to calculate Experience

Description

Experience from combat is always zero, the CR for any NPC that is pre-created and is less than one shows as (-1) rather than a decimal. so I'm unable to add XP to the party this way.

The Add ___ XP to Selected character still functions as it should.

my loaded sources are:
Pathfinder RPG Core Supplements
Adventurers Armory
My Pathfinder Campaign 6.06.00
Humans of Golarion
Elves of Golarion
Inner Sea World Guide
Rise of the Runelords Player guide
Rise of the Runelords Adventure Path

thanks for your help!

Environment

windows 7 x64 enterprise, tried with Java 6,7 and 8

Activity

Show:
John Carletto
September 29, 2016, 2:02 PM
Edited

I found something else really strange. The Experience from Combat only shows if the CR of the PCs is greater than (1.0) but for some reason this shows at (0.0) for anything less than 1.

EDIT: I think this may have something to do with ExperienceList.averageCR();

if your group has 4 level 1 characters you get an average party level of 1, but the CR of a level one PC is .5

so (.5+.5+.5+.5) = 2.0

2.0/4 = .5
(int) .5 = 0
a 0 for an average party level means "Add XP to Party" fails with a null value.

I think an easy fix for this is to return a float value for the averageCR for the party or hard code it to return at minimum a 1. or if party is greater than 5 the minimum average level goes to 2.

John Carletto
September 29, 2016, 3:24 PM
Edited

I'd like to suggest these code additions for ExperienceList.java

Andrew Maitland
September 29, 2016, 11:10 PM

Connor,

Would the UI switch to JavaFX cover GMGen? And can we get a java monkey
to investigate the patch provided by John?

John Carletto
September 30, 2016, 12:20 AM

I tried the patch myself and it seems to have fixed it as long as you set the calculation type to "Calculate total experience by party level, divide equally (3rd, Modern)"

the other option still logs as a NumberFormatException: null

John Carletto
September 30, 2016, 1:28 AM
Edited

I managed to patch the other issue by updating the String xp in the ExperienceAdjusterModel.java under the getCombatantExperience(Combatant cbt) function.

heres my patch, pretty simple, changed from cbt.getCR to use the already populated enemyCR.

Assignee

Unassigned

Reporter

John Carletto

Labels

None

Theme

None

Epic/Theme

None

Pending User Input

No

Components

Affects versions

Priority

Minor
Configure