Jump to content


Photo

Start a timeline from gml


  • Please log in to reply
8 replies to this topic

#1 goldnoah

goldnoah

    GMC Member

  • New Member
  • 39 posts

Posted 29 October 2010 - 04:27 PM

It's the first time im using timelines, and i have no idea how to start a timeline in gml. I tried:
timeline_speed[timeline1] = 1;
timeline_running[timeline1] = 1;
but this didn't work :\

thanks
  • 0

#2 Medusar

Medusar

    GMC Member

  • GMC Member
  • 1228 posts
  • Version:GM:Studio

Posted 29 October 2010 - 04:43 PM

The manual (GM -> F1 key) tells us that you should use the timeline_index variable. This variable is local to the object you are currently in.
  • 0

#3 A saurus1

A saurus1

    GMC Member

  • Sandbox Moderators
  • 1609 posts
  • Version:GM8.1

Posted 29 October 2010 - 04:48 PM

So instead, try
timeline_index = *timelineName*
timeline_running = true;

  • 0

#4 Medusar

Medusar

    GMC Member

  • GMC Member
  • 1228 posts
  • Version:GM:Studio

Posted 29 October 2010 - 04:50 PM

timeline_running has nothing to do with it, it is not a built-in GM variable. You might want to set the speed to 1 though.
  • 0

#5 A saurus1

A saurus1

    GMC Member

  • Sandbox Moderators
  • 1609 posts
  • Version:GM8.1

Posted 29 October 2010 - 04:56 PM

timeline_running has nothing to do with it, it is not a built-in GM variable. You might want to set the speed to 1 though.

Uh...it is in GM8.
  • 0

#6 thatshelby

thatshelby

    GMC Member

  • GMC Member
  • 3823 posts
  • Version:GM8

Posted 29 October 2010 - 04:57 PM

PS: These kind of topics belong in the Novice Q&A.
  • 0

#7 goldnoah

goldnoah

    GMC Member

  • New Member
  • 39 posts

Posted 30 October 2010 - 09:34 AM

Thanks it worked
  • 0

#8 JeremyTorquoize

JeremyTorquoize

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8.1

Posted 17 March 2014 - 03:39 AM

Not for me. I can't figure out what I might have done wrong.

 

 
if abs(mouse_x-x)<203 and abs(mouse_y-y)<46
    {
    title_screen_options.visible=true
    title_screen_options.x=x+230
    title_screen_options.y=y+20
    image_speed=1
    if mouse_check_button_pressed(mb_left)=1
        {
        title_screen_options.option=stories
        timeline_index=global.options_exit
        timeline_running=true
        }
    if timeline_index=global.options_exit and timeline_position=9
        {
        timeline_position=0
        timeline_index=story_options
        }
    if timeline_index=story_options and timeline_position=6
        {
        timeline_position=0
        timeline_index=global.options_enter
        }
    if timeline_index=global.options_enter and timeline_position=6
        {
        timeline_position=0
        timeline_running=false
        }
    }
 
 
I tried to create the time lines from gml code in the room creation code.
 
instance_create(0,0,title_screen_options)
instance_create(270,250,stories)
instance_create(270,400,free_play)
instance_create(270,550,multiplayer)
instance_create(270,700,how_to_play)
 
global.option[1]=stories
global.option[2]=free_play
global.option[3]=multiplayer
global.option[4]=how_to_play
 
global.options_exit=timeline_add()
timeline_moment_add(global.options_exit,0,global.option[1].hspeed=120)
timeline_moment_add(global.options_exit,2,global.option[2].hspeed=120)
timeline_moment_add(global.options_exit,5,global.option[3].hspeed=120)
timeline_moment_add(global.options_exit,8,global.option[4].hspeed=120)
 
stories.story_options=timeline_add()
timeline_moment_add(stories.story_options,0,instance_create(843,250,Nats_story))
timeline_moment_add(stories.story_options,2,instance_create(843,400,Melonys_story))
timeline_moment_add(stories.story_options,5,instance_create(843,550,Olivias_story))
timeline_moment_add(stories.story_options,0,global.option[1]=Nats_story)
timeline_moment_add(stories.story_options,2,global.option[2]=Melonys_story)
timeline_moment_add(stories.story_options,5,global.option[3]=Olivias_story)
 
global.options_enter=timeline_add()
timeline_moment_add(global.options_enter,0,global.option[1].hspeed=-38.2)
timeline_moment_add(global.options_enter,2,global.option[2].hspeed=-38.2)
timeline_moment_add(global.options_enter,5,global.option[3].hspeed=-38.2)
timeline_moment_add(global.options_enter,8,global.option[4].hspeed=-38.2)
timeline_moment_add(global.options_enter,0,global.option[1].friction=1.27)
timeline_moment_add(global.options_enter,2,global.option[2].friction=1.27)
timeline_moment_add(global.options_enter,5,global.option[3].friction=1.27)
timeline_moment_add(global.options_enter,8,global.option[4].friction=1.27)

 

The main problem I have with all this is that the action portion of the timeline creation code is that it doesn't seem to do anything. The timeline's just there and the actions don't register or something. None of the objects are changing in speed when they need to. Can I get help with that too? I read the help menu thoroughly but I can't figure it out.


  • 0

#9 JeremyTorquoize

JeremyTorquoize

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8.1

Posted 17 March 2014 - 05:10 AM

I'm lead to believe that the gml timeline creation code just doesn't work. I do everything I'm supposed to and nothing happens. When I  create timelines within the game maker program, it works fine. I don't understand it. The time lines exist, the actions just aren't being executed.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users