http://fractalsoftworks.com/forum/index.php?topic=7164.0
all you need is there, get reading...
how2StarsectorModdingInOneWeekend
Spoiler
it can be done, but it will take at least a day or two of mad scientist level "must java, eat later, SLEEP LATER, COFFEE!!!!" if you want to get it to work as i imagine you do
searching the forums for answers to specific questions and borrowing ideas for how to do "X" from other mods also helps
(i play SOME mods mostly so i can pull their code and disect it for !!SCIENCE!!)
also get an IDE, i sudgest IDEA (http://www.jetbrains.com/idea/download/) just cause its java newbie friendly
once that is done, all thats left is to code what you want, pull a leaver and scream:
(http://www.sourballpython.com/blog/wp-content/uploads/2013/10/ItsAlive.jpg)
public class AAA implements YYYPlugin{
//declare you are using interval util
private IntervalUtil XXXTimer = new IntervalUtil(Minimum interval, Maximum interval); //in seconds
//is the timer on or off at the start of the game?
condition ZZZ =true/false ;
@Override
public void advance(float amount){
if (engine.isPaused()) //so it does not run while game is paused
{
return;
}
if (condition ZZZ == true) { //will only count time if some condition has been met
XXXTimer.advance(amount); //will count the time using "amount" wich is basicly frame duration
//in here also goes you code for while (condition ZZZ == true)
}
if (XXXTimer.intervalElapsed()) //timer has reached end
{
//your code when timer has ended
condition ZZZ = false; //optional, ends timing of events untill it is once again set to true
}
//if you need it to detect when something has happened to trigger the timer event
if (NNN = true) //condition that needs to be met for (condition ZZZ = true) only ocurs if (condition ZZZ == false)
//your code when timer activates
condition ZZZ = true; //activate timer
}
}
}
basics of how to use IntervalUtil