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 01-11-2002, 06:25 AM
SSRobgeta SSRobgeta is offline
Ebil Cloud = l337 *kupo*
SSRobgeta's Avatar
Join Date: Aug 2001
Location: Monroeville, PA
Posts: 1,084
SSRobgeta is on a distinguished road
Send a message via AIM to SSRobgeta
this.owner

Bah. I fell stupid, but how would I do this? Like if on 2001 for mining. (This.owner)
__________________
Rob Getashu
Anyone can show you the way, but the real adventure is finding it yourself..
Reply With Quote
  #2  
Old 01-11-2002, 09:13 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
here's a SIMPLE example..
NPC Code:

if (playertouchsme) {
if (this.owned==0) {
sleep 0.05;
this.owned=1;
setstring server.rockowner1,#a;
timeout=0.05;
}
if (this.owned==1) {
if (strequals(#a,#s(server.rockowner1))) {
say2 Hey owner, wassup?;
}
if (!strequals(#a,#s(server.rockowner1))) {
say2 You're not my owner!;
}
}
}
if (playerenters||timeout) {
message #s(server.rockowner1);
timeout=0.05;
}


I think that would work...maybe.
__________________

-=Shard IceFire=-
Reply With Quote
  #3  
Old 01-11-2002, 06:35 PM
SSRobgeta SSRobgeta is offline
Ebil Cloud = l337 *kupo*
SSRobgeta's Avatar
Join Date: Aug 2001
Location: Monroeville, PA
Posts: 1,084
SSRobgeta is on a distinguished road
Send a message via AIM to SSRobgeta
Quote:
Originally posted by Shard_IceFire
here's a SIMPLE example..
NPC Code:

if (playertouchsme) {
if (this.owned==0) {
sleep 0.05;
this.owned=1;
setstring server.rockowner1,#a;
timeout=0.05;
}
if (this.owned==1) {
if (strequals(#a,#s(server.rockowner1))) {
say2 Hey owner, wassup?;
}
if (!strequals(#a,#s(server.rockowner1))) {
say2 You're not my owner!;
}
}
}
if (playerenters||timeout) {
message #s(server.rockowner1);
timeout=0.05;
}


I think that would work...maybe.
K thanks.
__________________
Rob Getashu
Anyone can show you the way, but the real adventure is finding it yourself..
Reply With Quote
  #4  
Old 01-11-2002, 09:41 PM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
=D no prob.
Lemme know if ya need more help via forum PM.
__________________

-=Shard IceFire=-
Reply With Quote
  #5  
Old 01-12-2002, 03:38 AM
SSRobgeta SSRobgeta is offline
Ebil Cloud = l337 *kupo*
SSRobgeta's Avatar
Join Date: Aug 2001
Location: Monroeville, PA
Posts: 1,084
SSRobgeta is on a distinguished road
Send a message via AIM to SSRobgeta
Quote:
Originally posted by Shard_IceFire
=D no prob.
Lemme know if ya need more help via forum PM.
K i will.
__________________
Rob Getashu
Anyone can show you the way, but the real adventure is finding it yourself..
Reply With Quote
  #6  
Old 01-12-2002, 06:08 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Um why should u use server-strings for this?

use save-vars and playerid:
NPC Code:

if(playertouchsme){
//New Owner
if(save[0] <=0){
save[0]=playerid;
}
//If Owner nice message
if(save[0]==playerid){
say2 Hey Boss;
}
//if not Owner not so nice
if(save[0]<>playerid){
say2 Go away bastard;
}
}


for showing the owner's name I would use messagecodes, showcharacter and an empty gani (without showcharacter I always had problems with messagecodes, they didn't work the right way)
__________________
No Webhost at the moment
Reply With Quote
  #7  
Old 02-04-2002, 12:37 PM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
Quote:
Originally posted by TDO2000
Um why should u use server-strings for this?

use save-vars and playerid:
NPC Code:

if(playertouchsme){
//New Owner
if(save[0] <=0){
save[0]=playerid;
}
//If Owner nice message
if(save[0]==playerid){
say2 Hey Boss;
}
//if not Owner not so nice
if(save[0]<>playerid){
say2 Go away bastard;
}
}


for showing the owner's name I would use messagecodes, showcharacter and an empty gani (without showcharacter I always had problems with messagecodes, they didn't work the right way)
arent save vars local?
Reply With Quote
  #8  
Old 02-04-2002, 01:48 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Kaimetsu
Is there any logical reason not to use this.strings?
thats what i was thinking ...
Reply With Quote
  #9  
Old 02-04-2002, 07:15 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Quote:
Originally posted by Kaimetsu
Is there any logical reason not to use this.strings?
He just didn't use them in the script... he used server vars and me HATES server vars if u can do it another way ^_^
__________________
No Webhost at the moment
Reply With Quote
  #10  
Old 02-04-2002, 08:14 PM
Androk2k1 Androk2k1 is offline
Banned
Androk2k1's Avatar
Join Date: Dec 2001
Posts: 1,336
Androk2k1 is on a distinguished road
umm I made it simpler for Pot Making... I always make it simpler... but mine is close to first version... though I didn't finish reading it...
Reply With Quote
  #11  
Old 02-04-2002, 10:05 PM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
Yah, this.strings are the obvious way to do this -_-
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #12  
Old 02-04-2002, 10:42 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 TDO2000
NPC Code:

if(save[0]<>playerid){

does that mean less than or greater than??

i never knew you could use that

thats helps a lot if it is true
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #13  
Old 02-04-2002, 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
Smile

Quote:
Originally posted by TDK_RC6


does that mean less than or greater than??

i never knew you could use that

thats helps a lot if it is true
ain't it great?
learning new things that is.
__________________

!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
Reply With Quote
  #14  
Old 02-05-2002, 12:11 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
Quote:
Originally posted by Kaimetsu
So... basically a weird version of "!="? I prefer the more comprehensive "not equal to".
I'm with him...
__________________

!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
Reply With Quote
  #15  
Old 02-05-2002, 01:29 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
it would help with some syntax of mine
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #16  
Old 02-05-2002, 03:13 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
or <>
can be !string1=string2
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #17  
Old 02-05-2002, 03:54 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Kaimetsu


Is it worth pointing out that Graal strings can't be compared in that way, and that "==" would be more appropriate?
*agrees*
Reply With Quote
  #18  
Old 02-05-2002, 04:20 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
wouldn't you use !strequals(stringwhatever,stringwhatever2)
??


another question about <>, i guess i thought about it wrong, you cant specify a rang with that can u??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #19  
Old 02-05-2002, 01:25 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
lol
i think he meant vars but was tired.

i am not sure if
!var1==var2 would work. o it wouldn't, because the var1 becomes false...
__________________

!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
Reply With Quote
  #20  
Old 02-05-2002, 06:21 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
<> just means that the first var has to be bigger or smaller then the second

um lets show it another way:

if(var1<>var2) message Oki;

if var 1 and var2 are the same nothing will happen
if they aren't the same the NPC will say "Oki"

or lets say it's the opposite of ==
__________________
No Webhost at the moment
Reply With Quote
  #21  
Old 02-05-2002, 06:48 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Quote:
Originally posted by Kaimetsu


Yes, we all understand this. It's just that most of us prefer the arguably superior "!=".
hmmm I shouldn't read that fast
but what u prefer is sure the best way *rofl*
__________________
No Webhost at the moment
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:16 AM.


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