Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   JKL's Scripting Questions (https://forums.graalonline.com/forums/showthread.php?t=134258195)

jkldogg 04-03-2010 09:57 AM

Quote:

Originally Posted by DrakilorP2P (Post 1566676)
It'd help if you told us how it isn't working.

Not sure if this will fix it, but try formatting the setlevel2 lines like this:
PHP Code:

setlevel2("vega_spar.nw",32.25,21.5); 

It would have been valid GS1, but you had a ) without a matching (.

Quote:

Originally Posted by fowlplay4 (Post 1566823)
Did you update the script any? If you followed Drakilor's tip to fix it should be fine.

Yes, i fixed the set levels and went in game and said :in and it didn't work.

Graal Editor gave me this error when I clicked Test

PHP Code:

ErrorExpected format setlevel2 string,real,real


Codein 04-03-2010 10:02 AM

Quote:

Originally Posted by jkldogg (Post 1566835)
Yes, i fixed the set levels and went in game and said :in and it didn't work.

Graal Editor gave me this error when I clicked Test

PHP Code:

ErrorExpected format setlevel2 string,real,real


Could you post your updated script?

Switch 04-03-2010 10:13 AM

Quote:

Originally Posted by jkldogg (Post 1566835)
Graal Editor

You have to test this online. GS2 doesn't work offline.

jkldogg 04-03-2010 10:43 AM

Codein

PHP Code:

function onPlayerChats() {
  if (
player.chat==":in") {
    if (
clientr.inspar==false) {
      if (
serverr.sparp<2) {
        
clientr.inspar true;
        
serverr.sparp += 1;
        
player.chat "";
        
setlevel2("vega_spar.nw",32.25,21.5);
      }else
          
player.chat "Therearepeopletheinsparalready";
    }else
        
player.chat "";
  }elseif (
player.chat=="ut") {
    if (
clientr.inspar==true) {
      
serverr.sparp -= 1;
      
clientr.inspar false;
      
player.chat "";
      
setlevel2("vega_spar.nw",32.25,21.5);
    }else
        
player.chat "";
  }



Switch How, a weapon?

FaLLChiLD 04-03-2010 10:55 AM

Sorry...but this thread is blowing my f*#&ing mind, lol!

DrakilorP2P 04-03-2010 12:26 PM

Quote:

Originally Posted by jkldogg (Post 1566840)
Switch How, a weapon?

You can just put it in an NPC in the level.

Switch 04-03-2010 01:04 PM

Quote:

Originally Posted by jkldogg (Post 1566840)
Switch How, a weapon?

A level NPC would be best, like Drakilor said. Also, if this is going right in the same level that the spar area is in, you might as well use player.x and player.y instead of setlevel2(), since that may be easier to read.

fowlplay4 04-03-2010 04:54 PM

I believe it might be related due to the lack of the player prefix, or conflict with local systems.

Try this level script:

PHP Code:

function onPlayerChats() {
  if (
player.chat == "testwarp") {
    
player.setlevel2("onlinestartlocal.nw"3030);
    
player.chat "Warped!";
  }



Switch 04-04-2010 03:35 AM

Quote:

Originally Posted by fowlplay4 (Post 1566864)
I believe it might be related due to the lack of the player prefix, or conflict with local systems.

Since the player triggers the onPlayerChat() event, you don't need to use the player prefix, at least I haven't had to, though it is good practice to do so.

jkldogg 04-04-2010 07:38 AM

Quote:

Originally Posted by fowlplay4 (Post 1566864)
I believe it might be related due to the lack of the player prefix, or conflict with local systems.

Try this level script:

PHP Code:

function onPlayerChats() {
  if (
player.chat == "testwarp") {
    
player.setlevel2("onlinestartlocal.nw"3030);
    
player.chat "Warped!";
  }



This Worked, but i'm scrapping that spar system that i made, it sucks.

Liberated 04-04-2010 12:15 PM

Quote:

Originally Posted by cbk1994 (Post 1566761)
And you really wouldn't need or want a timeout for that.

No? Then in what way can you constantly check if the player is still in the level?

edit:
Ah im assuming you mean onPlayerLeaves()?


All times are GMT +2. The time now is 09:42 PM.

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