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-23-2001, 01:41 AM
TheFrozenFiend TheFrozenFiend is offline
Registered User
TheFrozenFiend's Avatar
Join Date: Apr 2001
Posts: 582
TheFrozenFiend is on a distinguished road
Question.......

How come on Graal 2001 in job npcs they have:

NPC Code:

if (strequals(#a,#s(this.owner))
{
commands and stuff here
}



to check if the person is the person who started doing the job.
How do they get that to work when 'this' flags can only contain numbers and peoples account names contain letters?



Thanks
__________________



Also known as TDM
Reply With Quote
  #2  
Old 12-23-2001, 02:35 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
well the this.owner doesnt affect the surrounding players because it checks for the account name. i am not sure though
Reply With Quote
  #3  
Old 12-23-2001, 02:40 AM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
umm

when it says "this.owner" its not refering to a this.var, its refering to a string, which can be letters or numbers.


its like saying client.test=0
that can only have numbers, but
setstring client.test,hello
would work just as
setstring this.test,hello

this. infront of a string means that only that NPC can access that string.
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote
  #4  
Old 12-23-2001, 02:52 AM
TheFrozenFiend TheFrozenFiend is offline
Registered User
TheFrozenFiend's Avatar
Join Date: Apr 2001
Posts: 582
TheFrozenFiend is on a distinguished road
Thx......

but if its a string then it adds it to the players list of flags and doesnt effect any other people who touch the npc so as soon as they touch it they get the same string but with their account instead so it doesnt help very much. Also if someone tries to help someone finish it instead of helping it they start their own one from the same npc but at 0% again.

*wonders if anyone understood that*

Heres a script (with some things that arent important cut out) where the things above happen:

NPC Code:

if(created)
{this.percentage=0;
setstring this.owner,#a;}

if (actionmaking && this.percentage<=99) {
maker = strtofloat(#p(0));
this.percentage+=maker;
message #v(this.percentage)%;

}


if (this.icecreampercent>=100) {
freezeplayer 0.5;
sleep 0.5;
if(strequals(#a,#s(this.owner))){
freezeplayer 0.5;
sleep 0.5;
message blah;
destroy;}
else
if(!strequals(#a,#s(this.owner)))
{
message Owner: #a(this.owner);
sleep 2;
message;
}

}



Thx
__________________



Also known as TDM
Reply With Quote
  #5  
Old 12-23-2001, 02:58 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
cause this is NPC-Server scripting (not possible offline or on Non-P2P servers) there are this-strings... these stings are saved in the NPC (The NPCs database) and everyone can acces them
__________________
No Webhost at the moment
Reply With Quote
  #6  
Old 12-23-2001, 03:10 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
indeed
__________________
Reply With Quote
  #7  
Old 12-23-2001, 03:48 AM
TheFrozenFiend TheFrozenFiend is offline
Registered User
TheFrozenFiend's Avatar
Join Date: Apr 2001
Posts: 582
TheFrozenFiend is on a distinguished road
Quote:
Originally posted by TDO2000
cause this is NPC-Server scripting (not possible offline or on Non-P2P servers) there are this-strings... these stings are saved in the NPC (The NPCs database) and everyone can acces them
So ive spent hours and hours trying to figure out whats wrong and its cause of the stupid npc server (or should i say lack of npc server)


aaaaaahhhhhhhhhhhhhhhhhhh

oh and thx
__________________



Also known as TDM
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 07:31 PM.


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