Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   say(int) not working? (https://forums.graalonline.com/forums/showthread.php?t=134262772)

Jiroxys7 04-10-2011 10:47 PM

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?

ffcmike 04-10-2011 10:56 PM

The default sign messages are serverside only for using with say();.

Jiroxys7 04-10-2011 10:59 PM

Quote:

Originally Posted by ffcmike (Post 1642521)
The default sign messages are serverside only for using with say();.

I've tried that but it doesn't work.

ffcmike 04-10-2011 11:33 PM

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?

Jiroxys7 04-11-2011 12:35 AM

Quote:

Originally Posted by ffcmike (Post 1642530)
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..

ffcmike 04-11-2011 12:42 AM

Quote:

Originally Posted by Jiroxys7 (Post 1642541)
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.

fowlplay4 04-13-2011 03:14 AM

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

BboyEatsbacon 04-14-2011 10:39 PM

The command is not say(test);. It is say("test");.
You could also use player.chat = "test";.

cbk1994 04-14-2011 11:07 PM

Quote:

Originally Posted by BboyEatsbacon (Post 1643353)
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)


BboyEatsbacon 04-15-2011 07:51 PM

Quote:

Originally Posted by cbk1994 (Post 1643361)
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.


All times are GMT +2. The time now is 05:59 PM.

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