Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-17-2006, 04:40 AM
lordspawn lordspawn is offline
Registered User
Join Date: Aug 2004
Posts: 24
lordspawn is on a distinguished road
[!help!] Script isnt Warping the player

Ok, im makin a type of warpbook script for a server and it's just not warping the player to the spot. Im not sure if its the serverside section at the top that's messing it up or what, anyway heres the script. [NO STEALING =/]

PHP Code:
if (actionserverside) {  
    if(
strequals(#p(0),warpbook)) {
    
setlevel2 #p(0),strtofloat(#p(1)),strtofloat(#p(2));    
    
}
    }
//#CLIENTSIDE
if (weaponfired) {
  
playerdir=2;
  
setani cross-forplayerworld149-newwarp,;
  
this.mode=abs(this.mode-1);
  if(
this.mode=0){
    
hideimg 296;
    
hideimg 297;
    
timeout=0;
  }
  else{
timeout=.05;}
}
if(
timeout&&this.mode=1){
  
tokenize #s(PlayerWarps);
  
if(keydown(1)){this.selected=this.selected-4;timeout=.5;}
  elseif(
keydown(3)){this.selected=this.selected+4;timeout=.5;}
  else{
timeout=.05;}
  if(
this.selected<0){this.selected=tokenscount-4;}
  if(
this.selected>tokenscount-1){this.selected=0;}
  
showimg 296,@@cb@Left or Right To Change S To Warp or A to cancel,playerx+1.5,playery-2;
  
showimg 297,@@cb@#t(this.selected),playerx+1.5,playery-1;
  
freezeplayer1;
  if(
keydown(5)){
    
this.mode=0;
    
hideimg 296;
    
hideimg 297;
    
playerfreezetime=0;
    
setani warper,;
    
sleep 2;
    
triggeraction 0,0,serverside,Warpbook,warpbook;
  }
  if(
keydown(6)){
    
setani idle,;
    
playerfreezetime=0;
    
this.mode=0;
    
hideimg 296;
    
hideimg 297;
  }

Help, and advice on what to change to make it warp the player please
Reply With Quote
  #2  
Old 02-17-2006, 04:48 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
tokenize #s(PlayerWarps);


I'm not sure if the above is correct, but I believe

tokenize (PlayerWarps);

would work.
Reply With Quote
  #3  
Old 02-17-2006, 04:56 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
NPC Code:
if (actionserverside) {  
if(strequals(#p(0),warpbook)) {
setlevel2 #p(0),strtofloat(#p(1)),strtofloat(#p(2));
}
}



Param 0 is "warpbook". You can't warp to level "warpbook" (it doesn't exist, guaranteed).
Not only that, you have not specified params 1 or 2 (or 3) in the triggeraction.
Reply With Quote
  #4  
Old 02-17-2006, 07:50 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Gambet
tokenize #s(PlayerWarps);


I'm not sure if the above is correct, but I believe

tokenize (PlayerWarps);

would work.
tokenize (PlayerWarps) would give you (PlayerWarps) as #t(0). And that's it.

tokenize #s(PlayerWarps) however, tokenizes the string PlayerWarps.
__________________
Reply With Quote
  #5  
Old 02-17-2006, 06:47 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
For the PlayerWarps variable, you should probably make it a client. string or actually initialise it in the script.

Is the triggeraction actually getting called? I don't see any debugging going on serverside (like a sendtonc or so) to tell you if it's actually geting called.

Also, sleeps kill timeouts.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 02-17-2006, 06:48 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Off-topic: PLEASE make this script more secure before actually letting players use it.
Reply With Quote
  #7  
Old 02-17-2006, 08:20 PM
lordspawn lordspawn is offline
Registered User
Join Date: Aug 2004
Posts: 24
lordspawn is on a distinguished road
good stuff, thanks, ill go back and redo some things.
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 07:37 AM.


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