Can you combine game attributes?

DigiChainDigiChain Member, PRO Posts: 1,288
edited November -1 in Working with GS (Mac)
Hi, by this I mean that I have 2 Game Attributes. One is integer and the text.

So, for example the integer att. reads - 4
and the text att. reads - RIGHT

Is there anyway to combine these values so that I could then tell an actor> When Attribute = 4,RIGHT etc.

This would save me an incredible amount of time and vastly cutdown on the rules I need to use.

Comments

  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Well... yes you can.
    You create a rule -

    RULE
    --------
    when attribute = 4
    AND
    when attribute 2 = Right
    -------

    You can add conditions just by clicking the plus sign on the right side of a rule.

    Giacomo

    P.S. I hope tht is what you meant
  • DigiChainDigiChain Member, PRO Posts: 1,288
    Thanks Giacomo - but that's not really what I'm after - because I'll have to create a new rule for ever combination of attributes.

    Whereas if I could combine them before creating the actor rule - I could then just have a rule stating if ANY conditions exist and then input the particular combinations (such as '5,RIGHT') that trigger that rule.

    Hope I'm making sense here.
  • ultimaultima Member, PRO Posts: 1,207
    change XXX to integerXX..textXXX hope u can read that right. the ".." symbol is what you need to combine text attributes..

    and you just check to see if the text attribute is exactly the same as...
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    @ChopperKhan yeah, I missunderstood. Try out what @ultima said, I don't know if it will work cause i never tried it. ;)
  • DigiChainDigiChain Member, PRO Posts: 1,288
    Sorry ultima - I know I'm being a bit stupid here, but I don't quite understand?
  • ultimaultima Member, PRO Posts: 1,207
    hope there an easier way to post the scripts...

    but i believe you can..

    first you set-up a change attribute
    xxx to integer..","..text

    xxx being your new text attribute
    integer being the name of your integer attribute
    and text being your text attribute...

    add a new rule that checks if

    xxx (your new text attribute) = "4,right"

    it works in my head but i haven't tried yet.
  • DigiChainDigiChain Member, PRO Posts: 1,288
    I'll give a go later and see if I have any luck. cheers!
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    @ultima I doubt that would work... I havn't ever seen anyone combine integers with text variables without using arrays... I might be wrong though... Test it.

    Giacomo
  • ultimaultima Member, PRO Posts: 1,207
    works, i just tested it.

    in a sense you can't combine them... because the end result is a text string.. but the idea is that you can check if one text string is the same as the other.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Cool, I stand corrected ;)
  • DigiChainDigiChain Member, PRO Posts: 1,288
    Still not really working for me-

    I'm displaying as text to see what it comes up with and its displaying:

    vars['game.attributes.id552420']

    ???
Sign In or Register to comment.