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 04-10-2011, 10:47 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
say(int) not working?

I have an npc with the following code in it:
PHP Code:
  //#CLIENTSIDE
  
function onPlayertouchsme(){
  
dir 3;
  
say(1);
  
sleep 3;
  
dir 2;

But everything except the actual sign text works when i touch it.

I have also tried:
PHP Code:
  function onPlayertouchsme(){
  
dir 3;
  
say(1);
  
sleep 3;
  
dir 2;

PHP Code:
  //#CLIENTSIDE
  
function onPlayertouchsme(){
  
dir 3;
  
say 1;
  
sleep 3;
  
dir 2;

and

PHP Code:
  function onPlayertouchsme(){
  
dir 3;
  
say 1;
  
sleep 3;
  
dir 2;

but with no luck. say2 seemed to break when I tried using the image codes (or perhaps it was the line breaks). Otherwise it works when I put in something like say2("!");

Any ideas why my say(int) isn't working though?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 04-10-2011, 10:56 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
The default sign messages are serverside only for using with say();.
Reply With Quote
  #3  
Old 04-10-2011, 10:59 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by ffcmike View Post
The default sign messages are serverside only for using with say();.
I've tried that but it doesn't work.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #4  
Old 04-10-2011, 11:33 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Last time I actually used this was 2007, not sure if it's still supposed to work, don't suppose you're doing this on a gmap?
Reply With Quote
  #5  
Old 04-11-2011, 12:35 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by ffcmike View Post
Last time I actually used this was 2007, not sure if it's still supposed to work, don't suppose you're doing this on a gmap?
I am, actually. Perhaps that's somehow part of the problem? Though the sign is in the same level too..
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #6  
Old 04-11-2011, 12:42 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Jiroxys7 View Post
I am, actually. Perhaps that's somehow part of the problem? Though the sign is in the same level too..
This is likely to be the problem then, even sign messages positioned in place that don't require say(); are problematic on a gmap.
Reply With Quote
  #7  
Old 04-13-2011, 03:14 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Just thought I would note that, Jiroxys7's only reason why he wouldn't use say2 was because the message codes weren't working properly for him.

Message codes still work, you just have to use them in the string like so:

PHP Code:
function onPlayerEnters() {
  
player.say2("WINNING!#b  - Charlie Sheen");
  
player.say2(format("Welcome to my level!#b#n #i(%s,0,64,32,32)"player.head));

Message Codes Reference (from commands.txt):

Quote:
Message codes (for ‘message’, ‘strequals’, etc.)
#a the account name of the player
#b line break (for say2)
#C0, #C0(index) the skin color
#C1, #C1(index) the coat color
#C2, #C2(index) the sleeves color
#C3, #C3(index) the shoes color
#C4, #C4(index) the belt color
#c, #c(index) the current chat text of the player
#e(startindex,length,string) extracts a substring out of ‘string’ (length=-1 -> till the end)
#f the image filename of the npc
#g, #g(index) the guild name of the player
#I(list,index) gets a string of a string list
#i(imgname), #i(imgname,x,y,w,h) displays an image or a part of an image when used in a sign
#K(keyindex) the name of the specified key
#k(keyindex) the description of the specified key (in local language / key assignments)
#L the current level filename
#m, #m(index) the animation of the player
#n, #n(index) the nick name of the player (index=-1 -> npc character, 0 -> current player)
#P1, #P1(index) the gani attribute 1 (hat)
#P2, #P2(index) the gani attribute 2
#P3, #P3(index) the gani attribute 3
#P4, #P4(index) the gani attribute 4
#P5, #P5(index) the gani attribute 5
#p(index) action parameter of the specified index
#s(var) the value of the string variable ‘var’
#t(index) token of the specified index, produced with tokenize
#T(string) trims the string (removes spaces at the beginning and end)
#v(var) the value of ‘var’ as string
#W, #W(index) the filename of the weapon icon
#w,#w(index) the name of the current npc weapon of the player
#1, #1(index) the sword image filename of the player
#2, #2(index) the shield image filename of the player
#3, #3(index) the head image filename of the player
#5, #5(index) the image filename of the player’s horse
#6, #6(index) the image filename of the npc that is carried by the player
#8, #8(index) the body image filename of the player
__________________
Quote:
Reply With Quote
  #8  
Old 04-14-2011, 10:39 PM
BboyEatsbacon BboyEatsbacon is offline
The Bacon Man
BboyEatsbacon's Avatar
Join Date: Feb 2011
Location: United States
Posts: 60
BboyEatsbacon will become famous soon enough
The command is not say(test);. It is say("test");.
You could also use player.chat = "test";.
__________________
Reply With Quote
  #9  
Old 04-14-2011, 11:07 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by BboyEatsbacon View Post
The command is not say(test);. It is say("test");.
You could also use player.chat = "test";.
Wrong. say expects the sign ID as the parameter, and setting the player's chat is something different entirely.

Quote:
Originally Posted by scripthelp
say(int)
__________________
Reply With Quote
  #10  
Old 04-15-2011, 07:51 PM
BboyEatsbacon BboyEatsbacon is offline
The Bacon Man
BboyEatsbacon's Avatar
Join Date: Feb 2011
Location: United States
Posts: 60
BboyEatsbacon will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
Wrong. say expects the sign ID as the parameter, and setting the player's chat is something different entirely.
Whoops, I was thinking of a different command. Sorry.
__________________
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 11:45 PM.


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