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 09-18-2001, 06:05 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Embarassingly easy script I can't figure out

Why won't this work?

// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (timeout) {
tokenize level.room1names;
message #v(tokenscount);
for (i=0;i<tokenscount;i++) {
if (strequals(#s(#t(i)),#a))hidelocal;
}
if (strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;
}

=/ First time using commands after 1.41....
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #2  
Old 09-18-2001, 06:24 AM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
Re: Embarassingly easy script I can't figure out

PHP Code:
// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (
timeout) {
tokenize #s(level.room1names);
message #v(tokenscount);
for (i=0;i<tokenscount;i++) {
if (
strequals(#s(#t(i)),#a))hidelocal;
}
if (
strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;

Maybe that should work...
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #3  
Old 09-18-2001, 06:38 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Nope =/. I know what the problem is... Graal won't tokenize level.room1names for some reason, but I know not how to fix it so it will.
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #4  
Old 09-18-2001, 08:14 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Re: Re: Embarassingly easy script I can't figure out

Quote:
Originally posted by Cybnext_Design
PHP Code:
// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (
timeout) {
tokenize #s(level.room1names);
message #v(tokenscount);
for (i=0;i<tokenscount;i++) {
if (
strequals(#s(#t(i)),#a))hidelocal;
}
if (
strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;

Maybe that should work...
Jadis:

dont use #s(#t(i))
just use #t(i)
it still might not work, but that is how you use tokens
Reply With Quote
  #5  
Old 09-18-2001, 09:03 AM
Enigma_GP6 Enigma_GP6 is offline
Banned
Join Date: Jul 2001
Location: Who?
Posts: 261
Enigma_GP6 is on a distinguished road
Send a message via ICQ to Enigma_GP6 Send a message via AIM to Enigma_GP6
-Some Rebel guy Hacking into This Account
PHP Code:
if (playertouchsme){
say2 This NPC is impossibly #b
unneeded;
sleep .5;

-Some Rebel guy Hacking into This Account
Reply With Quote
  #6  
Old 09-18-2001, 09:10 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Okay... Is there ANYONE here able to tokenize a defined string?
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #7  
Old 09-18-2001, 04:02 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
NPC Code:
if (created) {
setstring test.string,a b c d e f;
tokenize #s(test.string);
message #v(tokenscount);
for (i=tokenscount-1;i>=0;i++) setstring test.string,#s(test.string) #t(i);
}


That should make test.string into "a b c d e f f e d c b a" once it's been run...
__________________

Reply With Quote
  #8  
Old 09-18-2001, 04:38 PM
toad1413 toad1413 is offline
toad@graal:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
I'm guessing I should learn how to use strings...
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
  #9  
Old 09-19-2001, 02:56 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Thanks!!!!
Will that work if the string is set by anohter NPC?
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #10  
Old 09-19-2001, 08:28 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Quote:
Originally posted by Kaimetsu


Of course. Your problem was that you weren't actually parsing the string - you were parsing the string variable's name because you didn't use #s.

Huh? Could you leave an example, Kai... I don't quite get what you say. You use too much jargon that we of lesser vocabulary and knowlegde of wording cannot quite grasp, and without use of simple examples; we are left in the dark...
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #11  
Old 09-19-2001, 05:40 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by CyanideSR71



Huh? Could you leave an example, Kai... I don't quite get what you say. You use too much jargon that we of lesser vocabulary and knowlegde of wording cannot quite grasp, and without use of simple examples; we are left in the dark...
What he's trying to say is that you were tokenizing the word level.room1names instead of the string level.room1names.
__________________

Reply With Quote
  #12  
Old 09-19-2001, 10:14 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Kaimetsu


"trying"?
Alright, failing miserably.
__________________

Reply With Quote
  #13  
Old 09-19-2001, 10:30 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Kaimetsu


Only to those with low understanding thresholds, Ms Midnight.
Which could be said to mean failing miserably in the case of the average understanding threshold here.
__________________

Reply With Quote
  #14  
Old 09-19-2001, 10:40 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Kaimetsu


I think it would be more accurate to describe those with such thresholds as failing miserably to understand.
Perhaps, yet the explanation is also failing miserably due to the fact that it fails to explain what you were trying to explain to a large number of people.
__________________

Reply With Quote
  #15  
Old 09-19-2001, 10:53 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Kaimetsu


You assume that my intention was to help people understand, whereas in reality their confusion is no bad thing to me. If anything, it makes me appear to be more intelligent.
In that case it was the opposite of a miserable failure.
__________________

Reply With Quote
  #16  
Old 09-20-2001, 12:11 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Ah, but those who are truely intelligent know to be able to speak to the sharper and slower alike. Being obnoxious and attempting to make yourself look better than everyone else in such a way has both been admonished by those who teach English, and makes you look like an ass.
*Waits for you to come back with some witty comeback I won't understand again, so I'll just call you an ass.*

Thanks Lady Midnight! That helps a lot!
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #17  
Old 09-20-2001, 12:42 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Haha, I just realized I said 'come back with some witty comeback.' Redundency is fun!
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #18  
Old 09-20-2001, 01:41 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
PHP Code:
// NPC made by Cyanide SR71
if (playerenters) {
show;
timeout=0.05;
}

if (
timeout) {
setstring level.room1name,#a bob;
tokenize #s(level.room1names);
for (i=0;i<tokenscount;i++) {
if (
strequals(#t(i),#a)) hidelocal;
}
if (
strequals(#s(level.owneracc),#a)) hidelocal;
timeout=0.05;

Why doesn't this work? It still won't tokenize...
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #19  
Old 09-20-2001, 09:59 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:

setstring level.room1name,#a bob;
tokenize #s(level.room1names);

look at it and think hard.
Reply With Quote
  #20  
Old 09-20-2001, 10:27 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
HAHAHAHA!!!! NICE!!!
Okay, it works now, but I want another NPC to set the string, and this NPC to recieve that string and follow through, but it doesn't seem to work. Would this work in online mode? (Please tell me if this is too confusing)
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #21  
Old 09-21-2001, 02:56 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Quote:
Originally posted by Kaimetsu


Indeed, and I am proud to consider myself able to do this.
No, you babble jibberish to those 99% of the people who wouldn't care to be an wordy as you are, But thanks for the tip on not tokenizing.
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #22  
Old 09-21-2001, 03:36 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Okay, now you are an ass.
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #23  
Old 09-21-2001, 04:48 AM
SagaTCN SagaTCN is offline
Registered User
Join Date: Aug 2001
Location: West Michigan
Posts: 190
SagaTCN is on a distinguished road
Send a message via ICQ to SagaTCN Send a message via AIM to SagaTCN Send a message via Yahoo to SagaTCN
www.dictionary.com is our friend.
__________________

Rogue World
Reply With Quote
  #24  
Old 09-21-2001, 07:54 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
He was talking some coder jargon, Rogue. And nevetheless, if I am forced to use that, what he said was uneffective.
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #25  
Old 09-21-2001, 08:18 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
mommy

have you seen my mommy ?
Reply With Quote
  #26  
Old 09-21-2001, 11:20 PM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Your delivery of what you said.
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #27  
Old 09-22-2001, 04:24 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
Odd... I always though you learned from mistakes... And it helps if you know th mistake...
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
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 10:06 PM.


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