Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-10-2009, 08:09 AM
coolman87 coolman87 is offline
Registered User
Join Date: Mar 2006
Posts: 3
coolman87 is on a distinguished road
Help please :[

okay so basically im trying to make a script and yeah i know theres alot of things that can be done to format better but i simplified it alot to try and find the problem, anyway i got the idea from zack on npulse and its just a "stamp" npc where you say /stamp account message and itll put a message by the player and follow them around.
so i put this in the weapon. I put an echo script and couldnt get it to echo so its not triggering but i dont know why.

PHP Code:
function onActionServerside() {
if (
params[0]=="stamp") {
echo(
params[0],params[1],params[2]);
findPlayer(params[1]).x=temp.x+1.5;
findPlayer(params[1]).y=temp.y+1.5;
serverr.stamp=params[2];
with (putnpc2(temp.xtemp.y"join soren_stamp;"))
{
  
this.follow_account params[0];
}
}
}
//#CLEINTSIDE
function onPlayerChats() {
t=player.chat.tokenize();
if (
t[0]=="/stamp") {
triggerServer("gui",name,"stamp",t[1],t[2]);
}
}

// and this in the class

function onCreated() {
this.chat=serverr.stamp;
settimer(.05);
}
function 
onTimeout() {
this.chat=serverr.stamp;
warpto(this.follow_account);
settimer(.05);


Last edited by Tigairius; 07-12-2009 at 07:07 AM.. Reason: Wrap your script in [php] tags. Read scripting forum rules before posting.
Reply With Quote
  #2  
Old 07-10-2009, 08:49 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
wouldn't it be easier to just do a showText using findimg by the player rather than an NPC if your just doing text?

Example:

PHP Code:
function onActionServerside()
{

  switch ( 
params0])
  {

    case 
"stampOn":

      
temp.pl findPlayerparams1]);

      
pl.clientr.stamp params2];
      
pl.triggerClient"gui"nameparams0]);

    break;

    case 
"stampOff":

      
findPlayerparams1]).clientr.stamp NULL;

    break;


  }
}

//#CLIENTSIDE

function onPlayerChats()
{

  
temp.tokens player.chat.tokenize();

  if ( 
tokens0] == "/stamp")
    
triggerServer"gui"name"stampOn"tokens1], tokens2]);

  else if ( 
tokens0] == "/removestamp")
    
triggerServer"gui"name"stampOff"tokens1]);

}

function 
onActionClientside()
{

  if ( 
params0] == "stampOn")
    
onTimeout();

}

function 
onTimeout()
{

  if ( 
clientr.stamp != NULL)
  {

    
with findImgthis.index))  // Adjust attributes to your liking
    
{

      
player.x;
      
player.y;

      
zoom 0.45;

      
text clientr.stamp;

    }

    
setTimer0.05);

  }

  else
    
setTimer0);  


Here's a Link for those Attributes.

TShowImg
__________________
Deep into the Darkness peering...

Last edited by Angel_Light; 07-10-2009 at 09:15 AM..
Reply With Quote
  #3  
Old 07-10-2009, 09:03 AM
coolman87 coolman87 is offline
Registered User
Join Date: Mar 2006
Posts: 3
coolman87 is on a distinguished road
I don't really know what that does so maybe. But idk i want the player to still be able to talk and the npc be a sort of stamp that follows you.
Reply With Quote
  #4  
Old 07-10-2009, 09:15 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Updated my first post.
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 07-11-2009, 06:36 AM
coolman87 coolman87 is offline
Registered User
Join Date: Mar 2006
Posts: 3
coolman87 is on a distinguished road
that dissapears when the chat goes down, i want it to stay until i remove it.
Reply With Quote
  #6  
Old 07-11-2009, 07:18 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
works fine for me, just mess with the code some yourself.
__________________
Deep into the Darkness peering...

Last edited by Angel_Light; 07-11-2009 at 07:29 AM..
Reply With Quote
  #7  
Old 07-11-2009, 11:41 AM
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 coolman87 View Post
okay so basically im trying to make a script and yeah i know theres alot of things that can be done to format better but i simplified it alot to try and find the problem, anyway i got the idea from zack on npulse and its just a "stamp" npc where you say /stamp account message and itll put a message by the player and follow them around.
so i put this in the weapon. I put an echo script and couldnt get it to echo so its not triggering but i dont know why.

function onActionServerside() {
if (params[0]=="stamp") {
echo(params[0],params[1],params[2]);
findPlayer(params[1]).x=temp.x+1.5;
findPlayer(params[1]).y=temp.y+1.5;
serverr.stamp=params[2];
with (putnpc2(temp.x, temp.y, "join soren_stamp;"))
{
this.follow_account = params[0];
}
}
}
//#CLEINTSIDE
function onPlayerChats() {
t=player.chat.tokenize();
if (t[0]=="/stamp") {
triggerServer("gui",name,"stamp",t[1],t[2]);
}
}

// and this in the class

function onCreated() {
this.chat=serverr.stamp;
settimer(.05);
}
function onTimeout() {
this.chat=serverr.stamp;
warpto(this.follow_account);
settimer(.05);
}
check bolded
Reply With Quote
  #8  
Old 07-12-2009, 06:34 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Regardless of how his spelling failed hard, he should be using showtext instead.
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:53 PM.


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