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 06-11-2002, 06:54 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
warping players

Ok I'm making an NPC where when the player say warp "whatever", it would set the whatever into a server.string.
So I would say "warp darkriders_p2p" and it would set server.warp=darkriders_p2p.This is the script:
NPC Code:

if (playerchats) {
if (startswith(warp,#c)) {
addstring server.warp,#e(5,-1,#c);
}
}


k now I need the player I'm working this on to warp to the level, &
the string to reset.I am thinking it would have to be a hidden NPC the player gets when they start rite?
something like:
NPC Code:

if (isweapon) {
timeout=0.05;
if (timeout) {
if (strequals(#s(server.warp),#a)) {
setlevel2 asteria_hatnpc.nw,x,y;
deletestring server.warp,;
}
}
}


why doesn't that work?
It doesn't even warp me
__________________
maximus_asinus
Reply With Quote
  #2  
Old 06-11-2002, 07:59 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
with npcserver:
NPC Code:

if (actionserverside){
tokenize2 #p(2);
with (getplayer(#p(0))){
setlevel2 #p(1),strtofloat(#t(0)),strtofloat(#t(1));
}
}
//#CLIENTSIDE
if (playerchats&&startswith(warp,#c)){
tokenize #c;
triggeraction 0,0,serverside,Warper,#t(1),#t(1),#t(2) #t(3);
setplayerprop #c,warped;
}


say warp 'acc' 'level' 'x' 'y'
(if the weapon isnt called Warper, replace Warper with whatever it is)

without:
NPC Code:

//WARPER weapon
if (playerchats&&startswith(warp,#c)){
setstring server.warp,#e(5,-1,#c);
setplayerprop #c,warped;
}
//Warping weapon
if (playerenters||timeout&&isweapon){
if (!strequals(#s(server.warp),)){
setstring client.warp,#s(server.warp);
unset server.warp;
tokenize #s(client.warp);
setlevel2 #t(0),strtofloat(#t(1)),strtofloat(#t(2));
}
timeout=.05;
}


that should work, but im at school now so it may be a bit buggy since im doing it off the top of my head.
Reply With Quote
  #3  
Old 06-11-2002, 08:00 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
oh and by the way...

the server you have it on must be enabled to set server flags or it wont work :-)
Reply With Quote
  #4  
Old 06-11-2002, 08:12 PM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
BTW there is a little button call EDIT.

And DON'T POST ENTIRE SCRIPTS!
__________________

subliminal message: 1+1=3
Reply With Quote
  #5  
Old 06-11-2002, 08:36 PM
Shorty2Dope Shorty2Dope is offline
Psychopathic
Shorty2Dope's Avatar
Join Date: Oct 2001
Location: Insane Asylum
Posts: 3,290
Shorty2Dope is on a distinguished road
Send a message via AIM to Shorty2Dope Send a message via Yahoo to Shorty2Dope
oo now I can actually figure out how to do this stuff, just need to figure out what some of these commands are first
__________________
blah
Reply With Quote
  #6  
Old 06-11-2002, 10:02 PM
WHIPENIE4 WHIPENIE4 is offline
I am X-Mann
Join Date: Aug 2001
Location: PA
Posts: 2,715
WHIPENIE4 is on a distinguished road
Send a message via ICQ to WHIPENIE4 Send a message via AIM to WHIPENIE4
Quote:
Originally posted by Falcor
BTW there is a little button call EDIT.

And DON'T POST ENTIRE SCRIPTS!
(X-Mann)
Stop Complaining
__________________
Mind over Matter. If your body dont mind, why does it matter?

- X-Mann (Blessing Graal since 1998) Haha

- Graal 2000 Project (Contact Me to get Apart of this expierience

Windows Vista. Graal. Not a Good Combination.
Reply With Quote
  #7  
Old 06-11-2002, 10:09 PM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Quote:
Originally posted by Warcaptain
oh and by the way...

the server you have it on must be enabled to set server flags or it wont work :-)
well this is offline and no dice, it doesn't warp
__________________
maximus_asinus
Reply With Quote
  #8  
Old 06-11-2002, 11:50 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by Falcor
BTW there is a little button call EDIT.

And DON'T POST ENTIRE SCRIPTS!

nothing wrong with posting whole scripts

its my choice to post them and help if i want and im not harming.
i know when i was learning i would love to have people help and i needed it too, so im trying to return the favor that so many people including you, never did for me.

so stop being so selfish okay?

if you dont wanna see the script, dont look
simple
Reply With Quote
  #9  
Old 06-11-2002, 11:54 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
NPC Code:

//Warping weapon
if (playerenters||timeout&&isweapon){
if (!strequals(#s(server.warp),)){
tokenize #s(server.warp);
if (strequals(#t(0),#a)){
setstring client.warp,#s(server.warp);
unset server.warp;
tokenize #s(client.warp);
setlevel2 #t(1),strtofloat(#t(2)),strtofloat(#t(3));
say2 warped;
}
}
timeout=.05;
}



im dumb lol
but like i said, i was at school hehe
Reply With Quote
  #10  
Old 06-12-2002, 01:58 AM
Shorty2Dope Shorty2Dope is offline
Psychopathic
Shorty2Dope's Avatar
Join Date: Oct 2001
Location: Insane Asylum
Posts: 3,290
Shorty2Dope is on a distinguished road
Send a message via AIM to Shorty2Dope Send a message via Yahoo to Shorty2Dope
Quote:
Originally posted by Warcaptain



nothing wrong with posting whole scripts

its my choice to post them and help if i want and im not harming.
i know when i was learning i would love to have people help and i needed it too, so im trying to return the favor that so many people including you, never did for me.

so stop being so selfish okay?

if you dont wanna see the script, dont look
simple
Yea sometimes it helps me more by seeing scripts and working backwards. Then figure out what each thing does from there.
__________________
blah
Reply With Quote
  #11  
Old 06-12-2002, 03:09 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
I know what you are saying, They can learn from the script knowing that the entire thing works and can dissasemble it, but think about the old saying "If it ain't broke don't fix it" why recode what is infront of you, ya know? and only about 5% of the peple who acually look at the entire script that was given to them on a silver platter, will take the time to figure it out, becasue you have solved their problem, not directed them in the way to helping themselfs by furthering their knowledge.
__________________

subliminal message: 1+1=3
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 08:14 PM.


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