Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Can flags be unset by NPCs in other levels online? (https://forums.graalonline.com/forums/showthread.php?t=27845)

Googi 04-22-2002 08:14 AM

Can flags be unset by NPCs in other levels online?
 
If a player is in a different level and an NPC tried to unset a flag from that player would it work online, because it doesn't offline.

Neonight 04-22-2002 08:54 AM


How can a clientsided NPC access a players attrivutes when it's not in the level?? You would need a serversided npc it use a with (getplayer(account))

Googi 04-22-2002 10:53 PM

Would that lag like a server.string?

Saga2001 04-22-2002 11:01 PM

Quote:

Originally posted by Googi
Would that lag like a server.string?
Is this non-p2p?
If non-p2p you could have a weapon that sets it depending on server string...
On p2p you could have a server side section that uses with and unsets it...

Googi 04-23-2002 06:33 AM

Like this?

NPC Code:

if (timeout){
with (getplayer(#s,this.oneaowner#v(#a))){
unset mine1;
unset ownsmine;
}
setstring this.oneaowner,(no owner);
this.onea=0;
}


Gohan43331 04-23-2002 07:52 AM

Quote:

Originally posted by Googi
(code)
NPC Code:

with (getplayer(#s,this.oneaowner#v(#a))){


If you want to get the player who owns it, it's more like:
NPC Code:
 with(getplayer(#s(this.oneaowner))) { } 



[edit] And I missed a parenthesis (sp...i know) [/edit]

Googi 04-23-2002 08:14 AM

I'm guessing with (getplayer) doesn't work offline either?

Neonight 04-23-2002 08:55 AM

Quote:

Originally posted by Googi
I'm guessing with (getplayer) doesn't work offline either?

Jagen:
Yep, anything involoving with is only supported by an NPC Server

Saga2001 04-23-2002 10:39 PM

Well if this is p2p, I believe I am correct in saying you could make it auto kill if the player leaves the level like this, I don't beleieve it works non-p2p.
NPC Code:

if (playerleaves)
setstring this.owner,;


emortylone 04-25-2002 09:12 PM

i personally hate to use flags unless it is REALLY necessary just b/c it lags too much. LAG in my point of few ruins things. While it isn't worth sacrificing an entire great NPC, i try and use other things. Add an NPC, maybe just one, that is a system and edit flags in that or something, or have it update each time. Server flags lag. Sans used a server flag for each person, and they had to remove it b/c of all the lag! So having a server flag for EACH person can SERIOUSLY lag. And can't you just {set flagname} then l8er put {unset flagname} l8er??
---Shifter

emortylone 04-25-2002 09:13 PM

Oh yeah, or attachplayertoobj might work too! Use variables. if (playerperforms action)this.action=1;
if (this.action==1) then whatever you want it to do. It does not even need to have ne GFX to work.
---Shifter

Googi 04-25-2002 11:05 PM

Quote:

Originally posted by emortylone
i personally hate to use flags unless it is REALLY necessary just b/c it lags too much. LAG in my point of few ruins things. While it isn't worth sacrificing an entire great NPC, i try and use other things. Add an NPC, maybe just one, that is a system and edit flags in that or something, or have it update each time. Server flags lag. Sans used a server flag for each person, and they had to remove it b/c of all the lag! So having a server flag for EACH person can SERIOUSLY lag. And can't you just {set flagname} then l8er put {unset flagname} l8er??
---Shifter

Flags are good, and I'm not using a server flag.

emortylone 04-26-2002 08:21 PM

That about somes it up, thanx ;) Heh. If you put a flag on, it can just be a client side flag. The only reason you would need a server flag is if it is accessible to multiple people. Client flags lag a hell of a lot less (each server flag = about 1 flag per person!) and aren't a big deal. just use set flagname
---Shifter

emortylone 04-26-2002 08:36 PM

Clientside flags referring to specific flags used for the player that stay in the client. Normal client flags would be a lot less complex. Like ... :asleep: so tired! Heh, um, like set and unset. or if something, then something...
---Shifter

emortylone 04-26-2002 08:50 PM

Heh, as i figured. Is there a chance you'd be nice enough to explain all the p2p stuff to me? I do only non-p2p, put i figure if i am going to be posting and making scripts for people, then i might as well figure out the p2p stuff just in case.
---Shifter

emortylone 04-26-2002 09:02 PM

How about e-mailing me or IM'ing me and explaining a few key points? LOL, if not that is cool.
---Shifter

emortylone 04-26-2002 09:09 PM

Allright thanx. I'm about to go soon. BGut you're giving me something to do. I hit refresh adn wait to see when Emortylane doesn't dominate the entire last posts on the page, lol.
---Shifter

Faheria_Admin5 04-30-2002 12:18 AM

hmmmm
 
Heres an idea dont know if it helps ya any.

In a p2p server if there is an item like maybe you pick up an emerald and the first person to the king gets 10 gralats. Then you could do something like this.

//In a weapon script
//#CLIENTSIDE
if(created) {
setimg emerald.png;
}
if(playerenters||timeout) {
if(!strequals(client.emeraldpickuptime,serverr.eme raldtime)) {
destroy;
}
}

//In emerald area script
if(created) {
setimg emerald.png;
setshape 1,32,32;
}
if(playertouchsme) {
if(strlen(#s(serverr.emeraldtime))=0) {
setstring serverr.emeraldtime,#v(timevar);
}
setstring client.emeraldpickuptime,#s(serverr.emeraldtime);
addweapon Emerald;
}

//In Kings Script
if(created) {
//putmakekingtypethings here
}
if(playertouchsme&&hasweapon(Emerald)) {
setstring serverr.emeraldtime,;
playerrupees+=10;
removeweapon Emerald;
say2 Thank you young man this#bwill make a nice ring for me.;
}
I think thats all im late for class try it out

emortylone 04-30-2002 08:16 PM

Heh. if (action) setstring string,value;
---Shifter


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.