Rule to apply to many attributes!!! HELP!

Ok, so this may have already been mentioned, but I don't really know what to search for to check :/

-So what I want to do is make a general rule which can apply to many attributes (100 in total).
-An example of one of the 100 attributes is: 'game.timer-best 102' (102 refers to the world (1) and the level (2)
-I need a formula so that I have the general wording (game.timer-best ) and then adding on the specific level (of which I already have a working attribute for to determine this)

Is there a formula to do something like this?

Thanks for any help in advance ;)

Answers

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @JagonApps Just make another global integer attribute for the World and you'll have all the building blocks for what you want. So in the display Text Behaviour:

    "Best Time "..game.timer-best.." "..game.World.."0"..game.Level

    For the spaces in the expression editor, use alt-space.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • JagonAppsJagonApps Member Posts: 241
    @gyroscope thanks I'll give that a go!
  • JagonAppsJagonApps Member Posts: 241
    @gyroscope, I have realised that is not quite what I want

    The current statement I have (which works) is: floor(( game.timer-best %60)/10)..".png"

    BUT I want to replace 'game.timer-best' with a formula which could apply to any level, so something like:

    game.timer-best (game.currentworld * 100)+(game.current scene)

    This would then correctly refer to the relevant attribute for that scene.

    Is this possible?

    Thanks
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited February 2013

    Sure, you can have any equation you like, and change a single attribute from it; or a name of an image even, as your prev. example.

    So your example works fine - without any text for display - to change an integer attribute to give a number:

    game.timer-best = (game.currentworld * 100)+(game.current scene) is good that you've done, providing current world and current scene attributes are integers or real types. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • JagonAppsJagonApps Member Posts: 241
    @gyroscope, sorry I haven't explained it very well I think...

    What I want to do is get gamesalad to refer to a specific attribute depending on another attribute, without writing out the different variations for the rule 100 times over.

    So in this example, I want an image (the number relating to timer-best) to be constrained to the attribute timer-best, like this: floor(( game.timer-best %60)/10)..".png"

    BUT I have many timer-best attributes for each level, so I want the constrain rule to say that game.timer.best(game.currentworld * 100)+(game.current scene)

    So gamesalad goes to the attribute which relates to the particular level.


    Does that explain it any better??

    Thanks
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598


    Does that explain it any better??

    Thanks
    I think so...! So what you'd be after is:

    floor(( ((game.currentworld * 100)+(game.current scene)) %60)/10)..".png"

    Does that work out for you?

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • JagonAppsJagonApps Member Posts: 241
    edited February 2013


    Does that explain it any better??

    Thanks
    I think so...! So what you'd be after is:

    floor(( ((game.currentworld * 100)+(game.current scene)) %60)/10)..".png"

    Does that work out for you?
    Not quite I'm afraid, I want GS to be able to choose which game.best-timer attribute to use depending on which attribute (eg. game.best-timer 104) corresponds to the current world and scene: game.currentworld * 100)+(game.current scene) (which in an example would equal 104)

    Can this be done?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited February 2013

    I'm certain it can...it's just I'm still getting confused as to what you want.... sorry, it's me, not you.... I still don't understand your explanation....

    I hope another member is more awake than I am today/tonight who can help.....

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • JagonAppsJagonApps Member Posts: 241
    Thanks gyroscope, I can't really think of how else to explain it...
    bump?
Sign In or Register to comment.