how to use interpolate as a timer

1UpGamestudio1UpGamestudio Member Posts: 213
edited November -1 in Working with GS (Mac)
Hello everyone, I would ask how to use interpolate as a timer?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Say you want have an action 1 second after an impact

    You would have a rule
    When Overlap or collide change game.action to 1 for a duration of 1 sec

    Then a rule when game.action is 1
    --Animate explosion
  • 1UpGamestudio1UpGamestudio Member Posts: 213
    I would like to use interpolated for example to create an object every 5 seconds
  • DrGlickertDrGlickert Member Posts: 1,135
    Here's how I do my "Interpolated Timers"

    I have a self.attribute on the spawn actor. Let's call it Self.Spawn, make it an integer and set it's value at 0.

    Then in the behaviors, you'll have 2 rules;
    RULE: If attribute self.spawn is = 0; Interpolate self.spawn to 1, duration: 5 seconds.

    RULE: If attribute self.spawn is = 1; Spawn actor, and Change attribute self.Spawn to 0.

    That seems to be working for me now.

    Good luck!
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    DrGlickert said:
    Here's how I do my "Interpolated Timers"

    I have a self.attribute on the spawn actor. Let's call it Self.Spawn, make it an integer and set it's value at 0.

    Then in the behaviors, you'll have 2 rules;
    RULE: If attribute self.spawn is = 0; Interpolate self.spawn to 1, duration: 5 seconds.

    RULE: If attribute self.spawn is = 1; Spawn actor, and Change attribute self.Spawn to 0.

    That seems to be working for me now.

    Good luck!

    Thanks dude! im creating a game with a LOT of Timers, and this will help a lot Performance!

    Cheers :D

    _____________________________________________________
    image
    imageimageimageimage
  • 1UpGamestudio1UpGamestudio Member Posts: 213
    thanks
  • GamersRejoiceGamersRejoice Member Posts: 817
    Ya, this could really help my game too. I must try this. If only I was at home. :(
  • 1UpGamestudio1UpGamestudio Member Posts: 213
    No, i dont understand.
    DrGlickert send me an example please!!!
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    It is not working for me :( I Followed the instructions, but it Never changes to 0 again, not sure why! I have tried a lot of different ways.

    I have a rule When self.spawn is 0 interpolate Self spawn to 1 (Random time)

    Then another one, when Self.spaw = 1, Spawn Actor, Then change Attribute Self.spawn to 0.

    It just Spawn Once.
    _____________________________________________________
    image
    imageimageimageimage
  • DrGlickertDrGlickert Member Posts: 1,135
    1UpGamestudio said:
    No, i dont understand.
    DrGlickert send me an example please!!!

    I'll make a quick thing for you. What is your email? Or send me a message with your email address and I'll send it to you.
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    I want it 2 please, magonicolas@gmail.com
  • 1UpGamestudio1UpGamestudio Member Posts: 213
    1upgamestudio2010@gmail.com
  • DrGlickertDrGlickert Member Posts: 1,135
    Hmm, it's not working for me either. I'll have to look through my various templates and games to see where I got this to work...

    Give me a little bit to figure it out. Unfortunately, my GF is coming over. She wants to spend some time with me, blah blah blah... So I'll have to go soon.
  • DrGlickertDrGlickert Member Posts: 1,135
    Okay, I got it figured out;

    Add a rule to this stuff.
    When SpawnActor Overlaps or Collides with actor of type SpawnedActor (notice, spawnEDactor) then Change Attribute self.spawn Actor to 0.

    This will give it a constant updating and will always reset to 0, then interpolating it to 1, and then spawning a new actor. Emails on the way!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    nice job doc, ya learning :D
  • DrGlickertDrGlickert Member Posts: 1,135
    Yeah I am! I'm almost good at this ;-)
  • steve86steve86 Member Posts: 806
    Interpolate is the next best thing since slice bread and the iphone
Sign In or Register to comment.