Conditional Branch+

● ARCHIVED · READ-ONLY
Started by mjshi 99 posts Page 4 of 5 View original ↗
  1. @mishakoc You're very welcome, I'm happy it's been useful c:
  2. Hi, sorry if this is necroposting.
    I've read through the helpfile multiple times, but I don't know if I'm missing it or not.

    I was wondering if there is a way to check if the value of a given variable is greater than the values of multiple other variables.
    For example, if variable1= 10, is there a way to make it so that the result only happens if variable1's value (10) is greater than the values of variables 2, 3, or 4?
    Sorry if I'm not being clear, or if it has already been described. So far, I'm only able to see that it can check if the variable is a constant value. The traditional editor lets you compare only one variable's value to the variable in question, but not multiple.

    Thanks, and sorry again if it is unclear, or goes against rules.
  3. @w.alexander
    No, no, not necroposting at all. It's a pretty quick add (currently writing it now), but I couldn't think of a better name than Check.vgreater(....). Any suggestions on what the function should be called?
  4. mjshi said:
    @w.alexander
    No, no, not necroposting at all. It's a pretty quick add (currently writing it now), but I couldn't think of a better name than Check.vgreater(....). Any suggestions on what the function should be called?
    I think Check.vgreater(....) is good. I'm no coder at all, but as long as it allows to compare one variable to multiple other ones at the same time (rather than doing it 1 by 1 or only by a constant value). I figured out a way to do it with default editor, but it is pain and makes wall of text. Thanks for the response. I'll look forward to seeing the new function added. :)
  5. @w.alexander Aww, you're welcome! That's very kind of you, there's no need for it at all but I really do appreciate the gesture c:

    I don't have a Patreon (yet...), but if you like, you can send donations via my PayPal. I usually don't make the link super public (because identity scraping bots are a force to be reckoned with) but I've sent the link to you privately in PM if you decide you really wanna send something my way ;p
  6. Awe yea this is perfect for a crafting system I was making. I originally did it through the player loses x items and gains x skill. problem is I think that can put the player into the negative. So this should be a more efficient way to run the check.
  7. Hi, thanks for this plugin! I've tried to replace the more convoluted coding I did, but I must have made a mistake.

    Can 'Check.in_range' be used to see if one variable is between two values/numbers? If not, how would I handle that? Do I simply have to create another variable and set it to change both variables at the same time?
    (I tried using 'Check.any_inrange' with the variable I need and an extra one set to a number that would never be between the values checked, but I had the same result, the event didn't function.)

    If this normally works I made a mistake somewhere else (unrelated to your script), so I haven't posted the rest of the 'code' yet. This is probably it, but I thought I'd check.
  8. @AndromedaFr
    Does combining Check.greater and Check.lesser work for you? Ex. Check.greater(1, 5) && Check.lesser(1, 10) to check if 5 <= variable 1 <= 10.
    Otherwise, I'll investigate to see if this is an issue as soon as I'm free.

    (edit: also, make sure you're getting this from github and not dropbox! dropbox may be a little outdated.)
  9. mjshi said:
    @AndromedaFr
    Does combining Check.greater and Check.lesser work for you? Ex. Check.greater(1, 5) && Check.lesser(1, 10) to check if 5 <= variable 1 <= 10.
    Otherwise, I'll investigate to see if this is an issue as soon as I'm free.

    (edit: also, make sure you're getting this from github and not dropbox! dropbox may be a little outdated.)

    Sorry, it took a while, but I've finally gotten the chance to correct things! Everything is in working order. And it's so much easier to deal with this without all the nesting. Your plugin is brilliant! I can't thank you enough!
  10. @mjshi Hey, would it be possible to mod this plugin to check other inconvenient-to-get hidden variables like player direction and x or y coordinates?


    EDIT: I have experience programming, but not with javascript, and was thinking of taking a stab at doing a mod, but I figured you might have some insight as to whether that's worth doing in the first place, or if I'd just be barking up the wrong tree...
  11. @Benevolentwanderer Sure, go ahead if you'd like! Feel free to contribute, or submit pull requests to GitHub.
    Those shouldn't be too hard to add, I just don't have the time at the moment to add them.
  12. Hey, quick question. Would you be able to take a look at the conditional branch script I'm trying to get working, and let me know what I'm doing wrong?

    I'm trying to check if any of variable 486-490 are equal to 0 or 1 (although, if there's a way to just check if any of them are equal to 0 instead, please let me know!).

    Check.any_inrange(486, 487, 488, 489, 490, 0, 1)
  13. Vis_Mage said:
    Hey, quick question. Would you be able to take a look at the conditional branch script I'm trying to get working, and let me know what I'm doing wrong?

    I'm trying to check if any of variable 486-490 are equal to 0 or 1 (although, if there's a way to just check if any of them are equal to 0 instead, please let me know!).

    Check.any_inrange(486, 487, 488, 489, 490, 0, 1)
    That looks right, you can just do Check.any_inrange(486, 487, 488, 489, 490, 0, 0) instead though if you just want to check for 0!
  14. Thanks for the quick reply! :kaoblush:

    Hmm, maybe I'm just a bit confused. I used the script you listed, but it ended up doing the opposite of what I was expecting. Instead of returning true is any of those variables is equal to 0, it instead returns true if any of those variables is not 0.
  15. Thank you, using the new Check.any_is seems to be work great!
  16. Question.
    Check.has_more(~*items, number)
    -- EX: Check.has_more(1, 2, 3, 4, 5)
    ** the last number in this is # of items you want the system to look to see if player has?
  17. EAP said:
    Question.
    Check.has_more(~*items, number)
    -- EX: Check.has_more(1, 2, 3, 4, 5)
    ** the last number in this is # of items you want the system to look to see if player has?

    Yep! So in that example you'd want to see if the player has more than 5 of items 1, 2, 3, and 4.