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 03-24-2003, 07:40 PM
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
#r

Quote:
Originally posted by Kaimetsu
'#R(string)' is equivalent to '#I(string,int(random(0,sarraylen(string)))'
I made this example,wors fine,as Kai said:
NPC Code:

if(created || timeout){
setstring this.names,osrs kaimetsu stefan jagen;
message #I(this.names,int(random(0,sarraylen(this.names))) );
}
timeout=0.05;




why this one don't work?

NPC Code:

if(created || timeout){
setstring this.names,osrs kaimetsu stefan jagen;
message #R(#s(this.names));
}
timeout=0.05;



I made anything wrong? if yes,i'm sorry but i still dont know how to work correctly with #R.
__________________
"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
  #2  
Old 03-24-2003, 07:45 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Re: #r

Quote:
Originally posted by osrs


I made this example,wors fine,as Kai said:
NPC Code:

if(created || timeout){
setstring this.names,osrs kaimetsu stefan jagen;
message #I(this.names,int(random(0,sarraylen(this.names))) );
}
timeout=0.05;




why this one don't work?

NPC Code:

if(created || timeout){
setstring this.names,osrs kaimetsu stefan jagen;
message #R(#s(this.names));
}
timeout=0.05;



I made anything wrong? if yes,i'm sorry but i still dont know how to work correctly with #R.

This is pure guesswork but I would try.

setstring this.names,"osrs","kaimetsu","stefan","jagen";
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #3  
Old 03-24-2003, 07:45 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Re: #r

serverside only right now, and try seperating the names by commas? I'm not sure if #R seperates by spaces as well
Reply With Quote
  #4  
Old 03-24-2003, 07:57 PM
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
hmm..now i'm more confuse about #R...
__________________
"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 03-24-2003, 09:11 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
try #R(this.names)
I think your parseing the string twice, if #R works the way I think it does
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #6  
Old 03-24-2003, 11:43 PM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
#R only works serverside and online, not offline
and if it's not working online, try separating the names with commas
Reply With Quote
  #7  
Old 03-25-2003, 01:55 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Quote:
Originally posted by ShadowDarkstar
#R only works serverside and online
There is a serverside offline?
__________________
new account: Trevor
Reply With Quote
  #8  
Old 03-25-2003, 02:20 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan is on a distinguished road
Quote:
Originally posted by tlf288


There is a serverside offline?
Meaning not on a server beneath a //#CLIENTSIDE comment tag... Only on the serverside, which would imply it's online... but people are sometimes not smart and think if they don't put //#CLIENTSIDE then it's serverside, even in the editor
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #9  
Old 03-30-2003, 07:00 PM
Ethic_Sern Ethic_Sern is offline
Banned
Join Date: Aug 2002
Location: NewYork,NY
Posts: 97
Ethic_Sern is on a distinguished road
Send a message via AIM to Ethic_Sern
Re: #r

Quote:
Originally posted by osrs


I made this example,wors fine,as Kai said:
NPC Code:

if(created || timeout){
setstring this.names,osrs kaimetsu stefan jagen;
message #I(this.names,int(random(0,sarraylen(this.names))) );
}
timeout=0.05;

Does it only work with random tokens for the string? if not what else could it be used for?
Reply With Quote
  #10  
Old 04-17-2003, 04:16 AM
Pokilty Pokilty is offline
Registered User
Join Date: Nov 2002
Posts: 101
Pokilty is on a distinguished road
Re: Re: #r

Quote:
Originally posted by Ethic_Sern

Does it only work with random tokens for the string? if not what else could it be used for?
It seems to me, based on Kai's definition, that all #R does is select a random string from an array of strings. Probably helpful for a card game where you want to draw a random card. I've never seen or used the function myself though... but the definition indicates that it would only work with random tokens otherwise it wouldn't be #R, you could use #s or #t for whatever script you need.
__________________
"I have not failed. I've just found 10,000 ways that won't work."
"Logic is in the eye of the logician."
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 04:42 AM.


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