Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   GraalOnline Era (https://www.graalians.com/forums/forumdisplay.php?f=13)
-   -   NPC code: offline editor (https://www.graalians.com/forums/showthread.php?t=6111)

Dude1310 05-05-2012 12:25 AM

NPC code: offline editor
 
I added this code to an npc i made:
PHP Code:

function onPlayerChats() {
    if (
player.chat == "open") {
hide;
sleep 10;
show;}} 

whenever i play the level in offline editor and make my character say open, the npc doesnt hide..nothing happens, why?

Beholder 05-05-2012 12:29 AM

Offline level editor hasn't been updated since around 2004 and uses GraalScript v1 (Because they don't love any of you)

GS1 :
PHP Code:

if(playerchats && strequals(#c,/open)
  
&& (strequals(#a,Graal771281) || strequals(#g,Events Team))) {
  
hide;
  
sleep 10;
  
show;



Dude1310 05-05-2012 12:31 AM

i tried this:
PHP Code:

if (playerchats) {
if (
player.chat == "open") {
hide;
sleep 5;
show;}} 

and it worked..why didn't the other code work?

BboyEatsbacon 05-05-2012 01:35 AM

Quote:

Posted by Dude1310 (Post 109940)
i tried this:
PHP Code:

if (playerchats) {
if (
player.chat == "open") {
hide;
sleep 5;
show;}} 

and it worked..why didn't the other code work?

Your script was partly GS1 and partly GS2. The offline editor doesn't support GS2.

Dude1310 05-05-2012 01:57 AM

wait so what code do i use?

BboyEatsbacon 05-05-2012 01:58 AM

Quote:

Posted by Dude1310 (Post 110002)
wait so what code do i use?

You have to use GS1 in GraalEditor.

Dude1310 05-05-2012 02:38 AM

but isnt this gs1?:
PHP Code:

if (playerchats) {
if (
player.chat == "open") {
hide;
sleep 5;
show;}} 

because this code works...

PerfectDark 05-05-2012 03:19 AM

Quote:

Posted by Beholder (Post 109938)
Offline level editor hasn't been updated since around 2004 and uses GraalScript v1 (Because they don't love any of you)

GS1 :
PHP Code:

if(playerchats && strequals(#c,/open)
  
&& (strequals(#a,Graal771281) || strequals(#g,Events Team))) {
  
hide;
  
sleep 10;
  
show;



O_o my account number..

callimuc 05-05-2012 10:47 AM

Quote:

Posted by Dude1310 (Post 110002)
wait so what code do i use?

You should use Beholder ones
Quote:

Posted by Beholder (Post 109938)
Offline level editor hasn't been updated since around 2004 and uses GraalScript v1 (Because they don't love any of you)

GS1 :
PHP Code:

if(playerchats && strequals(#c,/open)
  
&& (strequals(#a,Graal771281) || strequals(#g,Events Team))) {
  
hide;
  
sleep 10;
  
show;



or maybe if you don't need the account/guild check:
PHP Code:

if (playerchats && strequals(#c,/open) {
  
hide;
  
sleep 10;
  
show;



For online usage you should use:
PHP Code:

function onPlayerChats() {
  if (
player.chat == "/open") {
    
hide();
    
sleep(5);
    
showagain(); //or just show() not sure
  
}



Dude1310 05-05-2012 01:53 PM

oh ok thx!

Johnaudi 05-05-2012 02:03 PM

Quote:

Posted by Dude1310
oh ok thx!

It's better to train with Gs2
Pm me ill give u access to my server this way you can test it up

Cigam 05-05-2012 02:47 PM

Quote:

Posted by Dude1310 (Post 109940)
i tried this:
PHP Code:

if (playerchats) {
if (
player.chat == "open") {
hide;
sleep 5;
show;}} 

and it worked..why didn't the other code work?

The other code didn't work because it was part GS2 part GS1. Offline Editor is only GS1.

callimuc 05-05-2012 03:53 PM

Quote:

Posted by Cigam (Post 110274)
The other code didn't work because it was part GS2 part GS1. Offline Editor is only GS1.

Already been said by BBoy ;)

Cigam 05-05-2012 04:20 PM

Quote:

Posted by callimuc (Post 110288)
Already been said by BBoy ;)

I just skipped almost all the other post. Sorry, didn't see his.

Dude1310 05-05-2012 06:21 PM

Quote:

Posted by Johnaudi (Post 110253)
It's better to train with Gs2
Pm me ill give u access to my server this way you can test it up

oh ok cool, yea i would like access(: just tell me some time to go online pc graal.

So wait, offline editor uses gs1, then what does online editor use (the real server)? does that still use gs1 or is there a different code?

Johnaudi 05-05-2012 07:15 PM

Quote:

Posted by Dude1310

oh ok cool, yea i would like access(: just tell me some time to go online pc graal.

So wait, offline editor uses gs1, then what does online editor use (the real server)? does that still use gs1 or is there a different code?

You can use gs2 on graal editor.
Use //#CLIENTSIDE at the beginning of the script, it won't work offline, but once uploaded to server it will work there.

Dude1310 05-06-2012 05:22 AM

hmmm how do i figure out if the code i used is gs1 or gs2?

Johnaudi 05-06-2012 06:03 AM

Quote:

Posted by Dude1310
hmmm how do i figure out if the code i used is gs1 or gs2?

Meet me in game or on Era PC, lock thread/close


All times are GMT. The time now is 10:44 AM.

Powered by vBulletin/Copyright ©2000 - 2026, vBulletin Solutions Inc.