Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > NPC Server
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 08-05-2002, 09:56 PM
Androk2k1 Androk2k1 is offline
Banned
Androk2k1's Avatar
Join Date: Dec 2001
Posts: 1,336
Androk2k1 is on a distinguished road
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!
  #2  
Old 08-05-2002, 10:02 PM
Androk2k1 Androk2k1 is offline
Banned
Androk2k1's Avatar
Join Date: Dec 2001
Posts: 1,336
Androk2k1 is on a distinguished road
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...
  #3  
Old 08-06-2002, 01:34 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
  #4  
Old 08-06-2002, 09:15 PM
Jinx Jinx is offline
Radioactive Cow
Jinx's Avatar
Join Date: Sep 2001
Location: I duno...
Posts: 1,217
Jinx is on a distinguished road
Send a message via AIM to Jinx
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
__________________
Confucious2002: Cynical passed it's 2nd review! <3
InsaneFishP0sse: Yea =) Now if only Nemesis weren't dead
Confucious2002: *pokes nem*
InsaneFishP0sse: He got a severe paper cut last week and died of blood loss, very sad
Confucious2002: so unix took over his body?
InsaneFishP0sse: No, actually it was the NPC Server,
InsaneFishP0sse: Now if you PM Nemesis, he will go "I am Nemesis, the PW Admin, I handle almost all Playerworlds currently online"
  #5  
Old 08-06-2002, 09:26 PM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
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.
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
  #6  
Old 08-06-2002, 10:25 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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..
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
  #7  
Old 08-10-2002, 01:58 AM
zorakid2001 zorakid2001 is offline
Banned
Join Date: Jul 2002
Location: Oregon USA <-- this place sux0rs
Posts: 113
zorakid2001 is on a distinguished road
Send a message via ICQ to zorakid2001 Send a message via AIM to zorakid2001
timevar? do explain.
  #8  
Old 08-10-2002, 02:13 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by zorakid2001
timevar? do explain.
a serverwide var (client and serverside i think) that increases every 5 seconds
  #9  
Old 08-23-2002, 10:07 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
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
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #10  
Old 08-24-2002, 02:42 AM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
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.
  #11  
Old 08-24-2002, 06:52 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
  #12  
Old 08-24-2002, 12:08 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
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
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #13  
Old 08-24-2002, 02:06 PM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
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.
  #14  
Old 08-25-2002, 12:06 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
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
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #15  
Old 08-25-2002, 12:33 AM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
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
  #16  
Old 08-25-2002, 12:39 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
LOL, like you can make scripts that will READ to/from an NPC. Like you can do:
NPC Code:

with (getnpc(Control-NPC))
{ setstring this.string,#s(client.string);}


that would read the control-npc and set a this.string from the player. The Control-NPC is VITAL in most cases... you need it to be able to do things and such. It replaces server.strings for the most part, and you can do MANY things with it. Just because no on is in the level, should the timer stop?? So what if the playercount on the server was 0, should the timer not continue?/ x.X
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #17  
Old 08-30-2002, 11:20 PM
Androk2k1 Androk2k1 is offline
Banned
Androk2k1's Avatar
Join Date: Dec 2001
Posts: 1,336
Androk2k1 is on a distinguished road
What does [i] do? It's used very often, but I don't quite understand it's purpose..
  #18  
Old 08-30-2002, 11:46 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Androk2k1
What does [i] do? It's used very often, but I don't quite understand it's purpose..
Accessing the i. elementh of an array.
So allplayers[2] would give you the 3. player (count starts at zero), allplayers[i] gives you a player depending on the current value of the variable i.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
  #19  
Old 08-31-2002, 12:30 AM
Lit Lit is offline
Registered User
Join Date: Jul 2002
Location: none
Posts: 41
Lit is on a distinguished road
Send a message via AIM to Lit Send a message via Yahoo to Lit
I just relized how hard it whould be to have this all scripted out making ur own game and all it must have took at least over 20 months for scripting bombs joltbombs everything superbombs puting all the GFX together i wonder how long it did take them all.............
  #20  
Old 08-31-2002, 06:06 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
LOL, you can't just put allplayers[i] because I would have no value!
NPC Code:

if (created)
{ for (i=0;i<allplayerscount;i++)
{ with (allplayers[i])
{ sendpm Hello;}
}
}


---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #21  
Old 09-04-2002, 05:28 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by emortylone
LOL, you can't just put allplayers[i] because I would have no value!
NPC Code:

if (created)
{ for (i=0;i<allplayerscount;i++)
{ with (allplayers[i])
{ sendpm Hello;}
}
}


---Shifter
"LOL" he said depending on the value of i.
  #22  
Old 09-04-2002, 06:14 PM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
What would be more laggier NPC server or without one?
  #23  
Old 09-04-2002, 06:33 PM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
Isnt the scripts of a npc server laggy?
I know some are
  #24  
Old 09-04-2002, 06:44 PM
KuJi2002 KuJi2002 is offline
Banned
Join Date: Jul 2002
Location: NYC
Posts: 144
KuJi2002 is on a distinguished road
Send a message via AIM to KuJi2002 Send a message via Yahoo to KuJi2002
When i scripted about 1 1/2years ago i hated the Mp3/Mid players they had when u change the # into 1.mp3 or 1.mid so i made something better so u can just say play name.mid
then about a year ago i just fixed it up and now it doesnt cause that much lag It use to take about 3 minutes for it to play the song
i added tokenize to it and it sorta did it a lil quicker then i took out the flags and just did
if (startswith(play,#c)) {
tokenize #c;
if (strequals(#t(2),.mid)) {
play #t(1).mid
}
if (strequals(#t(2),.mp3)) {
play #t(1).mp3
}
}
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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