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 01-14-2002, 11:39 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Warping with NPC server...

ok...I am sure it's been gone over before but how do I use an NPC to warp a player?

I have done
NPC Code:

triggeraction 0,0,warp,olsl.nw,30,30;


in one NPC...and in the control-NPC I have
NPC Code:

if (actionwarp) {
with (getplayer(#a)) {
setlevel2 #p(0),#p(1),#p(2);
}
}



What am I doing wrong?
__________________
Reply With Quote
  #2  
Old 01-15-2002, 12:04 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Re: Warping with NPC server...

Quote:
Originally posted by G_yoshi
ok...I am sure it's been gone over before but how do I use an NPC to warp a player?

I have done
NPC Code:

triggeraction 0,0,warp,olsl.nw,30,30;


in one NPC...and in the control-NPC I have
NPC Code:

if (actionwarp) {
with (getplayer(#a)) {
setlevel2 #p(0),#p(1),#p(2);
}
}



What am I doing wrong?
setlevel2 #p(0),#p(1),#p(2); <-- there is something wrong in it (that would only affect the x and y of the player)

needs to be ...strtofloat(#p(1)), strtofloat(#p(2));
but I have not enough experience with NPC-Servers to get the other error (if there is one)

edit:
um could it be possible that NPC-Server doesn't know the players account if u trigger it? u Could use #a as a triggeraction param:

triggeraction 0,0,#a,warp,olsl.nw,30,30;
and read it out with #p(0)
__________________
No Webhost at the moment
Reply With Quote
  #3  
Old 01-15-2002, 12:18 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Re: Re: Warping with NPC server...

Quote:
Originally posted by TDO2000


setlevel2 #p(0),#p(1),#p(2); <-- there is something wrong in it (that would only affect the x and y of the player)

needs to be ...strtofloat(#p(1)), strtofloat(#p(2));
but I have not enough experience with NPC-Servers to get the other error (if there is one)

edit:
um could it be possible that NPC-Server doesn't know the players account if u trigger it? u Could use #a as a triggeraction param:

triggeraction 0,0,#a,warp,olsl.nw,30,30;
and read it out with #p(0)
Thanks...when it reads #p(index) it should read it as whatever it is...I don't think it would make any difference, but I'll try it later
__________________
Reply With Quote
  #4  
Old 01-15-2002, 12:25 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Re: Re: Re: Warping with NPC server...

Quote:
Originally posted by G_yoshi


Thanks...when it reads #p(index) it should read it as whatever it is...I don't think it would make any difference, but I'll try it later
no it doesn't had the same problem some time ago... at the beginning (without strtofloat) the position was always 0,0 but I think in your case it won't make any difference
__________________
No Webhost at the moment
Reply With Quote
  #5  
Old 01-15-2002, 02:17 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
You do need strtofloat( ) around the params,
But the other mistake is that you did not put "server" at the beginning of the action.

triggeraction 0,0,serverwarp,olsl.nw,30,30;

if (actionserverwarp) setlevel #p(0),strtofloat(#p(1)),strtofloat(#p(2));
Reply With Quote
  #6  
Old 01-15-2002, 07:26 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Loriel
You do need strtofloat( ) around the params,
But the other mistake is that you did not put "server" at the beginning of the action.

triggeraction 0,0,serverwarp,olsl.nw,30,30;

if (actionserverwarp) setlevel #p(0),strtofloat(#p(1)),strtofloat(#p(2));
AH!!!!

THANK YOU !
__________________
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 10:22 PM.


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