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 12-07-2001, 11:34 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
Workarounds...

I need to destroy a weapon, and i could delete it in the way suggested in the other thread, but on Doomsday, and i believe now all other playerworlds you cannot do a toweapons on a if playerenters test, the player actually has to physically tough the npc, is there any way i could do something? One thing that works sometimes is:
NPC Code:

if (playerenters) {setplayerprop #c, ;}
if (playerchats&&strequals( ,#c)) {toweapons weapon;}



but sometimes thats even broken...
can anyone come up with any other ideas?

thanks,
--PastAustin
__________________

!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
  #2  
Old 12-08-2001, 01:01 AM
WeirdmanI9 WeirdmanI9 is offline
Banned
WeirdmanI9's Avatar
Join Date: Mar 2001
Location: Laying Low From The Police
Posts: 1,816
WeirdmanI9 is on a distinguished road
Send a message via AIM to WeirdmanI9 Send a message via Yahoo to WeirdmanI9
if (blahblah) {
takeweapon blah;
}

It's something like thatm, but I know there is an NPC command that just takes the weapon away.
Reply With Quote
  #3  
Old 12-08-2001, 01:54 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
if (playerenters) toweapons... works just fine.
Reply With Quote
  #4  
Old 12-08-2001, 03:40 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
well Loriel. Dont forget

if(playerenters && !isweapon) {
toweapons weapon;
}

otherwise you have annying weapon re-adding like there is on some servers I know
__________________

subliminal message: 1+1=3
Reply With Quote
  #5  
Old 12-08-2001, 03:59 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

if (playerenters && hasweapon(weapon-to-take)){
toweapons weapon-to-take;
if (isweapon)destroy;
}

Tada.

*walks off muttering about lizardons and something about their mothers*
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #6  
Old 12-08-2001, 04:35 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
if (playerenters && !hasweapon(weapon-to-take)){
toweapons weapon-to-take;
if (isweapon)destroy;
}

otherwise it wil never add.
__________________

subliminal message: 1+1=3
Reply With Quote
  #7  
Old 12-08-2001, 05:23 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Re: Workarounds...

Quote:
Originally posted by Saga2001
I need to destroy a weapon, and i could delete it in the way suggested in the other thread, but on Doomsday, and i believe now all other playerworlds you cannot do a toweapons on a if playerenters test, the player actually has to physically tough the npc, is there any way i could do something? One thing that works sometimes is:
NPC Code:

if (playerenters) {setplayerprop #c, ;}
if (playerchats&&strequals( ,#c)) {toweapons weapon;}



but sometimes thats even broken...
can anyone come up with any other ideas?

thanks,
--PastAustin
isn't it strequals(#c,blah) not strequals(blah,#c)
Reply With Quote
  #8  
Old 12-08-2001, 05:28 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
It almost doesnt matter. it only matters with strcontains and startswith
__________________

subliminal message: 1+1=3
Reply With Quote
  #9  
Old 12-08-2001, 05:47 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 Loriel
if (playerenters) toweapons... works just fine.
no it doesn't, what happens is a screen comes up because of the block, it says "The server has recieved illegal data from your connection", and sends a message in rc saying "Accountname has added a non-existant weapon. (Hacker?)".
--PA
__________________

!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 12-08-2001, 06:00 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
arg why dont you people put code in brackets {} ???
Reply With Quote
  #11  
Old 12-08-2001, 06:45 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
In the npc DO NOT put //#CLIENTSIDE

When you ADD IT TO NPC SERVER VIA NPC CONTROL THEN you p ut //#CLIENTSIDE
__________________

subliminal message: 1+1=3
Reply With Quote
  #12  
Old 12-08-2001, 08:53 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Quote:
Originally posted by Falcor
if (playerenters && !hasweapon(weapon-to-take)){
toweapons weapon-to-take;
if (isweapon)destroy;
}

otherwise it wil never add.
No, it needs to NOT have the !. Otherwise, every time you enter the level, it will add and that would be bad. MY way has it so that it only adds if you HAVE that weapon in the first place. Duh.


--Disclaimer--

Don't mess with my NPCs. I usually know what I'm doing. Unless I specifically say "I didn't use the editor to make this," assume it's correctly done and shut up.

--/end Disclaimer--
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #13  
Old 12-08-2001, 09:52 AM
ShockwaveISTHEBEST ShockwaveISTHEBEST is offline
Registered User
Join Date: Nov 2001
Location: never never land
Posts: 208
ShockwaveISTHEBEST is on a distinguished road
Send a message via AIM to ShockwaveISTHEBEST Send a message via Yahoo to ShockwaveISTHEBEST
yeah what he said
Reply With Quote
  #14  
Old 12-08-2001, 10:01 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
So mister smartass, shut the furk up. get off your damn highhorse. i ddint know what you were tring to do because it was FAR too inefficient.
__________________

subliminal message: 1+1=3

Last edited by Falcor; 12-08-2001 at 10:03 AM..
Reply With Quote
  #15  
Old 12-08-2001, 10:02 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
BTW the add destructable weapon method is too stupid. use removeweapon weaponname;
__________________

subliminal message: 1+1=3
Reply With Quote
  #16  
Old 12-08-2001, 10:26 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
Quote:
Originally posted by Saga2001
no it doesn't, what happens is a screen comes up because of the block, it says "The server has recieved illegal data from your connection", and sends a message in rc saying "Accountname has added a non-existant weapon. (Hacker?)".
--PA
Doesn't it only do that if you don't assign an image to the npc?
Reply With Quote
  #17  
Old 12-08-2001, 11:07 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
ok...

in case you haven't noticed Doomsday is not a PAY TO PLAY server. REMOVEWEAPONS does not work on non p2p!!!
-PA
__________________

!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 12-08-2001, 12:28 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

*cackles* I might be on a high horse, but at least the horse isn't stupid/ignorant/slow/all three.

... *adds a bit later* And for non-p2p, that's fairly optimized Sir Knows-Little-Curses-Lots
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)

Last edited by entravial; 12-08-2001 at 12:33 PM..
Reply With Quote
  #19  
Old 12-08-2001, 12:58 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 entravial
~AlphaFlame~

*cackles* I might be on a high horse, but at least the horse isn't stupid/ignorant/slow/all three.

... *adds a bit later* And for non-p2p, that's fairly optimized Sir Knows-Little-Curses-Lots
??? what ???
__________________

!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
  #20  
Old 12-08-2001, 01:45 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
refer to subject about adding the ability for RC's of non-p2p servers to access the weapon database..... delete npc... delete weapon from database.... should be fine right?
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #21  
Old 12-08-2001, 02:02 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally posted by btedji
arg why dont you people put code in brackets {} ???
Because it's easier to keep track of.. doing

if (playerchats)
message Hi;
if (playertouchsme)
message Don't touch me!;

that is annoying in huge scripts
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #22  
Old 12-08-2001, 02:12 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by btedji
arg why dont you people put code in brackets {} ???
i agree better organizations and makes it look more l33t ..
Reply With Quote
  #23  
Old 12-09-2001, 01:45 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
Quote:
Originally posted by entravial
~AlphaFlame~

*cackles* I might be on a high horse, but at least the horse isn't stupid/ignorant/slow/all three.

... *adds a bit later* And for non-p2p, that's fairly optimized Sir Knows-Little-Curses-Lots
No, It is not

Put
if(isweapon &&destroy) destroy;
in the weapon itself And then use
callweapon index,destroy;

That is the best way.

It is 1 line of code that would make life EZer. Just dont add that in hidden weapons or In-deletable weapons.

*tidbit* You can also use triggeraction in the same way
__________________

subliminal message: 1+1=3
Reply With Quote
  #24  
Old 12-09-2001, 02:49 AM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
PHP Code:
if(hasweapon(bomb)){
toweapons Bomb;
destroy
Probably already said but oh well
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #25  
Old 12-09-2001, 05:00 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~


So... Falcor, you want to have two NPCs to do what could be done in 1? And hey, any NPC can be one line... just take out the returns...
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #26  
Old 12-09-2001, 09:27 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
Quote:
Originally posted by Sennema
PHP Code:
if(hasweapon(bomb)){
toweapons Bomb;
destroy
Probably already said but oh well
That wouldn't work good, because it would destroy both the weapon and the npc that adds the weapon. So, after one player enters the level, and another follows, it would only work for the first player.
Reply With Quote
  #27  
Old 12-09-2001, 12:01 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
bah!

nm
__________________

!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
  #28  
Old 12-09-2001, 12:05 PM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
Quote:
Originally posted by Thak2


That wouldn't work good, because it would destroy both the weapon and the npc that adds the weapon. So, after one player enters the level, and another follows, it would only work for the first player.
Hm... makes sense.
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #29  
Old 12-09-2001, 09:54 PM
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
Quote:
Originally posted by Saga2001
Quote:
Originally posted by Loriel
if (playerenters) toweapons... works just fine.
no it doesn't, what happens is a screen comes up because of the block, it says "The server has recieved illegal data from your connection", and sends a message in rc saying "Accountname has added a non-existant weapon. (Hacker?)".
--PA[/b]
That has nothing to do with the playerenters event tough. It may just not add a weapon without a graphic, or call the toweapons command in a weapons script.


Smartest thing is still putting in the every weapon, right when adding it to your server:
if (destroy) destroy;
Then,
for (i=0; i<weaponscount; i++) if (strequals(#w(i),weapontoremove)) {
callweapon i,destroy;
break;
}
into the NPC you have to delete a weapon.
Reply With Quote
  #30  
Old 12-09-2001, 10:35 PM
Guest
Posts: n/a
Quote:
Originally posted by Loriel

no it doesn't, what happens is a screen comes up because of the block, it says "The server has recieved illegal data from your connection", and sends a message in rc saying "Accountname has added a non-existant weapon. (Hacker?)".
--PA
That has nothing to do with the playerenters event tough. It may just not add a weapon without a graphic, or call the toweapons command in a weapons script.


Smartest thing is still putting in the every weapon, right when adding it to your server:
if (destroy) destroy;
Then,
for (i=0; i<weaponscount; i++) if (strequals(#w(i),weapontoremove)) {
callweapon i,destroy;
break;
}
into the NPC you have to delete a weapon. [/B][/QUOTE]


Lol, there goes loriel with her 'advanced' scripting agin : P
Reply With Quote
  #31  
Old 12-10-2001, 12:43 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
It's not advanced... it's smart.


I started doing that in some of my stuff as well.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #32  
Old 12-10-2001, 07:12 AM
Kumada Kumada is offline
Ded
Kumada's Avatar
Join Date: Nov 2001
Location: Usa
Posts: 1,088
Kumada is on a distinguished road
if (playerenters){
toweapons bomb;
}
if (weaponfired){
destroy;
}
leet script!@ %$%!
__________________
Aim: Mmm Kumada

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:24 PM.


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