Forum Contributor
Not sure why you would want to do this I suppose it would make the animation longer anyway there will be a way cus the psjs (playstation script) is pretty much the same as javascript except for some shortcuts and implementing external files from a directory etc.
Anyhow the way this script for animated themes works is the start tells the ps3 that the background image is an array of images. The middle of the script is mainly the setup to tell the ps3 what each function does and how. So if you look at the function "createIntervalTimer" (the timer for the whole script) at the bottom of the script. It says when the anim_length variable is complete do the "updatebackground" function.
You may not understand javascript so simply the script runs through each background image (array) at the anim_length then runs through again (updatebackground).
So to make certain background images (or frames in your case) longer you would have to split up the array by creating a variable for a longer length called anim_length2 and equal 2 seconds. Then put anim_length2 in the "createIntervalTimer" functions as an "if".
The "if" would be the frames you want to be longer. Say frame 10, 40, 70 and 100 you want anim_length2 then the updatebackground function.
So it may look like this:
function createIntervalTimer()
{
if (bg10, bg40, bg70, bg100)
{
System.timer[3] = new IntervalTimer(anim_length2, updateBackground);
updateBackground();
}
System.timer[4] = new IntervalTimer(anim_length, updateBackground);
updateBackground();
}
I have not tested this and probably won't either as I have no interest in doing this. The only thing that will make it harder for you is if the array cannot be split up like that then you would have to remove the array then make each frame a variable which would mean you need to put the variables in the script where the array name is.
I am still learning this so good luck and let me know if you achieve what you want and how you did it also
I wish I payed more attention in java class >:( lol
with my current set up the frames play at different speed but act very erratic and sometimes play backwars and then skip forwards. if you know a quick answer it would be nice but if you don't, don't spend a lot of time finding one, I have other ideas on how to achieve what I want.
My other idea was to add a delay in my animations by playing with the variation switch time, So every time the theme makes one cycle there is a five second delay at the end of it. i'd probably screw this up so if you know how to do it, could you please help me.
My current java script
var anim_length2 = 1.0;
var anim_length = 5.0;
var switch_time = 0.0;
var bg_current = -1;
var old_bg = bg_current;
var base_scale = background[0].scale;
function createIntervalTimer()
{
if (bg_current = 0, 1, 2, 3)
{
System.timer[3] = new IntervalTimer(anim_length2, updateBackground);
updateBackground();
}
System.timer[3] = new IntervalTimer(anim_length, updateBackground);
updateBackground();
}
Forum Contributor
Just a quick look at the first question (variance) you have repeated the System.timer[3] 2 different ways of course this might not be the case.
For the second question about the delay. I sort of achieved this at the start of my learning process. I created a variable called delay with the time I wanted then put it in the updateBackground function somehow. Something like this
function updateBackground()
{
if (bg_current >= 0)
{
//old one
old_bg = bg_current;
background[bg_current].setColor(hide_color, switch_time);
System.timer[1] = new OneShotTimer(switch_time, hideBackground, delay);
}
//next one
bg_current = calcBgIndex();
background[bg_current].scale = base_scale;
background[bg_current].setColor(base_color, switch_time);
}
Again I have not tested but you get the idea that each System.timer is made up from variables and functions.
Thanks for helping, I will try the delay way.
The variation way just isn't working for me and yes I tried making two different System.timer, one System.timer[3] and one System.timer[4] if thats what you meant, i also tried adding an else statement and rearranged things, and played with the variables but I've never been that great with java so i will attempt the other way.
Noticed this was post back in 2011. Did anyone ever find out if its possible to have a looped animation with delays or time variables?
I don't know jack about javascript but if its possible to do a pause or a delay I had a idea for a HD Five Nights at Freddy's animated theme.
1st frame is delayed for like 30 seconds at the work station (everything's normal), then frame 2-15 play normal speed of like 0.1 where a animatron jumps at you. Loop.
Forum Contributor
Forum Contributor
I haven't made exactly what you're talking about, but I sometimes add script based dynamics to my themes. I alterd a few scipts to create 3 tutorials also - Ultra Slideshow, Ultra Slideshow Lite, and the SlideFlow - based off of scripts made by Faxtron and GlowBall. I'm familiar with the script language, but those guys go deep with it.
1 Guest(s)