Code: Select all
ACTOR ScoreZombieMan: ZombieMan replaces ZombieMan
{
const int killPts = 5;
const int killPts_x = 20;
const int multPts = 1;
States
{
Death:
POSS H 0 A_GiveToTarget("PointsToAdd", killPts)
POSS H 0 A_GiveToTarget("PointsMultiplier", multPts)
POSS H 0 ACS_Execute(11, 0)
When an enemy dies, they add their kill value and a multiplier increase to (temporary) player inventory items. These inventory items are set back to 0 at the end of the script that is executed after they do so. The multiplier has its own countdown that is reduced on a timer so that part's not relevant. Said script is here:
Code: Select all
script 11 (void)
{
int totalPts = CheckActorInventory(0, "Points");
int addPts = CheckActorInventory(0, "PointsToAdd");
int multPts = CheckActorInventory(0, "PointsMultiplier");
GiveActorInventory(0, "Points", addPts * multPts);
TakeActorInventory(0, "PointsToAdd", 9999999);
PrintBold(s:"DEBUG: Points Added.");
}
And the problem I'm having is... with the math inside GiveActorInventory, it doesn't give the player the points. Replacing the function to give the player points with a solid number works just fine. I assume this is because "addPts * multPts" isn't a valid way to add those ints together, hence my question: If that is the case, how would I go about doing that then?