I'm in the process of developing a game in SL. The basic idea is that you will have a pet that gains experience (via a timer) whenever it is placed in-world. The pet would gain 'levels', like in most RPGs, and be able to attack other pets with varying chances of sucess. Here's what I have so far:
CODE
integer sec = 1;
integer counter = 0;
integer min = 0;
integer level = 1;
default
{
state_entry()
{
//Activate Timer when "Pet" is released
llSetTimerEvent(sec);
}
touch_start(integer total_number)
{
llSay(0, "Pet Paused.");
//llSetTimerEvent(0); Temporarily disabled.
}
timer()
{
counter = counter + sec;
min = counter / 60;
level = counter / 100;
llSetText("Your pet has " + (string)counter + " XP and is " + (string)min + " minutes old. \n Your Pet is level " + (string)level, <1.0, 1.0, 1.0>, 1.0);
}
}
As you can see, for every hundred seconds the pet is in the world, it gains a level. How would I make it so that the time requirement increases with each level? For example, level 1 takes 50 points, level 2 takes 100, then 200, 400, and so on.
Help would be greatly appreciated, and if you want to help with this project, please IM me.
I'm sure I'll have more questions as time goes on.
Thanks,
Parapsycho