Problem with increamenting an attribute!

asemarabasemarab Member, PRO Posts: 4
edited November 2016 in Working with GS (Mac)

I'm trying to increament an attribute value by 1 every second, but it always incrementing by 2 every 2 seconds, I never have an odd number, I'm using this formula: game.swichSpawner +1, could anybody clarify what is wrong with this?

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    @asemarab said:
    . . . it always incrementing by 2 every 2 seconds, I never have an odd number . . .

    How can you tell ?

  • asemarabasemarab Member, PRO Posts: 4

    @Socks said:
    How can you tell ?

    I don't understand

  • SocksSocks London, UK.Member Posts: 12,822

    @asemarab said:

    @Socks said:
    How can you tell ?

    I don't understand

    I mean how can you tell that 'it always incrementing by 2 every 2 seconds [and] I never have an odd number' ?

  • SocksSocks London, UK.Member Posts: 12,822

    Also . . . . I've never really got the thing where an attribute that already exists is duplicated ? You see a lot of this on the forums.

    Here you are using a rule, a behaviour (or action) and a timer simply to duplicate the clock attribute that already exists.

    You are saying . . . 'when this attribute (called time) increases by 1, then change this other attribute (called switch.Spawner) by 1' . . . but if you want something that changes by 1 every second then there is no need to make it as it already exists, the game's clock already increases by 1 every second, effectively all that these rules and timers are doing are changing the name of the 'it goes up by 1 every second' function from 'time' to 'switch.Spawner'.

    Hope that makes sense !

  • JapsterJapster Member Posts: 672
    edited November 2016

    ...and @asemarab are you absolutely sure that you only have 1 instance of the actor in question in your scene? - if you have it in your scene twice, it looks like it'll do what you're seeing? (unless your minimised rules have the same rule in there too?)

    ie. 2 actors would each fire off the rule, making it increment in 2's every second or so (+/- hundredth's of a second apart, for each actor) - is it deffo happening every 2 seconds, and not every 1? :smile:

    Maybe use the SCENE tab, and LAYERS explorer, to confirm, if one's invisible/off-screen/behind the other?

  • ToqueToque Member Posts: 1,188

    I make an actor and just use a Display text in it. Drag it on the scene. I like to see the game attribute changing and know visually whats going on.

  • asemarabasemarab Member, PRO Posts: 4

    @Japster said:
    ...and @asemarab are you absolutely sure that you only have 1 instance of the actor in question in your scene? - if you have it in your scene twice, it looks like it'll do what you're seeing? (unless your minimised rules have the same rule in there too?)

    ie. 2 actors would each fire off the rule, making it increment in 2's every second or so (+/- hundredth's of a second apart, for each actor) - is it deffo happening every 2 seconds, and not every 1? :smile:

    Maybe use the SCENE tab, and LAYERS explorer, to confirm, if one's invisible/off-screen/behind the other?

    That is exactly the case, thank you all guys.

Sign In or Register to comment.