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 07-13-2007, 01:04 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Staff Block Warp

Is it possible for me to have something like:
if (playertouchsme){
setlevel2 #s(this.blocklevel),#s(this.blockx),#s(this.blocky );
}
if (playerchats && strequals(#c,/blockwarp) && strequals(#a,bscharff)){
tokenize #c;
#t(1) = this.blocklevel;
#t(2) = this.blockx;
#t(3) = this.blocky;
}

or possibly with if (playertouchsme){
tokenize #c;
#t(1) = this.tempwarpaccount;
with (findplayer#s(this.tempwarpaccount)){
setlevel2 #s(this.blocklevel),#s(this.blockx),#s(this.blocky );
}
}

This Is Just My Example, If This Wouldn't Work, Please Provide A Code That Would!

or, If One Would Work, Please Tell Me Which One

Thanks!
__________________
Trying to be nice now...
Reply With Quote
  #2  
Old 07-13-2007, 01:30 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I'm not quite getting your script... You use a chat command, tokenize the players chat then set the tokens as strings which defies the point of tokenizing #c at all.

What are you trying to achieve?
Reply With Quote
  #3  
Old 07-13-2007, 06:45 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
i think he wants to warp a "block" to a level...
__________________
**FLIP OUT**
Reply With Quote
  #4  
Old 07-13-2007, 06:50 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
setlevel2 in GS1 requires conversion to float for the x and y.
PHP Code:
setlevel2 #s(this.string),strtofloat(#s(this.string)),strtofloat(#s(this.string)); 
Last time I checked anyway, and that was along time ago.
__________________
Reply With Quote
  #5  
Old 07-13-2007, 07:41 AM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Quote:
Originally Posted by Twinny View Post
I'm not quite getting your script... You use a chat command, tokenize the players chat then set the tokens as strings which defies the point of tokenizing #c at all.

What are you trying to achieve?

I think he was trying to achieve
PHP Code:
setstring this.blocklevel,#t(1);
this.blockx #t(2);
this.blocky #t(3); 
__________________


CAUTION
Reply With Quote
  #6  
Old 07-13-2007, 07:47 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Luigi203 View Post
I think he was trying to achieve
PHP Code:
setstring this.blocklevel,#t(1);
this.blockx #t(2);
this.blocky #t(3); 
PHP Code:
setstring this.blocklevel,#t(1);
this.blockx strtofloat(#t(2));
this.blocky strtofloat(#t(3)); 
__________________
Reply With Quote
  #7  
Old 07-13-2007, 07:59 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by theHAWKER View Post
i think he wants to warp a "block" to a level...
Doubt it. It's doing player.setlevel2() : not actually making the NPC warp.

PHP Code:
if (playertouchsme){
setlevel2 #s(this.blocklevel),#s(this.blockx),#s(this.blocky );
}
if (
playerchats && strequals(#c,/blockwarp) && strequals(#a,bscharff)){
tokenize #c;
#t(1) = this.blocklevel;
#t(2) = this.blockx;
#t(3) = this.blocky;

This one requires you to say exactly /blockwarp but then it tokenizes the chat and then sets the token values to local variables. For the second one: I have no clue :x

Do you want to be able to say a location then be warped there when you touch the block? If so

PHP Code:
function onPlayerChats()
{
  if (
player.account == "youraccounthere")
  {
    if (
player.chat.starts("/blockwarp"))
    {
      
temp.toks player.chat.tokenize();
      
this.wlevel temp.toks[1];
      
this.wx temp.toks[2];
      
this.wy temp.toks[3];
    }
  }
}

function 
onPlayerTouchsMe()
{
  
player.setlevel2(this.wlevelthis.wxthis.wy);

Should work if you upload it to a server. Next time at least explain what you want the code to do :x
Reply With Quote
  #8  
Old 07-14-2007, 07:14 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
No, No, No.
I'm Trying Like If A Player Touches The Block Then They Are Warped To this.blockwarpx this.blockwarpy this.blockwarplevel
But Thanks :P
__________________
Trying to be nice now...
Reply With Quote
  #9  
Old 07-14-2007, 07:15 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
yeah, that's it twinny!
Thanks!
__________________
Trying to be nice now...
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 03:36 PM.


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