Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   Lame Questions, of a Lamer Guy, who knows nothing about NPC-Servers. (https://forums.graalonline.com/forums/showthread.php?t=35138)

Androk2k1 08-05-2002 09:56 PM

Lame Questions, of a Lamer Guy, who knows nothing about NPC-Servers.
 
Hello. I am a Lame Question asking Lamer guy who knows nothing about NPC Server. here are my questions:

1. Serverside and Clientside. As far as I understood, Clientside is for retrieving info from a player, and setting his animations only. Serverside does all the work. Am I right?

2. Strings which use client., can they be saved on serverside part of the script?

More Lame Questions to come!

Androk2k1 08-05-2002 10:02 PM

3. Is theer any way to put an NPC That does stuff without putting it on player or level, or calling for it with 'join' so bascally that nPC is everywhere...

Python523 08-06-2002 01:34 AM

1.) Light effects are handled on the clientside part as well, animations can be set either way, think of client and serverside this way, whatever is clientsided, is running on your computer, whatever is serverside is running on the server (graal's computer)

2.) client.strings can be read and wrote to bother server and clientside

3.) I don't get the question but if are asking if a player needs to be present in the level to execute the script, no the player does not, if the script is serverside the npc will still be working, like if the npc is scripted to move randomly, the npc will continue to move randomly with or without a player

Jinx 08-06-2002 09:15 PM

Quote:

Originally posted by Python523
3.) I don't get the question but if are asking if a player needs to be present in the level to execute the script, no the player does not, if the script is serverside the npc will still be working, like if the npc is scripted to move randomly, the npc will continue to move randomly with or without a player
This I do not understand. I am no scripting genius, so I'm sure there's a reason. If there are no players in the level, then why does it matter if the script is still running?

-Jinx

jeff335 08-06-2002 09:26 PM

Some scripts need to run constantly.


A good example is anything that uses timeouts or whatnot to interact with other NPCs and with players using only with commands...like the Market-Control on newmain and similar.

adam 08-06-2002 10:25 PM

Quote:

Originally posted by Jinx


This I do not understand. I am no scripting genius, so I'm sure there's a reason. If there are no players in the level, then why does it matter if the script is still running?

-Jinx

Things that grow....

NPC's that wonder around the whole server even if the server is empty.

The growing one can prabably be easily done just by using timevar though.

>.< Bomies on G2k2 can wonder around even if there are no players there.
Otherwise thier all bunched up. // which it seems they are anyway now. omi.

Actually I think stuff that moves around can be done with timevar too..... just would be kinda laggy for the first instant the player eners the level..

zorakid2001 08-10-2002 01:58 AM

timevar? do explain.

Python523 08-10-2002 02:13 AM

Quote:

Originally posted by zorakid2001
timevar? do explain.
a serverwide var (client and serverside i think) that increases every 5 seconds

emortylone 08-23-2002 10:07 AM

Timevar is for time keeping. What time of day and such, and for time systems. For #3, simple enough. A d/b (or database) NPC runs constantly on the entire server. While it DOES have a level, it can be warped, and updating the level it is in does NOT update the NPC. You have to have NC (NPC Control) rights to make/view/modify them.
---Shifter

user13-xo 08-24-2002 02:42 AM

Quote:

Originally posted by emortylone
Timevar is for time keeping. What time of day and such, and for time systems. For #3, simple enough. A d/b (or database) NPC runs constantly on the entire server. While it DOES have a level, it can be warped, and updating the level it is in does NOT update the NPC. You have to have NC (NPC Control) rights to make/view/modify them.
---Shifter

That would lag very much, a better way could be Control-NPC :)
Control-NPC has no level.

Timevar can have more uses then just time keeping.

Python523 08-24-2002 06:52 AM

Quote:

Originally posted by user13-xo


That would lag very much, a better way could be Control-NPC :)
Control-NPC has no level.

Timevar can have more uses then just time keeping.

just because it doesnt have a level doesnt mean it doesnt cause lag

emortylone 08-24-2002 12:08 PM

Quote:

Originally posted by Python523

just because it doesnt have a level doesnt mean it doesnt cause lag

THANK YOU! I am SO glad someone said this before I did! You're still in the n00bie scripter frame of mind ;) You look @ the NPC Server as extra baggage, and a pain. The more advanced scripters look at it as a GREAT TOOL! You have to understand how much EASIER it makes things, and how much more power and control you have with it. A database NPC does not lag that much thank you very much. You think i would suggest something that causes great amounts of lag? Adding TONS of server.strings (which I USED to do back in the day ;) ) causes a bit o' lag. A d/b NPC doesn't create that much. Just because it doesn't have a level means nothing. It is STILL an NPC, and it is basically the same as if it WAS in a level, because the data is STILL sent to the NPC Server, and it is handled yet the same... he he.
---Shifter

user13-xo 08-24-2002 02:06 PM

Quote:

Originally posted by emortylone

THANK YOU! I am SO glad someone said this before I did! You're still in the n00bie scripter frame of mind ;) You look @ the NPC Server as extra baggage, and a pain. The more advanced scripters look at it as a GREAT TOOL! You have to understand how much EASIER it makes things, and how much more power and control you have with it. A database NPC does not lag that much thank you very much. You think i would suggest something that causes great amounts of lag? Adding TONS of server.strings (which I USED to do back in the day ;) ) causes a bit o' lag. A d/b NPC doesn't create that much. Just because it doesn't have a level means nothing. It is STILL an NPC, and it is basically the same as if it WAS in a level, because the data is STILL sent to the NPC Server, and it is handled yet the same... he he.
---Shifter

let me reword this. If the npc was switching levels every .1 seconds. this would cause at least some lag.

emortylone 08-25-2002 12:06 AM

Ah, yes, a timeout of 0.1 CONSTANTLY without a real purpose does lag. However, 0.1 is MANY times faster than a person can see the difference in, so 0.25 or .5 work better for things that aren't like movement and such. When I did my chat NPC< I used a timeout of 1, because anyway it will lag, and it will compensate. If you are worried about an extra .9 or so seconds, get over it :P You do NOT make a d/b NPC switch levels every 0.1 seconds x.X You obviously aren't comprehending the POINT of it! x.X You might make a pet, and the pet will find a player, you would do something like this:
NPC Code:

if (created)
{ for (i=0;i<allplayerscount;i++)
{ with (allplayers[i])
{ if (strequals(#a,Projectshifter))
{ setstring this.level,#F;
setstring this.x,strtofloat(playerx);
setstring this.y,strtofloat(playery);
}
}
}
timeout=0.25;
}

if (timeout)
{ x=strtofloat(#s(this.x));
y=strtofloat(#s(this.y));
if (!strequals(#L,#s(this.level))
{ setlevel #s(this.level);}
timeout=0.25;
}


of COURSE you would have it not be on top of the player, but it would be USELESS for me to post the entire coding here...
---Shifter

Spark910 08-25-2002 12:33 AM

Quote:

Originally posted by Jinx


This I do not understand. I am no scripting genius, so I'm sure there's a reason. If there are no players in the level, then why does it matter if the script is still running?

-Jinx

I think he ment that, the way on none NPC servers and you got levels connected and you go over you can see that everything freezes other than a Player in the level(s) your not in. For eg:

warpani.gif in a NPC , animates when you are in the level, Stops and freezes when your out of the level until you reenter it (Kind of like a sleep commmand just for you the client) then it stops sleeping and actions and commands start when you re enter the level.

So with a NPC server the script and actions STILL run with or without you or anyone in the level or not.

Why it matters it still runs:

I think we will find that without scripts running without a player in a level, then the ''Train'' script such as on 2001, Would only work if a player is in the level, and if it did this, Itwouldnt move with nobody on it, and would depend on someone being in a level to work. As you can see this is inconvinent(sp?) so its important we can make a script run without someone in a level or we wouldnt get the smooth effects such as Trains and Creatures that walk around the Overworld through levels (Sometimes without a player in them).

Someone can confirm this as I started learning about NPC server, and serverside/clientside differences in scripting 1 day ago, So I probally got it all wrong, but thats what I think it is


All times are GMT +2. The time now is 09:38 PM.

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