About Monkey 2 › Forums › Monkey 2 Projects › RogueTable timelines (WIP)
This topic contains 2 replies, has 2 voices, and was last updated by 
 AdamStrange
 1 year, 8 months ago.
- 
		AuthorPosts
 - 
		
			
				
August 4, 2017 at 7:57 am #9725
OK, I’e got the very basic first version of timelines working:

Here you can see 2 timeline clips. the first is 300ms and the second is 600ms in millisecs.
The curves are all predefined (you just pick the one you want to use) you just set the time.
When triggered, they will return a value from 0 to 1. what you do with the value is up to you, but in this case both are mapped to a camerashake variable
the first is a quick fast decaying shake. like you might get from something heavy being dropped
the second gradually increases over a longer period of time
The key thing here is how they are managed. You set them up, then trigger them and they just work.
Here is the setup code:
Monkey1234'init any timeline systems and variables_cameraShake = myTimeline.Add( "CameraShake", TIMELINE_FALLDOWN, 300 )_cameraShake2 = myTimeline.Add( "CameraShake2", TIMELINE_FALLUP, 600 )the update code:
Monkey123'update the timelinemyTimeline.Update( _gameTime )and the code in use:
Monkey12my3d.SetView( xmap, 0.3+(Rnd(-0.4, 0.4)*(_cameraShake.Current+_cameraShake2.Current)), 0, xx, yy, zoom )ignoring most of the above code, you can get the list of it: a random factor controlled by the _cameraShake variables
Thoughts?
August 5, 2017 at 1:23 am #9729I love the curves philosophy you’re using, this keeps it abstract.
Would this be for minor cutscenes and effects? I can see this being used for particles too.
Nice work!August 5, 2017 at 5:03 am #9731it’s completely abstracted. How you use it would be up to you as it returns a float, you could use the float for anything.
Lets assume you have an object that moves from A to B and you know the time it takes to get from A to B. you could have a function to return the mix of AB given a float. a RAMPUP line would give you a transition from A to B, a RAMPDOWN form B to A. RAMPUPDOWN would go from A to B and back to A…
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.