Graal Forums  

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

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 12-20-2001, 06:41 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
GetNPC + this. variables

okay, when you do

with(getNPC(name)) {
this.var=1;
}

is that for the NPC that called the "with" or the NPC recieving the with? I have a feeling that it's for the recieving NPC, because stefan mentioned something about doing that...but i don't remember for sure now
  #2  
Old 12-20-2001, 09:55 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
reciveing.

its the recieving one.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
  #3  
Old 12-20-2001, 10:08 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
thanks...I thought that was the case, but wanted to make sure...
  #4  
Old 12-20-2001, 11:51 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
watch

watch me gain post counts.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
  #5  
Old 12-21-2001, 07:25 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Post

for setting variable to npc calling 'name'
NPC Code:

with (getnpc(name)){
variable=value;
}



for setting variable to npc: 'name'
NPC Code:

with (getnpc(name)){
this.variable=value;
}

  #6  
Old 12-21-2001, 07:50 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
you are smart
  #7  
Old 01-02-2002, 08:29 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
Yay

Ummm yeah it for recieving db npc im pretty sure i havent used it though i do use with (npcs.[i]) {} or with (npcs.[-1]) to get just placed npcs from control npc
__________________

To the sun of your age, I arise
  #8  
Old 01-08-2002, 09:24 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Ok here the correct version:

NPC Code:

tempvar = this.varfrom;
with (getnpc(name)) {
this.varto = tempvar;
}



The this. variable always belongs to
the current active npc, which is the npc
with the name 'name' when you do the
second assignment.
Currently there is no way to access the
this. vars of the executing npc.
  #9  
Old 02-17-2002, 12:27 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by Stefan
Ok here the correct version:

NPC Code:

tempvar = this.varfrom;
with (getnpc(name)) {
this.varto = tempvar;
}



The this. variable always belongs to
the current active npc, which is the npc
with the name 'name' when you do the
second assignment.
Currently there is no way to access the
this. vars of the executing npc.
is there anyway you can pass this.strings from the calling npc to the receiving npc??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
  #10  
Old 02-17-2002, 07:08 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by TDK_RC6


is there anyway you can pass this.strings from the calling npc to the receiving npc??
triggeraction ;P
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
  #11  
Old 02-17-2002, 09:56 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
but how do you trigger db npcs??


wait, nm, im stupid, they have a x and y

thanks grim
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
  #12  
Old 02-18-2002, 02:37 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
Quote:
Originally posted by Stefan
Ok here the correct version:

NPC Code:

tempvar = this.varfrom;
with (getnpc(name)) {
this.varto = tempvar;
}



The this. variable always belongs to
the current active npc, which is the npc
with the name 'name' when you do the
second assignment.
Currently there is no way to access the
this. vars of the executing npc.
Why not implement something like "that.var" when using with(getnpc) {}
So, it controls the "this." var of the other npc. That would be usefull.
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
  #13  
Old 02-18-2002, 02:58 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
I found a somesort of primitive way tpo get a this.string to the other npc. and that is by tokenizing it.

tokenize "#s(this.strfrom)"
with(getnpc(name)) {
setstring this.strto,#t(0);
}
It works in any sence =\
__________________

subliminal message: 1+1=3
  #14  
Old 02-18-2002, 03:13 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by Falcor
I found a somesort of primitive way tpo get a this.string to the other npc. and that is by tokenizing it.

tokenize "#s(this.strfrom)"
with(getnpc(name)) {
setstring this.strto,#t(0);
}
It works in any sence =\
ahh, i feel even stupider now

i must not be thinking clearly, thanks falados
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
  #15  
Old 03-02-2002, 01:07 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally posted by TDK_RC6
is there anyway you can pass this.strings from the calling npc to the receiving npc??
*grabs Stefan's example
Quote:
Originally posted by Stefan
NPC Code:

setstring tempstring,#s(this.stringfrom);
with (getnpc(name)) {
setstring this.stringto,#s(tempstring);
setstring tempstring,;
}


 


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:50 AM.


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