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 03-14-2002, 07:27 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
destroy;

NPC Code:

if (created||playerenters) {
timereverywhere;
timeout=.05;
}
if (playertouchsme&&strequals(playing,#s(etegg))) {
say2 You found it!;
setstring server.eteggwinner,#a;
setlevel2 eteggprize.nw,30,30;
destroy;
}

if (timeout) {
timereverywhere;
timeout=.05;
if (strequals(ended,#s(server.etegg)))
destroy;
}


anyone know why destroy dont work...
__________________
Reply With Quote
  #2  
Old 03-14-2002, 07:41 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
once you leave a level the script stops running and thats one of the most pathetic attemps of doing a strequals for a string I've seen
strequals for a string is like this
if (playerhurt&&strequals(#s(client.armor),3)){
blah;
}
for the setlevel2 thing, put the destroy before it, and also remember this, destroy destroys the npc for the WHOLE server
Reply With Quote
  #3  
Old 03-14-2002, 10:47 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
does destroy delete it from database if it is a database npc??
__________________
[signature]insert here[/signature]
Reply With Quote
  #4  
Old 03-14-2002, 10:52 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by screen_name
does destroy delete it from database if it is a database npc??
Im not sure, I would test it but since Providence is down...x.x
Reply With Quote
  #5  
Old 03-14-2002, 05:07 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
screen_name
does destroy delete it from database if it is a database npc??
Not to my knowledge.

Quote:
Python523

thats one of the most pathetic attemps of doing a strequals for a string I've seen
strequals for a string is like this
if (playerhurt&&strequals(#s(client.armor),3)){
blah;
}
It only matters with strcontains() with strequals() you are comparing 2 strings to make sure they are the same, why would it matter the order?
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #6  
Old 03-14-2002, 07:18 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally posted by screen_name
does destroy delete it from database if it is a database npc??
Yes, but your script looked more liked client-side
thing (0.05 seconds timeout?)
Reply With Quote
  #7  
Old 03-14-2002, 09:17 PM
SaijinGohan SaijinGohan is offline
Registered User
SaijinGohan's Avatar
Join Date: Jul 2001
Location: U.S.A - Ohio
Posts: 536
SaijinGohan is on a distinguished road
Send a message via AIM to SaijinGohan Send a message via MSN to SaijinGohan
ooooooooh Stefan showed you all up!
__________________

Job: A Legend

And you think that you have played Graal forever? Ha!
Reply With Quote
  #8  
Old 03-14-2002, 10:02 PM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
Quote:
Originally posted by SaijinGohan
ooooooooh Stefan showed you all up!
lolz

Quote:
Originally posted by Python523
thats one of the most pathetic attemps of doing a strequals for a string I've seen
strequals for a string is like this
if (playerhurt&&strequals(#s(client.armor),3)){
blah;
}
I dont see whats wrong with it? It does the job doesnt it?

so anyone got any ideas why it doesnt work?
and it is for non-p2p
btw, this is my first time using destroy so im not that familiar.
__________________
Reply With Quote
  #9  
Old 03-14-2002, 10:51 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by happyme

lolz

I dont see whats wrong with it? It does the job doesnt it?

so anyone got any ideas why it doesnt work?
and it is for non-p2p
btw, this is my first time using destroy so im not that familiar.
its probably better to do this, make it destroy before it leaves the level, if you don't the command is not run because the player executing the command is not on the level anymore.
NPC Code:

if (created||playerenters) {
timereverywhere;
timeout=.05;
}
if (playertouchsme&&strequals(playing,#s(etegg))) {
say2 You found it!;
setstring server.eteggwinner,#a;
destroy;
setlevel2 eteggprize.nw,30,30;
}

if (timeout) {
// you don't need timereverywhere more than once.
timeout=.05;
if (strequals(ended,#s(server.etegg)))
destroy;
}

__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #10  
Old 03-15-2002, 06:40 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Didn't I say a few posts up that you have to put it above the setlevel/2?
Reply With Quote
  #11  
Old 03-15-2002, 07:09 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Python523

for the setlevel2 thing, put the destroy before it, and also remember this, destroy destroys the npc for the WHOLE server
indeed you did...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #12  
Old 03-15-2002, 11:54 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
If I said that, then I ment you would put it right before the setlevel2 since the client stops running scripts once it leaves the level
Reply With Quote
  #13  
Old 03-15-2002, 01:09 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by Stefan


Yes, but your script looked more liked client-side
thing (0.05 seconds timeout?)
thanks

__________________
[signature]insert here[/signature]
Reply With Quote
  #14  
Old 03-15-2002, 02:07 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu
Wha...? You're saying to put the destroy before anything? Nothing will run after a destroy; has been found!
omi, i didn't even think of that...
hmph...
well yeah you could do things with p2p easily...
but with non-p2p you would have to go thru some mondo trouble, but if the player is leaving, i see no reason the npc should be terminated.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #15  
Old 03-15-2002, 04:14 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
Quote:
Originally posted by Saga2001


omi, i didn't even think of that...
hmph...
well yeah you could do things with p2p easily...
but with non-p2p you would have to go thru some mondo trouble, but if the player is leaving, i see no reason the npc should be terminated.
my point exactly, if the player leaves the level then it is not active for them, why destroy it?
and if you really wanted to destroy it you could but there would have to be 2 people in the room and another NPC to control the destroying process but there is no point
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #16  
Old 03-16-2002, 10:16 AM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
umm

if it's a client side NPC, it wont work, because once you leave the level, it's not going to go to the destroy command.

If it's a server side NPC, it wont work, because the timeout is 0.05

To get it to work serverside, change it to .1 or higher

to get it to work, the client would have to have some kind of weapon that is triggered, or does a timeout check when a new level is entered.

1st NPC (Part of timeout section) :
NPC Code:

if (strequals(#s(server.etegg),ended)) {
for (i=0; i<playerscount; i++; ) {
if (strequals(#s(etegg),playing)) {
client.eteggwon=1;
destroy;
}
}
}


The Weapon
NPC Code:

if (playerenters) {
sleep 1;
if (client.eteggwon=1) {
client.eteggwon=0;
setlevel2 yourlevel,x,y;
}
}

__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote
  #17  
Old 03-16-2002, 05:42 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Re: umm

Quote:
Originally posted by mikepg
<stuff>[/code]
yeah, looks good. i think that you could probably just leave the npc.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #18  
Old 03-17-2002, 06:13 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
Quote:
Originally posted by Saga2001


its probably better to do this, make it destroy before it leaves the level, if you don't the command is not run because the player executing the command is not on the level anymore.
NPC Code:

if (created||playerenters) {
timereverywhere;
timeout=.05;
}
if (playertouchsme&&strequals(playing,#s(etegg))) {
say2 You found it!;
setstring server.eteggwinner,#a;
destroy;
setlevel2 eteggprize.nw,30,30;
}

if (timeout) {
// you don't need timereverywhere more than once.
timeout=.05;
if (strequals(ended,#s(server.etegg)))
destroy;
}

ok would this prevent that enter lv thing??
thanks to all that try to help
__________________
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 04:23 PM.


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