Stop Spawing???

drewshakdrewshak Member Posts: 2
edited July 2014 in Help Wanted

I am making a game where actors and spawning from the sky and falling down and for each actor caught the player gets 25 points. How do I make it so that after the player receives 500 points the spawner stops spawning, so I could add another spawner and increase the time so that the actors could fall faster. I used the tutorial by TshirtBooth to spawn my actors if that help, cause if u look at his spawn codes, mine are the exactly the same. ( "")

THANKS SO MUCH!

Comments

  • jigglybeanjigglybean Member Posts: 1,584

    You will need an change attribute so when the points = 500, turn the spawner off.

    I dont have time to watch the video, but if you are using a timer to spawn, the change attribute can be set timer to zero.
    Or, you can make a boolean on the spawner set to true (so it can spawn) and then change attribute when 500 points reached set spawner to false.

    Like Balls? Then click here! We've 100 coming soon

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    Rule: when points < 500: do your spawning.

  • drewshakdrewshak Member Posts: 2

    @jigglybean said:
    Or, you can make a boolean on the spawner set to true (so it can spawn) and then change attribute when 500 points reached set spawner to false.

    HOW DO I DO THIS???!! lol I'm not sure how to code this. If u can show me or find me a turorial that has this, that would be awesome!!!

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    I've never really understood the need to convert one event to another event to check to see if the first event happened ?

    For example, you want something to happen when a value passes 100, so you set up an attribute that checks whether this value has passed 100, and if it does pass 100 you make a change to that attribute (like a boolean going between true / false), and your rule is then triggered by this change in the attribute.

    I always think why not simply have the value passing 100 trigger the rule ?

    You see a lot of this one attribute triggering another attribute, I often think a lot of code is overly complex for what it achieves, maybe it's just a personal preference, I'm honestly just too lazy to wade through pages of attributes and dense rules when you can do the same thing with a couple of rules. :)

    Personally I'd just wrap your spawner in a rule that says 'when points < 500', but like I say maybe that's just my personal preference, the other method (passing one attribute over to a second attribute and checking that instead of the first) will work just fine too.

  • AfterBurnettAfterBurnett Member Posts: 3,474

    @Socks said:
    I've never really understood the need to convert one event to another event to check to see if the first event happened ?

    For example, you want something to happen when a value passes 100, so you set up an attribute that checks whether this value has passed 100, and if it does pass 100 you make a change to that attribute (like a boolean going between true / false), and your rule is then triggered by this change in the attribute.

    I always think why not simply have the value passing 100 trigger the rule ?

    You see a lot of this one attribute triggering another attribute, I often think a lot of code is overly complex for what it achieves, maybe it's just a personal preference, I'm honestly just too lazy to wade through pages of attributes and dense rules when you can do the same thing with a couple of rules. :)

    Personally I'd just wrap your spawner in a rule that says 'when points < 500', but like I say maybe that's just my personal preference, the other method (passing one attribute over to a second attribute and checking that instead of the first) will work just fine too.

    Yup, simpler is always better :)

  • drewshakdrewshak Member Posts: 2

    Is there any other ways of doing this??? Can anyone provide pictures or step by step instructions please? I just need this code to complete my game!!!!

Sign In or Register to comment.