Author Topic: Duplicating the same step over and over in timelines  (Read 1598 times)

Ataosama

  • Cherry Eater
  • Posts: 60
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Duplicating the same step over and over in timelines
« on: August 14, 2015, 03:14:18 PM »
Hello, I would like to know if there is an easy way to duplicate a step a lot of times without having to create each step one by one for the timelines.

infern0man1

  • ~(=^・ω・^)ψ
  • Global Moderator
  • Oatmeal Killer
  • Posts: 1.021
  • Dear sir stroke madam, fire exclamation point
  • OS:
  • Linux Linux
  • Browser:
  • Chrome 44.0.2403.133 Chrome 44.0.2403.133
    • View Profile
    • Twitter
  • Playstyle: Keyboard
Re: Duplicating the same step over and over in timelines
« Reply #1 on: August 14, 2015, 04:24:47 PM »
I don't believe there is a way to do that without creating a new step.

Alternatively, you could create a main object and in the step event put:

Code: [Select]
step+=1;
switch(step){
  case [frame]:
    //stuff
  break;
}

Ths works exactly the same way timelines work and it's easier to copy and paste code from one step to another.

klazen108

  • Administrator
  • The Kid
  • Posts: 286
  • your a kid now your a squid now
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 44.0.2403.155 Chrome 44.0.2403.155
    • View Profile
    • Delicious-Fruit
  • Playstyle: Keyboard
Re: Duplicating the same step over and over in timelines
« Reply #2 on: August 14, 2015, 07:41:16 PM »
I highly recommend doing it the way Inferno said, that gives you a lot more freedom in being able to copy, paste, quickly scroll, search, etc.

If you're already too invested in a timeline, though, you could move the code you want to copy to a script, then have the steps call that script instead. Or you could do something like have the timeline set "alarm[0]=1" then have an alarm in the host object that fires the code you want at a certain interval.

Ataosama

  • Cherry Eater
  • Posts: 60
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Re: Duplicating the same step over and over in timelines
« Reply #3 on: August 15, 2015, 11:14:08 AM »
For the moment I make my timeline call other objects that fire the attack but I will see how to use your code infern0man1.

Thanks for your answers!