I've looked through the forum and I haven't seen anything on this. So here's the issue I have a Dialog box to report what item was just found. I can't figure out how to put my screen shot on here so I'll just type it.
set startingvar = number of item in inventory(we'll say this is 0 for the example)
change item + 1
Set newtotalvar = number of item in inventory(this should be 1 )
if startingvar not equal to 0
newtotalvar = newtotalvar -startingvar
end
Text:
\v[ newtotalvarnumbe] item was found ! (this works and reports a 1 as the var value)
So what's the issue?
If I use the number of a armor or weapon I get a value of 0 every time. It's not setting the value to anything.
Please provide screenshots of the event code you're using. That is a lot better and your description is unclear in several points, we need to see your event code itself to find the errors.
That said, from what you wrote it's clear why you get a zero - you're setting the newtotal to the starting value, and if the starting value is not zero you substract the starting value from newtotal. That will always result in zero as you substract the starting value from a variable that is set to the same value.
It only fires the if if the starting var is NOT 0 if the starting value is 0 it will not substract anything. The starting value is only set once at the begin.
easy example:
You have 2 apples
I store you have 2 apples(var1)
I give you 1 apple
You now have 3 apples
I store you have 3 apples(var2)
I then report var 2 - var 1
in this case it would be 1.
Then please give screenshots of your events - because somewhere in the line you're using a wrong command, and we need to see what you really placed in the event, not what you believe to have placed there.
What plugins do you have?
I assume "Items I Had" is the name of a variable - but you don't define that variable in these events, so it depends on where it is defined.
And it is different from what you wrote in the texts above - there you wrote that the conditional branch would check the first variable, but in reality you're checking a completely unconnected third variable if that is not zero.
Please post screenshots where that variable is defined as well as the events or skills that are calling those two common events.
Additionally, please don't crop screenshots - for determing which event is called where the ID of the event may become important.
YEP_CoreEngine
YEP_BattleEngineCore
YEP_AutoPassiveStates
Yep_BattleAICore
Yep_SkillCore
Yep_MessageCore
Yep_EquipCore
Yep_itemCore
Yep_EventChasePlayer
Yep_X_SkillCooldowns
in that order.
Updating the script fixed it. Thank you for your help