Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-05-2004, 04:32 AM
Zickle Zickle is offline
Awesome
Zickle's Avatar
Join Date: Dec 2002
Posts: 121
Zickle is on a distinguished road
Send a message via ICQ to Zickle Send a message via AIM to Zickle Send a message via MSN to Zickle Send a message via Yahoo to Zickle
Red face Making Server Flags

I want to make a script where when the player says "/eventpost TEXT" the text gets turned into a server flag like "server.bwpost=TEXT" and then the #s part of the code shown below in the playerenters and visible part display the text.

I had a good working way but I found out it needed server flags for everyone else to see it.

NPC Code:
// NPC made by ZicklePop
//#CLIENTSIDE
if (playerenters) {
showtext txt,x,y,verdana,nc,#s(server.bwpost);
changeimgcolors txt,1,1,1,1;
changeimgzoom txt,.5;
}
//#CLIENTSIDE
while (visible) {
showtext txt,x,y,verdana,nc,#s(server.bwpost);
changeimgcolors txt,1,1,1,1;
changeimgzoom txt,.5;
sleep 1;
}
//#CLIENTSIDE
if (playerchats) {
tokenize #c;
if (strequals(#t(0),/eventpost)) {
triggeraction 0,0,serverside,eventpost,/eventpost,#v(strtofloat(#s(server.bwpost));
}
}



Any help please?

Thanks as always, ZicklePop
__________________
Reply With Quote
  #2  
Old 12-05-2004, 06:06 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
You don't really need a server flag on your idea, a client flag is ok. Just use some server-side scripting to send the information to all players accounts. Also, you don't need to use '//#CLIENTSIDE' three times on the same script.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #3  
Old 12-05-2004, 06:30 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by osrs
You don't really need a server flag on your idea, a client flag is ok. Just use some server-side scripting to send the information to all players accounts. Also, you don't need to use '//#CLIENTSIDE' three times on the same script.
But what about players who log on after the message has been set? They won't see the message set.

NPC Code:

// NPC fixed by Slash
if (playerchats) {
if (startswith(/eventpost,#c)) {
setstring server.bwpost,#e(11,-1,#c);
}
}
//#CLIENTSIDE
if (created || playerenters) {
timeout = 1;
display();
}
if (timeout) {
if (playerscount > 0) {
timeout = 1;
}
display();
}
function display() {
showtext 0,x,y,verdana,c,#s(server.bwpost);
changeimgcolors 0,1,1,1,1;
changeimgzoom 0,.5;
}

Reply With Quote
  #4  
Old 12-05-2004, 06:46 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Slash-P2P
But what about players who log on after the message has been set? They won't see the message set.
Of course who wasn't online won't receive it, I just gave an idea, it is up to him to choose wich one he thinks better, also, it would be better to just help him with hints instead of the whole code. x-x
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #5  
Old 12-05-2004, 07:00 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
http://forums.graalonline.com/forums...ad.php?t=46557
__________________
Reply With Quote
  #6  
Old 12-05-2004, 07:36 AM
Zickle Zickle is offline
Awesome
Zickle's Avatar
Join Date: Dec 2002
Posts: 121
Zickle is on a distinguished road
Send a message via ICQ to Zickle Send a message via AIM to Zickle Send a message via MSN to Zickle Send a message via Yahoo to Zickle
Quote:
Originally Posted by Slash-P2P
But what about players who log on after the message has been set? They won't see the message set.

NPC Code:

// NPC fixed by Slash
if (playerchats) {
if (startswith(/eventpost,#c)) {
setstring server.bwpost,#e(11,-1,#c);
}
}
//#CLIENTSIDE
if (created || playerenters) {
timeout = 1;
display();
}
if (timeout) {
if (playerscount > 0) {
timeout = 1;
}
display();
}
function display() {
showtext 0,x,y,verdana,c,#s(server.bwpost);
changeimgcolors 0,1,1,1,1;
changeimgzoom 0,.5;
}


Thanks alot for helping, but it won't show up online. The server flags are setting this time.
__________________
Reply With Quote
  #7  
Old 12-05-2004, 03:34 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Zickle
Thanks alot for helping, but it won't show up online. The server flags are setting this time.
Try using a serverr. flag
Reply With Quote
  #8  
Old 12-05-2004, 05:32 PM
Zickle Zickle is offline
Awesome
Zickle's Avatar
Join Date: Dec 2002
Posts: 121
Zickle is on a distinguished road
Send a message via ICQ to Zickle Send a message via AIM to Zickle Send a message via MSN to Zickle Send a message via Yahoo to Zickle
Oh okay, thanks that worked!
__________________
Reply With Quote
  #9  
Old 12-05-2004, 05:32 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Slash-P2P
Try using a serverr. flag
why dont people ever use db npcs instead of server flags my personal opinion is db npcs lag less than server flags
__________________

Reply With Quote
  #10  
Old 12-05-2004, 07:18 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by ZeroTrack
my personal opinion is db npcs lag less than server flags
That's quite a vague statement. How does a flag experience lag?
__________________
Reply With Quote
  #11  
Old 12-05-2004, 07:57 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by ZeroTrack
why dont people ever use db npcs instead of server flags my personal opinion is db npcs lag less than server flags
They probably lag less just sitting there on the server, but I doubt they lag less when they are being read or wrote to.
Reply With Quote
  #12  
Old 12-05-2004, 11:41 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Kaimetsu
That's quite a vague statement. How does a flag experience lag?
i donno i've seen them lag more , for instance i had an NPC using server flags and it was listed in the top 10 for cpu usage, i changed it to store in a dbnpc and it came off the list ... maybe it was just the way the script was written but ever sence then i dont use server flags ::shrug::
__________________

Reply With Quote
  #13  
Old 12-06-2004, 04:07 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by ZeroTrack
i had an NPC using server flags and it was listed in the top 10 for cpu usage, i changed it to store in a dbnpc and it came off the list
Firstly, that wouldn't be a firm basis for saying that the strings themselves are lagging. Such is meaningless nonsense.
Secondly, it doesn't seem like sufficient basis to peddle your theories to learning scripters. I would suggest compiling more information before taking such bold steps.
__________________
Reply With Quote
  #14  
Old 12-06-2004, 05:28 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by ZeroTrack
i donno i've seen them lag more , for instance i had an NPC using server flags and it was listed in the top 10 for cpu usage, i changed it to store in a dbnpc and it came off the list ... maybe it was just the way the script was written but ever sence then i dont use server flags ::shrug::
Sometimes it takes a bit for the list to reload all the scripts and get the time, so NPCs might not show up for a little bit after you make a change like that.
Reply With Quote
  #15  
Old 12-06-2004, 03:32 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Kaimetsu
Firstly, that wouldn't be a firm basis for saying that the strings themselves are lagging. Such is meaningless nonsense.
Secondly, it doesn't seem like sufficient basis to peddle your theories to learning scripters. I would suggest compiling more information before taking such bold steps.
Im starting to think you post only to debate people.... Such is meaningless nonsense haha


[edit=loriel]oops, I hit the wrong button. Sorry.[/edit]
__________________


Last edited by Loriel; 12-06-2004 at 06:41 PM..
Reply With Quote
Reply


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 01:05 PM.


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