Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Using onlinetime or something similar... (https://forums.graalonline.com/forums/showthread.php?t=20948)

Oxy-Moron 01-12-2002 04:24 AM

Using onlinetime or something similar...
 
I've been toying around with the idea of a sort of exp system based off of onlinetime, but I'm having some serious trouble getting any thoughts relative to this from my NATs.

In principle, a player would make a class, and when made, it would set a flag in their account equal to their online time. Then when the player goes to some sort of shop (we'll call it an exp. shop just for sanity's sake), the shop's script compares the player's current online time to the time in the flag. It would find the difference between the two and give the player exp according to that amount (calculation still to be figured). The shop would then set the original online time flag to the player's current online time.

As far as I've heard, there probably isn't a command for detecting online time, so is there any way possible, if this is so, that a system could be rigged to work LIKE this without having timeouts run for 60 seconds and adding on, to prevent lag? (Like Mithica's horrible EXP system).

Any help would be much appreciated.

Kumada 01-12-2002 05:38 AM

Re: Using onlinetime or something similar...
 
Quote:

Originally posted by Oxy-*****
I've been toying around with the idea of a sort of exp system based off of onlinetime, but I'm having some serious trouble getting any thoughts relative to this from my NATs.

In principle, a player would make a class, and when made, it would set a flag in their account equal to their online time. Then when the player goes to some sort of shop (we'll call it an exp. shop just for sanity's sake), the shop's script compares the player's current online time to the time in the flag. It would find the difference between the two and give the player exp according to that amount (calculation still to be figured). The shop would then set the original online time flag to the player's current online time.

As far as I've heard, there probably isn't a command for detecting online time, so is there any way possible, if this is so, that a system could be rigged to work LIKE this without having timeouts run for 60 seconds and adding on, to prevent lag? (Like Mithica's horrible EXP system).

Any help would be much appreciated.

not that hard.. i could do it when i have the time

TDO2000 01-12-2002 06:02 AM

use a counting var in a timeout in your system NPC...
so u just refresh the time string every 10 seconds and there is no big lagg...

Warcaptain 01-12-2002 08:32 AM

Quote:

Originally posted by TDO2000
use a counting var in a timeout in your system NPC...
so u just refresh the time string every 10 seconds and there is no big lagg...


erm.....
or just use timevar..

this.second=int(timevar)%60;
this.minutes=int(timevar/60)%60;

that will give seconds and minutes.

figure the rest out from there, im not your ***** ;)

Slaktmaster 01-12-2002 08:54 AM

Timevar is server onlinetime.

Warcaptain 01-12-2002 09:10 AM

ok then..

use the var i did b4
then do..

onlinetime=(int(timevar)%60)-this.second;

Shard_IceFire 01-12-2002 10:29 AM

Quote:

Originally posted by Slaktmaster
Timevar is server onlinetime.
Yes but it works offline too, so you could still be able to test the NPC to some extent.

Warcaptain 01-12-2002 11:54 AM

he meant time for server, not player, but i fixed it

grim_squeaker_x 01-12-2002 07:55 PM

Quote:

Originally posted by Warcaptain
ok then..

use the var i did b4
then do..

onlinetime=(int(timevar)%60)-this.second;

That would mean everyone has the same online time :/

Anyhow...
NPC Code:
if (playerenters&&!(hasweapon(-OnlineTimeSystem))) toweapon -OnlineTimeSystem;
//#CLIENTSIDE
if ((created||timeout)&&isweapon) {
setstring client.seconds,#v((strtofloat(#s(client.seconds))+ 0.05)%60);
if (strtofloat(#s(client.seconds))==0) {
setstring client.seconds,#v(strtofloat((#s(client.minutes))+ 1)%60);
if (strtofloat(#s(client.minutes))==0) setstring client.hours,#v(strtofloat(#s(client.hours))+1);
}
timeout=0.05;
}

Would be an acceptable way of easily keeping track of the online time a player has, though it would reset if the player's account is reset.

LilNiglet 01-15-2002 07:31 AM

Quote:

Originally posted by grim_squeaker_x
That would mean everyone has the same online time :/

Anyhow...
NPC Code:
if (playerenters&&!(hasweapon(-OnlineTimeSystem))) toweapon -OnlineTimeSystem;
//#CLIENTSIDE
if ((created||timeout)&&isweapon) {
setstring client.seconds,#v((strtofloat(#s(client.seconds))+ 0.05)%60);
if (strtofloat(#s(client.seconds))==0) {
setstring client.seconds,#v(strtofloat((#s(client.minutes))+ 1)%60);
if (strtofloat(#s(client.minutes))==0) setstring client.hours,#v(strtofloat(#s(client.hours))+1);
}
timeout=0.05;
}

Would be an acceptable way of easily keeping track of the online time a player has, though it would reset if the player's account is reset.

Wow, really good! We think we may use that, with your permission, of course...

Oxy-Moron 01-15-2002 08:54 AM

Wow.. sorry for not responding to here for a while, but I've been pre-occupied lately (ie. doing damn near everything for Delteria. That time system, Squeaker... simple efficient and really rather nice. So, with your permission, could I use that code for the EXP system I'm creating? Full credit would be given to you for the timer. ^^

Boozy_Bravo 01-15-2002 08:58 AM

I don't think going by onlinetime for anything is a good idea. :(

Oxy-Moron 01-15-2002 09:20 AM

It's a work in progress... again, these are just ideas. Once we get everything finished, we DON'T want Delteria to be known as a newbie PK server, so we AREN'T going to give Experience for player killing. So I feel that the best basis for experience that I can come up with for now is online time...

grim_squeaker_x 01-15-2002 07:17 PM

Feel free to use it. :)

Boozy_Bravo 01-16-2002 06:16 AM

Quote:

Originally posted by Oxy-*****
It's a work in progress... again, these are just ideas. Once we get everything finished, we DON'T want Delteria to be known as a newbie PK server, so we AREN'T going to give Experience for player killing. So I feel that the best basis for experience that I can come up with for now is online time...
You can think of something else, just script everything for onlinetime now, untill you find a better away. :)

And PK'ing is one of the funnest things on graal. :D

Oxy-Moron 01-17-2002 03:19 AM

Quote:

Originally posted by Boozy_Bravo

You can think of something else, just script everything for onlinetime now, untill you find a better away. :)

And PK'ing is one of the funnest things on graal. :D

I agree x.x But since Delteria has such a bad name, we're trying hard to pull a complete 180 now that Ice is gone.. Err, anyway this has gone off topic.

Fixed a few slight flaws, and with the help of Nyght, got a rough EXP system up and running based around onlinetime. Thanks again Grim :)

Ultima_P2P 01-17-2002 09:51 PM

Ultima is posting this message for Chicken!

Chicken Says:

Like delteria is liek the Noob Factory it will neever Become Un-Nooby it's been Nooby Since it got up Like almost everyone there Uses Npcs and Pauses I Got like Alota deaths by stupid Npcs and crap Omg and Using Online time for Exp omg like total Lameness how Dull And Saying pking For exp is for Noobs lool Hell no fool!!

[Ultima has no affiliation with any messages or disturbances posted in this post]

Saga2001 01-18-2002 01:05 AM

Though it sounds like a good system you should decide if you want to do hours or not, and maybe you could do an age script!!! that would be ub3r leet, and your appearance changes...somehow...that would be a fun server to work on p2p or no?


All times are GMT +2. The time now is 08:29 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.