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 08-06-2010, 05:09 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Exclamation 2 Questions...

Does anyone have any idea how to disable defualt unstick me command?
also how do i check rc chat , ex: if(rcchat == "example")
Reply With Quote
  #2  
Old 08-06-2010, 05:19 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
PHP Code:
//#CLIENTSIDE
function ChatBar.onAction()
{
  if (
ChatBar.text in "unstick me""unstuck me" })
    
ChatBar.text "disabled!";

In Control-NPC:

PHP Code:
function onRCChat(command)
{
  if (
command == "test")
    echo(
"It works!");

Trigger it by doing the following on RC:

/npctest
/npc test

Either one works.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #3  
Old 08-06-2010, 08:31 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Also... umm ive bein trying to do this
PHP Code:
//#CLIENTSIDE
function onPlayerTouchsMe()
  {
setlevel2("example.gmap",30,30);

is their a way to warp to a level in clientside?
im using a level npc if it makes a diffrence...
Reply With Quote
  #4  
Old 08-06-2010, 08:37 PM
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
setlevel2 is a server-side player function.

PHP Code:
function onPlayerTouchsMe() {
  
player.setlevel2("onlinestartlocal.nw"3030);

Would work just fine.
__________________
Quote:
Reply With Quote
  #5  
Old 08-06-2010, 09:31 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Quote:
Originally Posted by fowlplay4 View Post
setlevel2 is a server-side player function.

PHP Code:
function onPlayerTouchsMe() {
  
player.setlevel2("onlinestartlocal.nw"3030);

Would work just fine.
PHP Code:
function onPlayerTouchsMe() {
  if(
client.quest1 == 4)
    {
    
this.chat="Ok you have permission... so we'll be off!";
    
client.quest1=5;
    
freezeplayer(1);
    
this.e=0.1;
    
seteffect(0,0,0,this.e);//1
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//2
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//3
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//4
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//5
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//6
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//7
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//8
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//9
    
sleep(.1);
    
this.e+=.1;
    
seteffect(0,0,0,this.e);//10
    
sleep(.1);
    
this.chat="";
    
seteffect(0,0,0,0);
    
setani("sleep",null);
    
player.setlevel2("express_boat-storm2.nw",36.5,18);
  }

me fail cake... helps pls?
Reply With Quote
  #6  
Old 08-06-2010, 09:37 PM
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
You need to tell the server to warp the player, which is done easily with triggeraction. Since this is just a level npc, you can do it like this:

PHP Code:
function onCreated() {
  
// Gives NPC shape to be 'hit' with triggeractions on the server-side.
  
setshape(13232);
}

function 
onActionWarpPlayer() {
  
player.setlevel2("onlinestartlocal.nw"3030);
}

//#CLIENTSIDE

function onPlayerTouchsMe() {
  
triggeraction(this.1this.1"WarpPlayer""");

Your duplicate code can also be redone with a for loop.
__________________
Quote:

Last edited by fowlplay4; 08-06-2010 at 10:11 PM..
Reply With Quote
  #7  
Old 08-06-2010, 09:48 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Quote:
Originally Posted by fowlplay4 View Post
You need to tell the server to warp the player, which is done easily with triggeraction. Since this is just a level npc, you can do it like this:

PHP Code:
function onCreated() {
  
// Gives NPC shape to be 'hit' with triggeractions on the server-side.
  
setshape(13232);
}

function 
onActionWarpPlayer() {
  
player.setlevel2("onlinestartlocal.nw"3030);
}

//#CLIENTSIDE

function onPlayerTouchsMe() {
  
triggeraction(this.1this.y, + 1"WarpPlayer""");

Your duplicate code can also be redone with a for loop.
Do you know how much i love you? <3 Thanks. EDIT : NVM! EDIT x2: NVM TAT NVM I LOVE U!
PHP Code:
function onActionWarpPlayer() {
  
player.setlevel2("express_boat-storm2.nw",36.5,18);
}
//#CLIENTSIDE
function onCreated()
  {
  
setshape(1,32,32);
}
function 
onPlayerTouchsMe()
  {
  if(
client.quest1=4)
    {
    
triggeraction(this.1this.y, + 1"WarpPlayer""");
    
setani("sleep",NULL);
    
client.quest1=5;
  }

it still no work! but setting client.quest1 works perfectly...

Last edited by xMane; 08-06-2010 at 09:59 PM.. Reason: no love for no working script >:( EDIT x2 lololol u dont have to add +1 to each coord in the triggeraction...
Reply With Quote
  #8  
Old 08-06-2010, 10:03 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by xMane View Post
Do you know how much i love you? <3 Thanks. EDIT : NVM! EDIT x2: NVM TAT NVM I LOVE U!
PHP Code:
function onActionWarpPlayer() {
  
player.setlevel2("express_boat-storm2.nw",36.5,18);
}
//#CLIENTSIDE
function onCreated()
  {
  
setshape(1,32,32);
}
function 
onPlayerTouchsMe()
  {
  if(
client.quest1=4)
    {
    
triggeraction(this.1this.y, + 1"WarpPlayer""");
    
setani("sleep",NULL);
    
client.quest1=5;
  }

it still no work! but setting client.quest1 works perfectly...
not 100% sure on this since I always do it but I believe you need to add a setshape on the serverside as well.
Reply With Quote
  #9  
Old 08-06-2010, 10:09 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 Mark Sir Link View Post
not 100% sure on this since I always do it but I believe you need to add a setshape on the serverside as well.
Yes.

You've also got an extra comma on this line after this.y:

PHP Code:
triggeraction(this.1this.y, + 1"WarpPlayer"""); 
should be

PHP Code:
triggeraction(this.1this.1"WarpPlayer"""); 
__________________
Reply With Quote
  #10  
Old 08-06-2010, 10:10 PM
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
My example did have an error. Changing the following should fix it:

1. triggeraction(this.x + 1, this.y + 1, "WarpPlayer", "");
2. No setshape on the server-side.

The '+ 1' is personal preference, I prefer it to hit inside the NPC and not on the corner of it.
__________________
Quote:
Reply With Quote
  #11  
Old 08-07-2010, 03:14 AM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Quote:
Originally Posted by xXziroXx View Post
PHP Code:
//#CLIENTSIDE
function ChatBar.onAction()
{
  if (
ChatBar.text in "unstick me""unstuck me" })
    
ChatBar.text "disabled!";

I want to like zod's unstick that a gui pops up.
Reply With Quote
  #12  
Old 08-07-2010, 03:17 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by xMane View Post
I want to like zod's unstick that a gui pops up.
Then script a GUI that does just that!
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
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 05:54 PM.


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