playMaker

Author Topic: Int Multy test with "Grater than" (SOLVED)  (Read 951 times)

Stain Corb

  • Junior Playmaker
  • **
  • Posts: 69
Int Multy test with "Grater than" (SOLVED)
« on: January 29, 2020, 10:51:33 PM »
Hello all so It took me a really long time to find this Action and it is awesome. But I need it to be able to compare "Grater/Lower than" with all the ints.

https://hutonggames.com/playmakerforum/index.php?topic=2391.msg10601#msg10601

What I am doing. I am creating a crafting system with various different combinations say:
Element1 has 1 + Element2 has 3 + Element3 has 2 = Craft Sword

The problem with the Current action is that its unable to see if Elements are more than a specific Int, there fore, You may need 1 of some element but if you have 2 it wont work, (it compares exact int combinations), but it should be cause player only needs 1 of the 2 he contains.

I hope this makes sense. If any one has made a similar system I would love to know their solution.

The reason I want to have all these comparisons in one Action is be cause I am going to have to crate a crazy setup for one crafting element I plan to have many.
« Last Edit: January 30, 2020, 11:29:33 PM by Stain Corb »

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Int Multy test with "Grater than"
« Reply #1 on: January 30, 2020, 01:31:42 AM »
Unless you want to pay someone to write a custom action, I think you should give up on doing it all in one thing.

However, what about this for another solution:

State 1:
+ Int Compare VAR A to the minimum amount required.
  - Equal = blank
  - Over = blank
  - Under =  NOT ENOUGH transition

+ Int compare VAR B to the minimum amount required
  - Equal = blank
  - Over = blank
  - Under =  NOT ENOUGH transition

+ ETC for all INT variables

So in this system you are not checking if you have more than, you are seeing if you don't have enough. It will go down the line and check one by one and if it doesn't have enough for one, it transitions out to fail. If it has enough, it just moves on to the next one.

Now since you are looking for not enough, it will will reach the last int compare and just do nothing if there is enough. To have this final success transition, just do something like WAIT for 0.1, then transition to the success state. So just in case you don't get it, it will basically exit if it's not enough of anything (before the wait can take effect), or will otherwise time-out the wait because it did meet all the var minimums.

This doesn't work if you test for equal or over, because if you transition using that you will just do the first Var and skip the rest.... unless each one is placed in a different state that it flow through one by one.

Stain Corb

  • Junior Playmaker
  • **
  • Posts: 69
Re: Int Multy test with "Grater than"
« Reply #2 on: January 30, 2020, 08:44:18 AM »
I was thinking of actually doing this, I am going to try it out.

Thanks for reply :D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Int Multy test with "Grater than" (SOLVED)
« Reply #3 on: March 14, 2020, 04:22:16 AM »
Hi,

 yes, that's a good way to do this, it is sometimes a lot easier to make such states than create a custom action.

Bye,

 Jean