Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Disabling default signs (https://forums.graalonline.com/forums/showthread.php?t=85649)

DustyPorViva 05-21-2009 02:39 AM

Disabling default signs
 
I need to disable them, without actually getting rid of the supported methods(signs in the level editor). Any ideas?

fowlplay4 05-21-2009 05:37 AM

Probably something like..

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
setTimer(0.05);
}
function 
onTimeout() {
  if (
player.readingsay2("");
  
setTimer(0.05);


After testing.. it appears say2(""); doesn't clear it but you if change it too something like.. say2("!"); it will show the ! say2 message.

Inverness 05-21-2009 05:18 PM

Quote:

Originally Posted by fowlplay4 (Post 1492730)
Probably something like..

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
setTimer(0.05);
}
function 
onTimeout() {
  if (
player.readingsay2("");
  
setTimer(0.05);


After testing.. it appears say2(""); doesn't clear it but you if change it too something like.. say2("!"); it will show the ! say2 message.

That is not disabling them.

Frankie 05-21-2009 05:26 PM

I'm a bit confused with the way you worded it.

you want to disable the default signs but you still want to use the level editor method for them (the red thing) for different messages other than say2(); ?

not sure if that's possible. I would just use an npc that mimics the function of the red box that brings up the sign.

DustyPorViva 05-21-2009 06:44 PM

Well I want to use my own system, but I still want signs to be easily accessible to others. Ya know?

fowlplay4 05-21-2009 08:20 PM

Using onLevelFileUpdated(filename) script you can write a function to replace the graal signs with your sign script as the levels are uploaded.

DustyPorViva 05-21-2009 08:27 PM

Hmm... that does sound reasonable. Not exactly what I was hoping but I guess I don't have any other option.

DustyPorViva 05-22-2009 10:05 AM

Also, is there a way to read the text of a sign(default) on the clientside with a script?

fowlplay4 05-22-2009 05:20 PM

It should be possible..

PHP Code:

/*
    Considering the following..

    TServerSign.text - string
    TServerSign.x - integer
    TServerSign.y - integer

    And from the GS1 commands.txt

    signscount          the signs count
    signs[index].x          a sign's horizontal position
    signs[index].y          a sign's vertical position
*/
//#CLIENTSIDE
function onCreated() {
  for (
temp.signplayer.level.signs) {
    echo(
sign.text);
  }


But after testing it doesn't seem to store signs in the most likely place. So I don't think we can.

Tigairius 05-22-2009 07:05 PM

Quote:

Originally Posted by fowlplay4 (Post 1493107)
It should be possible..

But after testing it doesn't seem to store signs in the most likely place. So I don't think we can.

Unfortunately, I don't believe signs have a text variable clientside. The actual object exists but I don't think it has any variables.

DustyPorViva 05-22-2009 07:09 PM

I can't even get testsign to return anything :(

Tigairius 05-22-2009 07:19 PM

Quote:

Originally Posted by DustyPorViva (Post 1493122)
I can't even get testsign to return anything :(

Well, I think the only way to get a testsign to return anything would be something like
PHP Code:

//#CLIENTSIDE
level.signs[testsign(player.xplayer.y)].text 

but I don't think clientside signs' text can even be accessed.

DustyPorViva 05-22-2009 07:27 PM

:(
Any reason why? They should at least be read-only, I don't see a single security risk in that...

Tigairius 05-22-2009 08:03 PM

Quote:

Originally Posted by DustyPorViva (Post 1493125)
:(
Any reason why? They should at least be read-only, I don't see a single security risk in that...

I don't know why, but it's possible that Stefan meant to add it but just forgot. We are also trying to discourage the use of level signs, and would prefer people use NPCs instead, but I'm not sure if that's the reason.


All times are GMT +2. The time now is 12:45 PM.

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