PrimoFernando 7 Posted March 23, 2015 Hello, I would like to know how can i retrive the exp of a skill that is being trained without specifying it in the code, for example getSkillTracker().getGainedExperience(Skill.STRENGTH) take out the Skill.STRENGTH and put a method to detect which skill is being trained? thanks
Chris 154 Posted March 23, 2015 Every loop of your code, determine which skill is being trained by difference of current xp and saved xp. Every time the xp increases, save it. Save the skill that increases so when no xp is gained, the script still knows which skill was previously increased.
PrimoFernando 7 Author Posted March 23, 2015 Every loop of your code, determine which skill is being trained by difference of current xp and saved xp. Every time the xp increases, save it. Save the skill that increases so when no xp is gained, the script still knows which skill was previously increased. thanks, can you give an example for combat skills, please?
Chris 154 Posted March 23, 2015 I'm not on my development computer, sorry If you're only doing combat, store HP, Attack, Strength and Defense in a structure. Each loop, retrieve the xp from the structure and check it against each skill. Whichever ones increased, those are the skills you're training.
Nuclear Nezz 2062 Posted March 23, 2015 Track all of them wee if one of them is > 0 xp gained, das the one you want. Unless it changes. Then do what chris said.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.