Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   timereverywhere (https://forums.graalonline.com/forums/showthread.php?t=21903)

Kadar 01-24-2002 06:43 AM

timereverywhere
 
Could someone tell me what it does.. i dont really get it...
Also kaimetsu if u read this i need to pm u one of my scripts that for some reason does not work when 2 players are in the room..

Falcor 01-24-2002 06:46 AM

It basically makes it so that timeout works globeally instead of just for the leader. is usless in P2P codes.

Kadar 01-24-2002 06:50 AM

Ok i made a couple things you know like when u start prov and it has those bars that u can choose your gender and stuff..
i made one of those but its not working when 2 players are in the room.. should i add timereverywhere.. this is nonp2p

Falcor 01-24-2002 06:52 AM

I ferget all my experience with p2p, butum... try it?
methinks you should also use this variables, since they are local to the client.

Kadar 01-24-2002 06:54 AM

if (playerenters){
timereverywhere;
}
??
i dont know where to put it

Falcor 01-24-2002 06:55 AM

as long as it is called its fine.

LiquidIce00 01-24-2002 07:57 AM

if u do
NPC Code:

timeout=3;
if (playerenters||timeout) {
shootball;
}


only the first person (leader) in the level will be shot at. 2nd person wont
if u do
NPC Code:

timereverywhere;
timeout=3;
if (playerenters||timeout) {
shootball;
}


it will run the timeout for each person in lvl ;X

Kadar 01-24-2002 08:20 AM

Quote:

Originally posted by LiquidIce00
if u do
NPC Code:

timeout=3;
if (playerenters||timeout) {
shootball;
}


only the first person (leader) in the level will be shot at. 2nd person wont
if u do
NPC Code:

timereverywhere;
timeout=3;
if (playerenters||timeout) {
shootball;
}


it will run the timeout for each person in lvl ;X

Thank you so much.

lordhelmut 01-24-2002 09:41 AM

i just found out about the command. I was trying to make it in events that when i said Disable weapons were disabled then i say enable and it enables. It wasnt working but then i found that command and was happy =D

royce 01-25-2002 07:46 AM

Quote:

Originally posted by Kadar


Thank you so much.


Mainly what happens is that the first person that enters the level will be affected by npc's if it uses player manipulation but when timereverywhere is coded it constantly is checking the level for players and events. When it is done without the command the second player or the second consecutive player in the room gets everything loaded from the first player.

nyghtGT 01-25-2002 07:55 AM

Quote:

Originally posted by royce



Mainly what happens is that the first person that enters the level will be affected by npc's if it uses player manipulation but when timereverywhere is coded it constantly is checking the level for players and events. When it is done without the command the second player or the second consecutive player in the room gets everything loaded from the first player.

put my name in your sig

BocoC 01-25-2002 08:24 AM

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!)

royce 01-25-2002 08:37 AM

[QUOTE]Originally posted by BocoC
[B]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. [QUOTE]


I thought that the second player or the player that enters recieves its npc crap from the first person (non-p2p). But the first person is still leader if the second player is in the room and teh second player recieves all 'in-level' attributes. What I mean by 'in-level' like variables and stuff that would only exist in that one level, not player attributes that are saved and stored.

btedji 01-26-2002 03:51 AM

Ok...I know I started a post asking almost the same question somewhere

Echos 01-26-2002 05:15 PM

Re: timereverywhere
 
Quote:

Originally posted by Kadar
Could someone tell me what it does.. i dont really get it...
Also kaimetsu if u read this i need to pm u one of my scripts that for some reason does not work when 2 players are in the room..

[Kaimetsu]

What, you think I'm just some universal resource that fixes scripts on demand or something?

[/Kaimetsu]

entravial 01-27-2002 01:22 AM

~AlphaFlame~

Kadar, if Kaimetsu won't help I'd be willing to try.

And Kaimetsu... that comes as part of being one of the best scripters of graal. :p

BocoC 01-27-2002 02:00 AM

Re: Re: timereverywhere
 
Quote:

Originally posted by Echos


[Kaimetsu]

What, you think I'm just some universal resource that fixes scripts on demand or something?

[/Kaimetsu]

Heh. That has happened to me too.


All times are GMT +2. The time now is 03:04 PM.

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