Jump to content


Photo

How To Make A Timeline Work


  • Please log in to reply
5 replies to this topic

#1 Magdiel

Magdiel

    GMC Member

  • New Member
  • 161 posts

Posted 12 April 2008 - 06:11 AM

Okay, I want to add a boss to my game, the problem is that unlike the enemies I have created, he doesn't just do 1 thing over and over again.
I need the boss to be almost as complex as the character.

So I decided to see if a timeline would help, but I don't know anything about timelines at all.
Unless there's is another way to make this work, I need to figure out how timelines activate, repeat themselves, and go through all of it's steps.

So basically,
Can someone give me an example on how I could make a time line activate, and repeat itself the way I need.

Further information:
My game is a top view: looking at it from the top
The movement is cached(probably the wrong word), so he moved exactly with the 16,16 gridding of the room.

I need to make a timeline that goes through these steps: After hurt=true
Move=false
Visible=false
Visible=true
Visible=false
Visible=true
Visible=false
Visible=true
Visible=false
Visible=true
Move=true and hurt=false

This needs to happen everytime the boss gets attacked.

Also I need to make it so that the boss will go through steps for attacking if move=true
I can probably figure that part out based on an example for the damaged one, if not I'll ask after an example is put.

Edited by Magdiel, 12 April 2008 - 04:50 PM.

  • 0

#2 headline@live.se

headline@live.se

    GMC Member

  • New Member
  • 1298 posts

Posted 12 April 2008 - 06:25 AM

if you make a new timeline, you see that its almoast as an object... the diffrences is that you instead of evenst put how many steps that will go after the timeline is executed... and then you execute the timeline via the object... you can have diffrent timelines for diffrent situations :)

Edited by headline@live.se, 12 April 2008 - 06:26 AM.

  • 0

#3 blaketheawesomedude

blaketheawesomedude

    GMC Member

  • New Member
  • 295 posts

Posted 12 April 2008 - 06:25 AM

mke a timeline and that does those things and have it be done when the boss is attacked
  • 0

#4 Magdiel

Magdiel

    GMC Member

  • New Member
  • 161 posts

Posted 12 April 2008 - 06:43 AM

Okay, I tryed making the timeline and it didn't repeat itself also it made the boss stop getting hurt.
Here's how I wrote it:

In the boss's creation event myhurt=false
In the attack's collision with the boss
with(other)
if myhurt=false
{
global.testbosshp-=global.normatk
myhurt=true
timeline_index=testbosshurt
}

Then in timeline testbosshurt this is how it's set up:
Step 0:
moving=false
visible=false
Step 5:
visible=true
Step 10:
visible=false
Step 15:
visible=true
Step 20:
visible=false
Step 25:
visible=true
myhurt=false

This works the first time, then after getting hit again, the bosses hp goes down, but the timeline doesn't activate.
And any time after that, the time line doesn't activate and the boss stops taking damage.
  • 0

#5 Magdiel

Magdiel

    GMC Member

  • New Member
  • 161 posts

Posted 12 April 2008 - 04:08 PM

BUMP, can someone tell me what's wrong with the codes above?
I really need to fix this to add a boss AI.
It won't repeat itself.

EDIT: Okay I've figured it out, it wouldn't repeat itself because I hadn't set the timeline_position when I activated the timeline.
So it would go through once but not start back again a 0.
Now I got it to work, I just need to make one for attacking lol.

Edited by Magdiel, 12 April 2008 - 04:52 PM.

  • 0

#6 McLovin

McLovin

    GMC Member

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

Posted 30 March 2014 - 08:02 AM

Damn i cant get timelines to work....  "add timeline to object"  everybody say hmmm

ok i have an object,- in the object i have "create" and added the code

 

timeline_index=timelin  (name of the timeline)

timeline_add()
 
the object i place in the gameroom but nothing happens
 
(in the timeline at step 30 i just create an instance at 200,200)
 
huh it makes sense but dont work hm maybe ive forgotten something?
 
EDIT:  got it to work,, forgot "true"......
timeline_index = timelin
timeline_running = true
 

 

 

 

BUMP, can someone tell me what's wrong with the codes above?
I really need to fix this to add a boss AI.
It won't repeat itself.

EDIT: Okay I've figured it out, it wouldn't repeat itself because I hadn't set the timeline_position when I activated the timeline.
So it would go through once but not start back again a 0.
Now I got it to work, I just need to make one for attacking lol.


Edited by McLovin, 30 March 2014 - 09:06 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users