Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Login Alert for Idle RCs (https://forums.graalonline.com/forums/showthread.php?t=46818)

TribulationStaff 08-05-2003 11:56 PM

Login Alert for Idle RCs
 
Considering how many people, including me, have suggested that they want some sort of way to prevent missing people while RC is minimized, I thought I would script up something. All servers are welcome to use this. Just stick it in your NPC server. To activate it, just type /npclogins in your rc chat.

NPC Code:

if (rcchat)
{
if (strequals(#p(0),logins))
{
timeout=1;
setstring this.alert,accountnames,here;
this.oldcount=allplayerscount;
}
}

if (timeout)
{
if (this.oldcount<allplayerscount)
{
for (this.i=0;this.i<allplayerscount;this.i++)
{
with (allplayers[this.i])
{
if (lindexof(#a,this.alert)!=-1)
{
sendpm A player logged in;
}
}
}
this.oldcount=allplayerscount;
}
if (this.oldcount>allplayerscount)
{
this.oldcount=allplayerscount;
}
timeout=1;
}


voicedcow6666 08-06-2003 12:03 AM

Congradulations, a new way to help lag the control-npc. :rolleyes:

TribulationStaff 08-06-2003 12:06 AM

Once a second isn't too bad, and all it does is check one variable - nothing too laggy at all. If you are really concerned about lag change the timeout to every 5, or even 10 seconds.

voicedcow6666 08-06-2003 12:10 AM

You should NEVER have a timeout in the control-npc, ESPECIALLY a never-ending one.

Python523 08-06-2003 12:10 AM

Quote:

Originally posted by TribulationStaff
Once a second isn't too bad, and all it does is check one variable - nothing too laggy at all. If you are really concerned about lag change the timeout to every 5, or even 10 seconds.
timeout loops on the control-npc aren't really good for the server, since the control-npc does a lot for the npc server (which is why the NPC Server goes down if you kill the control npc)

TribulationStaff 08-06-2003 12:22 AM

I would appreciate if someone would explain why instead of just saying don't do it. My CPU time on the control npc is less than a twentieth of a second.

voicedcow6666 08-06-2003 12:27 AM

Jagen said why.

And I personally don't like it when the Control-NPC is even in the top 10.

TribulationStaff 08-06-2003 12:33 AM

He said it was bad, that is a little vague.

Additionally, if timeout is so bad for the control npc, why isn't it just disabled?

voicedcow6666 08-06-2003 12:39 AM

Quote:

timeout loops on the control-npc aren't really good for the server, since the control-npc does a lot for the npc server (which is why the NPC Server goes down if you kill the control npc)
And why should they disable it in the control-npc? You have people telling you it's bad, so if you do it it's your own fault. *shrugs*

TribulationStaff 08-06-2003 12:46 AM

Lots of people say lots of things are bad, it doesn't mean they 100% right 100% of the time. I do not think it is unreasonable to ask for the reasoning behind dubbing timeout "bad" for the control npc.

voicedcow6666 08-06-2003 01:32 AM

Quote:

Originally posted by TribulationStaff
Lots of people say lots of things are bad, it doesn't mean they 100% right 100% of the time. I do not think it is unreasonable to ask for the reasoning behind dubbing timeout "bad" for the control npc.
Never once did I say it was "bad" to ask why you shouldn't use timeouts in the control-npc...we friggin pointed it out...because it's a primary part of the npc server.

And never said I was 100% right 100% of the time...simply said it's a bad idea. Jagen is a damn good scripter, I'm a pretty good scripter....both of us are saying it's a bad idea. You should think about that...

TribulationStaff 08-06-2003 02:49 AM

But how does being part of the NPCServer have anything to do with it?

Kaimetsu 08-06-2003 03:01 AM

Two points.

1) Nobody has actually answered Giltwist's question. Yes, it's an integral part of the NPC Server. So?
2) Giltwist is a pretty darn good scripter too. In this case, you can't pull the 'I am better than you so just listen to me' card.

voicedcow6666 08-06-2003 03:16 AM

Quote:

Originally posted by Kaimetsu
Two points.

1) Nobody has actually answered Giltwist's question. Yes, it's an integral part of the NPC Server. So?
2) Giltwist is a pretty darn good scripter too. In this case, you can't pull the 'I am better than you so just listen to me' card.

1) It's a vital part of the NPC Server, as jagen said, and a timeout in something like that is bad. Any lag that the control-npc gets can help add more lag throughout the rest of the server.

2) I never said I was a better scripter than he, I simply said Jagen is a good scripter, and I'm a pretty good scripter, and that when two people who are both pretty good at something, especially Jagen, is most likely correct, since he was basically saying we were wrong with this 100% thing.

TribulationStaff 08-06-2003 03:18 AM

Quote:

1) It's a vital part of the NPC Server, as jagen said, and a timeout in something like that is bad. Any lag that the control-npc gets can help add more lag throughout the rest of the server.
I also told you I checked the CPU time, there is virtually no lag from this script.

adam 08-06-2003 03:33 AM

If your so concerned with lagging stuff, stick the script in another npc? heh

Just change the rc chat part.

draygin 08-06-2003 03:48 AM

Quote:

Originally posted by voicedcow6666


1) It's a vital part of the NPC Server, as jagen said, and a timeout in something like that is bad. Any lag that the control-npc gets can help add more lag throughout the rest of the server.

I say adding scripts to the server is bad. Because after all they will lag down the rest of the server and cause it to run slower than if it had no scripts at all and since I said it I must be right. After all there is no need to question what people tell you when its much easier for them to spoon feed it to you and you to follow it with out question. :)

No more scripts!

I bet you believe in santa claus.

voicedcow6666 08-06-2003 03:56 AM

Quote:

Originally posted by draygin


I say adding scripts to the server is bad. Because after all they will lag down the rest of the server and cause it to run slower than if it had no scripts at all and since I said it I must be right. After all there is no need to question what people tell you when its much easier for them to spoon feed it to you and you to follow it with out question. :)

No more scripts!

I bet you believe in santa claus.

That was probally the most ignorant thing I've ever saw posted on these forums. :)

If you noticed, I made a point about the control-npc being a vital part of the npc server....

Oh, and I do believe in Santa Clause...In fact, he's my dad. :)

draygin 08-06-2003 03:57 AM

Quote:

Originally posted by voicedcow6666


That was probally the most ignorant thing I've ever saw posted on these forums. :)

If you noticed, I made a point about the control-npc being a vital part of the npc server....

Oh, and I do believe in Santa Clause...In fact, he's my dad. :)

I would rather have Sarcasm taken for Ignorance than blindly follow what every one tells me with out knowing exactly why something is bad just that *gasp* it is.

So just because its a vital part of the server then doing anything with it is bad? That says absolutly nothing other than you think something is bad because some one else told you but yet you have no idea why.

Kaimetsu 08-06-2003 03:57 AM

Quote:

Originally posted by voicedcow6666
1) It's a vital part of the NPC Server, as jagen said, and a timeout in something like that is bad. Any lag that the control-npc gets can help add more lag throughout the rest of the server.
Why? How will spending a few microseconds every once in a while change anything? Why will it change anything? How is it worse for the NPC to be spending those microseconds on a timeout and not a long actionplayeronline?

Quote:

2) I never said I was a better scripter than he, I simply said Jagen is a good scripter, and I'm a pretty good scripter, and that when two people who are both pretty good at something, especially Jagen, is most likely correct, since he was basically saying we were wrong with this 100% thing.
Giltwist+Kai > Jagen+Zega

Does that mean we're automatically right? Any competent scripter's doubts should be treated with respect, not dismissed without thought.

Python523 08-06-2003 05:12 AM

Just becuase the run time isn't big, doesn't mean it isn't lagging the server technically, setting serverr strings a lot WILL lag the server, not because of a high run time, but because the strings need to be sent to every player/npc everytime it's set, which will cause server lag, not lag on that particular npc, and why shouldn't you run a timeout loop? Because the Control-NPC already gets a ton of actions, everytime a projectile lands it gets an event, for an example I mean, why but unneeded stuff on it, it's just distracting the NPC from doing other functions, also, everytime the control-npc is called with a trigger, it 'warps' to the point that called the trigger, so again, why put unneeded stuff there

TribulationStaff 08-06-2003 05:18 AM

There are no serverr.variables in that script....

Python523 08-06-2003 05:21 AM

dude, I was just saying it as an example x_X not as if it was actually that way

Kaimetsu 08-06-2003 05:36 AM

Quote:

Originally posted by Python523
Just becuase the run time isn't big, doesn't mean it isn't lagging the server technically
Okay. Then how will it lag the server?


Quote:

why shouldn't you run a timeout loop? Because the Control-NPC already gets a ton of actions, everytime a projectile lands it gets an event, for an example I mean, why but unneeded stuff on it, it's just distracting the NPC from doing other functions
'Distracting'? You realise that it's all handled by one processing unit? The processor has to do just as much work whichever NPC contains the code. The CNPC only needs to do stuff when it is being called. If something else is being processed during that call then it doesn't matter which NPC is doing the processing.

Quote:

also, everytime the control-npc is called with a trigger, it 'warps' to the point that called the trigger
1) The warping is only a way to describe its behaviour, it doesn't actually warp anywhere because it doesn't have a physical presence.
2) The 'warping' isn't processor-intensive.
3) Giltwist's script doesn't involve triggering the server.

Projectshifter 08-06-2003 08:35 AM

Quote:

Originally posted by Kaimetsu
Giltwist+Kai > Jagen+Zega
What a modest comment...

Quote:

Originally posted by Kaimetsu
1) The warping is only a way to describe its behaviour, it doesn't actually warp anywhere because it doesn't have a physical presence.
2) The 'warping' isn't processor-intensive.

Correct me if I'm wrong, but I was pretty sure that everytime a serverside script is called, it tecnically "warps" the CNPC to that location and runs the script. The "warping" is only as processor intensive as the serverside script itself. And what do you mean by "physical presence"? None of the components of software necessarily have a "phyiscal presence", but the Control-NPC exists in/as the server itself, rather than in a level, but it does "warp" to serverside scripts constantly.
---Shifter

Projectshifter 08-06-2003 08:47 AM

I made an RC Login system myself. I made a seperate database NPC for it, RC Login System. It runs on a timeout of 1 (I did use a timeout of 5, but timeout of 1 creates SLIGHTLY more lag, and it's microseconds). Just every timeout loop, have it check this.newrcs to this.oldrcs and make sure the strings are the same (strequals). If they are, then just ignore it and have it reset the timeout. BUT if it is different, check the strings to find what is new. I have my automatically PM Updates and personal messages to them. /npc messages new 'account' 'message' is how I'm using it to send messages. It just stores a string and sends to the RC when he gets on.
BTW, using a timeout on the Control-NPC is just something that isn't done. The reasons are limitless as to WHY you shouldn't use them, but it's just kind of one of those things. It's just like telling people to not use a .1 timeout serverside if they don't have to, or not to run pointless timeouts in every NPC. It is just something that scripters should know (no offense, everyone has to learn some time or another). If you have the RC chat do a with(getnpc(RC Login Sys)) and have it set a string, then just transferring and a small edit of the script would make it work just fine, and would also help reduce lag (should be one of the greatest concerns when coding).
---Shifter

TribulationStaff 08-06-2003 08:56 AM

But then it doesn't blink the tray icon which was the whole idea of using sendpm. I run my RC minimized while working on other things, I need a way to not miss people.

voicedcow6666 08-06-2003 09:26 AM

Quote:

Originally posted by TribulationStaff
But then it doesn't blink the tray icon which was the whole idea of using sendpm. I run my RC minimized while working on other things, I need a way to not miss people.
You can still use sendpm, that doesn't have to be in the Control-NPC.

Kaimetsu 08-06-2003 09:46 AM

Quote:

Originally posted by Projectshifter
What a modest comment...
It wasn't modest, but it was pertinent.

Quote:

Correct me if I'm wrong, but I was pretty sure that everytime a serverside script is called, it tecnically "warps" the CNPC to that location and runs the script.
The CNPC is just a collection of code, it doesn't run anything. It might be involved in the running of scripts, but I doubt it.

Quote:

The "warping" is only as processor intensive as the serverside script itself.
Nonsense. The two are unconnected; the script's size and processor demands are not linked to the necessary computation in moving the CNPC.

Quote:

And what do you mean by "physical presence"? None of the components of software necessarily have a "phyiscal presence"
Indeed, which implies that I wasn't talking about physical presences in the real world. A character NPC in a level has a physical presence. Every player has a physical presence. The CNPC has no physical presence.

Quote:

Originally posted by Projectshifter
BTW, using a timeout on the Control-NPC is just something that isn't done. The reasons are limitless as to WHY you shouldn't use them
Cool. Then name ONE.

Python523 08-06-2003 10:32 AM

Quote:

Originally posted by Kaimetsu


It wasn't modest, but it was pertinent.


I'd say without a doubt you and giltwist would be better than zega and I in the area of say...eye candy, but you've admitted before that you aren't the best in the area of serverside scripting and things like that, well you didn't word it that way but I don't have logs of chatrooms, so I apologize if I say something inaccurate, but I think I got the main point of it, but anyway, I think I could say
zega + jagen > kaimetsu + giltwist
in the area of serverside scripting, I'm not saying you can't or couldn't, I'm just saying both of you without a doubt have the potential to, but gilt is still learning most of it, and I've never really seen you script much serverside-wise, but then again, I'm just stating my opinion, so I could be wrong

Kaimetsu 08-06-2003 11:00 AM

Quote:

Originally posted by Python523
I'd say without a doubt you and giltwist would be better than zega and I in the area of say...eye candy, but you've admitted before that you aren't the best in the area of serverside scripting
I lack experience, not skill. Knowing about timeouts within CNPCs may be a matter of experience, but so far you haven't given a single valid reason. My general programming ability is more applicable, since I have more insight into the inner workings of the program.

voicedcow6666 08-06-2003 11:15 AM

Actually valid reasons have been given you're just too stuborn to accept them.

Kaimetsu 08-06-2003 11:23 AM

Quote:

Originally posted by voicedcow6666
Actually valid reasons have been given you're just too stuborn to accept them.
Nope. I've given arguments against every one, and those arguments have not been countered.

Projectshifter 08-06-2003 11:25 AM

Quote:

Originally posted by voicedcow6666
Actually valid reasons have been given you're just too stuborn to accept them.
Yes, I agree with Zega on this one.
I have to say that Zega + Jag > Kai + Gil on this matter... I've only given a little input so I don't count there :P
But you're mistaken my friend, the Control-NPC IS the NPC Server essentially, and therefore it DOES run about everything serverside... The CNPC does have a presence, it's omnipotent(?). It's kind of like the theory of god and santa clause, everywhere at once (Santa is for one night ;))! It's like a car, if you put in something to bog down the engine, the entire car gets slower, but if you just have bad tires, then it doesn't slow down as much. Bogging down the Control-NPC or making it work more than it needs to puts more stress on the entire system and causes more problems, it's a basic fact. Stefan got really pissed at ChrisZ because he had a timeout in the CNPC I believe.
---Shifter

Python523 08-06-2003 11:26 AM

Quote:

Originally posted by Kaimetsu


I lack experience, not skill. Knowing about timeouts within CNPCs may be a matter of experience, but so far you haven't given a single valid reason. My general programming ability is more applicable, since I have more insight into the inner workings of the program.

Ok then, I'll ask stefan when he gets back if I remember to, if he says it doesn't matter, then I will admit I was wrong, but I am sure he will not advice to having a looped timeout in the C-NPC, yea I know you are going to say 'why would he say such a thing?', I'm afraid I cannot answer that without you giving a good counter to my statement, so I apologize for that, I just have a gut feeling stefan will agree with me though =/ but I think I brought up the arguement that the C-NPC is basically the main part of the npc server, to the extent where the npc server cannot work without it being there, so really why give it more work than it already has =/ (yea you're going to say 'a few milliseconds of extra work isnt going to matter' but I'm going to stick with my opinion until stefan prooves me wrong, and I am sure you will do that same)

Projectshifter 08-06-2003 11:29 AM

Quote:

Originally posted by Python523


Ok then, I'll ask stefan when he gets back if I remember to, if he says it doesn't matter, then I will admit I was wrong, but I am sure he will not advice to having a looped timeout in the C-NPC, yea I know you are going to say 'why would he say such a thing?', I'm afraid I cannot answer that without you giving a good counter to my statement, so I apologize for that, I just have a gut feeling stefan will agree with me though =/ but I think I brought up the arguement that the C-NPC is basically the main part of the npc server, to the extent where the npc server cannot work without it being there, so really why give it more work than it already has =/ (yea you're going to say 'a few milliseconds of extra work isnt going to matter' but I'm going to stick with my opinion until stefan prooves me wrong, and I am sure you will do that same)

I'll side with Jag on this one. If Stefan says it's fine, then i'll admit that I was wrong and I was stupid on this.
But if we're right... let's not mention it ever again kkz? Just learn that we're not out to tell ppl that they're stupid and that just because they're not right doesn't mean it's the end of the world? (I had to learn this the hard way! :p)
---Shifter

Kaimetsu 08-06-2003 11:36 AM

Quote:

Originally posted by Projectshifter
But you're mistaken my friend, the Control-NPC IS the NPC Server essentially
No it isn't, it's just an NPC. It might give the NPC a presence in the world, but that's not the same thing.

Quote:

The CNPC does have a presence
Not a physical presence. Read.

Quote:

It's like a car
No, it's nothing like a car. Don't draw such stupid comparisons.

Quote:

Originally posted by Python523
so really why give it more work than it already has =/
If it runs all code then it doesn't matter where the script is. It'll be running it whether it's in the CNPC or not.

NOTE: I'm not saying you people are wrong about this, I'm just saying I need a logical reason before I believe it. If Stefan is the only person who can provide that reason then I guess we'll have to wait for him.

Projectshifter 08-06-2003 11:41 AM

Quote:

Originally posted by Kaimetsu
No it isn't, it's just an NPC. It might give the NPC a presence in the world, but that's not the same thing.
Um, yes it is MORE than just an NPC... it's the backbone of the entire NPC Server, it is essentially the NPC Server. Delete a Control-NPC and see what happens...

Quote:

Originally posted by Kaimetsu
No, it's nothing like a car. Don't draw such stupid comparisons.
Wow... I love propaganda... you take just one little part. It was not a stupid comparison, it was very valid. A car engine is what runs majority of the car. The pistons move and it causes the disks to spin, I'm not going to get into it, but the movement of the pistons in the engine move it all. If you have lower RPM's (slower piston movement) then it causes the car to have less TORC and horsepower to it. If it's just the tire or a disc that is a problem, then other parts of the car run at normal speed, it's only one part. The Control-NPC is like the engine, all the other NPC's are components... it was a VERY valid arguement.

Quote:

Originally posted by Kaimetsu
If it runs all code then it doesn't matter where the script is. It'll be running it whether it's in the CNPC or not.
It does too matter. Look back to my VERY valid Car comparison...

Quote:

Originally posted by Kaimetsu
NOTE: I'm not saying you people are wrong about this, I'm just saying I need a logical reason before I believe it. If Stefan is the only person who can provide that reason then I guess we'll have to wait for him.
You have point-blank said that we are wrong and don't know what we're talking about! When Stefan gets back from Germany... ask him.
---Shifter

voicedcow6666 08-06-2003 12:19 PM

...Yeah Kai, the Control-NPC is in fact a vital necessity of the NPC Server....it's not just a NPC...

protagonist 08-06-2003 01:57 PM

Quote:

Originally posted by voicedcow6666
...Yeah Kai, the Control-NPC is in fact a vital necessity of the NPC Server....it's not just a NPC...
Yes it is. It would not be in the NPC database were it not.


All times are GMT +2. The time now is 05:28 PM.

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