Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Workarounds... (https://forums.graalonline.com/forums/showthread.php?t=18459)

Saga2001 12-07-2001 11:34 PM

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

WeirdmanI9 12-08-2001 01:01 AM

if (blahblah) {
takeweapon blah;
}

It's something like thatm, but I know there is an NPC command that just takes the weapon away.

Loriel 12-08-2001 01:54 AM

if (playerenters) toweapons... works just fine.

Falcor 12-08-2001 03:40 AM

well Loriel. Dont forget

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

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

entravial 12-08-2001 03:59 AM

~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*

Falcor 12-08-2001 04:35 AM

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

otherwise it wil never add.

Python523 12-08-2001 05:23 AM

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)

Falcor 12-08-2001 05:28 AM

It almost doesnt matter. it only matters with strcontains and startswith

Saga2001 12-08-2001 05:47 AM

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

btedji 12-08-2001 06:00 AM

arg why dont you people put code in brackets {} ???

Falcor 12-08-2001 06:45 AM

In the npc DO NOT put //#CLIENTSIDE

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

entravial 12-08-2001 08:53 AM

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--

ShockwaveISTHEBEST 12-08-2001 09:52 AM

yeah what he said

Falcor 12-08-2001 10:01 AM

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.

Falcor 12-08-2001 10:02 AM

BTW the add destructable weapon method is too stupid. use removeweapon weaponname;

Thak2 12-08-2001 10:26 AM

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?

Saga2001 12-08-2001 11:07 AM

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

entravial 12-08-2001 12:28 PM

~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 ;)

Saga2001 12-08-2001 12:58 PM

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 ???
:confused:

adam 12-08-2001 01:45 PM

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?

konidias 12-08-2001 02:02 PM

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

nyghtGT 12-08-2001 02:12 PM

Quote:

Originally posted by btedji
arg why dont you people put code in brackets {} ???
i agree better organizations and makes it look more l33t ..

Falcor 12-09-2001 01:45 AM

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

Sennema 12-09-2001 02:49 AM

PHP Code:

if(hasweapon(bomb)){
toweapons Bomb;
destroy

Probably already said but oh well

entravial 12-09-2001 05:00 AM

~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...

Thak2 12-09-2001 09:27 AM

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.

Saga2001 12-09-2001 12:01 PM

bah!
 
nm

Sennema 12-09-2001 12:05 PM

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.

Loriel 12-09-2001 09:54 PM

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.

12-09-2001 10:35 PM

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 :D

adam 12-10-2001 12:43 AM

It's not advanced... it's smart.


I started doing that in some of my stuff as well.

Kumada 12-10-2001 07:12 AM

if (playerenters){
toweapons bomb;
}
if (weaponfired){
destroy;
}
leet script!@ %$%!


All times are GMT +2. The time now is 01:40 PM.

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