Just a quick heads-up from me, I love working with this nifty tool, but I felt something is missing, maybe my fix can be of help to others.
I needed the ability to check and see if two variables are not-equal, so I've changed this part of the code (game.js):
- Code: Select all
function checkRequirement(requirement) {
var requirementsSuccess = false,
reqVar = readVar(requirement.variable),
reqFunc = requirement.func,
reqVal = getRequirementValue(requirement);
if (reqFunc === '>' || reqFunc === '>') {
requirementsSuccess = reqVar > reqVal;
} else if (reqFunc === '=' || reqFunc === '==') {
requirementsSuccess = reqVar === reqVal;
} else if (reqFunc === '<' || reqFunc === '<') {
requirementsSuccess = reqVar < reqVal;
// hakkie start
} else if (reqFunc === '!=') {
requirementsSuccess = reqVar != reqVal;
// hakkie end
} else {
requirementsSuccess = false;
}
return requirementsSuccess;
}
See the "// hakkie" part where I made my changes, maybe it is helpful for others (and perhaps an idea for future version?).
This allows you to use the operators ">", "<", "=" and now also "!=" and so far it seems to work as intended.
Thanks again for the tool and happy creating guys.
