Thread: timereverywhere
View Single Post
  #12  
Old 01-25-2002, 08:24 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Ok. This is what is going on (If I remember correctly what Stefan said).

In a non-p2p server (Non NPC Server), the first person in the level runs all the timeouts in NPCs. So, all timeouts are run on the level-leader's computer. But, when you call the timereverywhere; command, what it does is creates an instance of the NPC on everybody's computer. Now, what this does is kinda like Clientside on NPC Server. Since every player has his own copy of the NPC, any changes to the NPC are only seen on the player's computer. So, basically, if I remember right during my non-NPC Server scripting days:
NPC Code:

if (playerenters) {
timeout=0.05;
}
if (timeout) {
if (this.go==0) {
x+=0.5;
} else {
x-=0.5;
}
if (x<1) this.go=0;
if (x>63) this.go=1;
timeout=0.05;
}


and
NPC Code:

if (playerenters) {
timereverywhere;
timeout=0.05;
}
if (timeout) {
if (this.go==0) {
x+=0.5;
} else {
x-=0.5;
}
if (x<1) this.go=0;
if (x>63) this.go=1;
timeout=0.05;
}


Now, the code makes an NPC move back and forth across the screen. In the first code, the first person in the level (leader) handles the timeout. Every person in the level will see the NPC move. In the second code, each person in the level receives their own copy of the NPC and runs their own timeout. Each person will see only their copy of the NPC, not anybody elses. So, do people understand?


(I am 90% sure I am correct about this. I haven't used free server scripting in a while. If I am wrong, please correct me!)
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote