Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   fromweapons <weapon name>; (https://forums.graalonline.com/forums/showthread.php?t=10946)

freddyfox 09-02-2001 01:24 AM

fromweapons <weapon name>;
 
Instead of adding a weapon, it takes away a weapon from your inventory.

So, for example, if I wanted to talk weapon "Nukeshot" out of the players inventory,

NPC Code:

if(playertouchsme){
fromweapons Nukeshot;
}



Sound interesting?

Kaimetsu 09-02-2001 02:01 AM

Re: fromweapons <weapon name>;
 
Um. "removeweapon"?

grim_squeaker_x 09-02-2001 03:00 AM

This exists on the NPC Server. Although it'd be neat if Stefan could add it for offline uses too (Even though I usually just code my weapons I want to do that with seperately for that)

Falcor 09-02-2001 09:38 AM

Hers an idea. Making the Test program regonize with as a standerd operation rather than a variable syntax problem @.@;

General 09-02-2001 09:44 AM

maybe an option to switch the debugger to NPCServer mode, so it wont detect NPCServer realated *****ings and let you debug your scripts like a man

Tyhm 09-02-2001 12:06 PM

If you code your own nukeshot, add this line:
if(isweapon&&deletenukeshot){
unset deletenukeshot;
destroy;
}

Voila.

Personally, I'd rather have setweapon weaponname;

Kaimetsu 09-02-2001 08:35 PM

Quote:

Originally posted by Tyhm
Personally, I'd rather have setweapon weaponname;
...

You mean a command to set the currently selected weapon? How about "selectedweapon=whatever;" ? I'm sure you can figure out how to achieve the same effect from there.

Tyhm 09-03-2001 02:49 AM

That would make sense, I suppose, except that = denotes an integer value, and I'm fairly certain the code
for(this.i=-;this.i<weaponscount;this.i++){
if(strequals(#w(this.i),Nukeshot)) selectedweapon=this.i;
}
would fail horribly.

I might have to try setplayerprop #w,Nukeshot; though. ^_^


Amazing....while that didn't work, this did!
if(hasweapon(Fishing Rod)){
while(!strequals(#w,Fishing Rod)&&selectedweapon>0) selectedweapon--;
if(selectedweapon=0){
while(!strequals(#w,Fishing Rod)) selectedweapon++;
}
}
It's pretty much bulletproof too, or so it seems...Yup! Works if the weapon it seeks is above or below the current selected one.

BocoC 09-03-2001 07:11 AM

NPC Code:

for (i=0;i<weaponscount;i++) {
if (strequals(#w(i),Bow)) {
selectedweapon=i;
}
}


That would be how to find the Bow.

entravial 09-03-2001 12:34 PM

~AlphaFlame~The Fool~

Getting off topic here...

Anyway, I think a fromweapon command would be handy ^_^
Put an NPC in the starting levels or throughout the server to get rid of illegal NPCs, or the such... hmm...

<Various RCs> *starts to protest then realizes they wouldn't have to check accounts for illegal items* YAYYYYYY!

Kaimetsu 09-03-2001 04:14 PM

Quote:

Originally posted by Tyhm
That would make sense, I suppose, except that = denotes an integer value, and I'm fairly certain the code
for(this.i=-;this.i<weaponscount;this.i++){
if(strequals(#w(this.i),Nukeshot)) selectedweapon=this.i;
}
would fail horribly.

I might have to try setplayerprop #w,Nukeshot; though. ^_^


Amazing....while that didn't work, this did!
if(hasweapon(Fishing Rod)){
while(!strequals(#w,Fishing Rod)&&selectedweapon>0) selectedweapon--;
if(selectedweapon=0){
while(!strequals(#w,Fishing Rod)) selectedweapon++;
}
}
It's pretty much bulletproof too, or so it seems...Yup! Works if the weapon it seeks is above or below the current selected one.

I dunno why the original one wouldn't work. What do you mean by "except that = denotes an integer value"?

T3CK 09-03-2001 09:42 PM

Methinks that either the flag-in-level or server-string-purge method is perfect for ALL WEAPONS. That way, to remove them, you just have to plop NPCs in a lot of levels, or with server-string-purge just one in a staff area with:

if(washit){
server.purgesystemv1=1;
}

where the version 1 system NPC being removed has:

if(server.purgesystemv1=1){
message Removing Outdated System NPC...;
sleep 3;
destroy;
}


Or you can set a server string with the current version of *System or *Bankcard or whatever...thus,

In the new version:

if(created){
...
server.systemversion=2
...
}

In the old version:

if(server.systemversion>1){
message Removing Outdated System NPC...;
sleep 3;
destroy;
}

Kaimetsu 09-03-2001 10:13 PM

Quote:

Originally posted by T3CK
Methinks that either the flag-in-level or server-string-purge method is perfect for ALL WEAPONS. That way, to remove them, you just have to plop NPCs in a lot of levels, or with server-string-purge just one in a staff area with:

if(washit){
server.purgesystemv1=1;
}

where the version 1 system NPC being removed has:

if(server.purgesystemv1=1){
message Removing Outdated System NPC...;
sleep 3;
destroy;
}


Or you can set a server string with the current version of *System or *Bankcard or whatever...thus,

In the new version:

if(created){
...
server.systemversion=2
...
}

In the old version:

if(server.systemversion>1){
message Removing Outdated System NPC...;
sleep 3;
destroy;
}

Um... you do know what a server string is, don't you?

SagaTCN 09-03-2001 10:24 PM

Eh..
 
Wasn't there a post by Stefan in which he stated that system NPCs and such would be automatically updated if a new version of the level was uploaded?

Falcor 09-03-2001 11:01 PM

I think It would be quite usefull if removeweapon and addweapon had messagecode support. :D

Falcor 09-03-2001 11:07 PM

And maybe have removeweapon work clientside but only for weapons that dont have a * or an - in front of them

oscarjf1 09-03-2001 11:46 PM

....
 
If you dont want the player to have a weapon....put something in a systems weapon like

if (hasweapon(nukeshot) {putnpc gfx,dienukeshotdie.txt,x,y;
}
in the txt file...put
if (created || playerenters) {toweapons nukeshot; timeout = .1;
}
if (timeout) {
if (isweapon) {destroy;}
destroy;
}


And that will get rid of your nuke shot...or, it should atleast. Although, putnpc isnt the best of commands.

Falcor 09-04-2001 12:08 AM

NEVAR USE PUT NPC!!!!! AAARRRRR!!!!!!

*catches breath* Sorry i jusyt hate that command deeply. Especially now that there is putnpc2 wich is SOOOO much better.

But if your non p2p i guess putnpc will have to do. But it would be so sucky to put lines of code in every weapon just so they can be deleted. Id rather have removeweapon clientside and allow messagecodes. Somuch EZer.

oscarjf1 09-04-2001 12:14 AM

Quote:

Originally posted by Falcor
NEVAR USE PUT NPC!!!!! AAARRRRR!!!!!!

*catches breath* Sorry i jusyt hate that command deeply. Especially now that there is putnpc2 wich is SOOOO much better.

But if your non p2p i guess putnpc will have to do. But it would be so sucky to put lines of code in every weapon just so they can be deleted. Id rather have removeweapon clientside and allow messagecodes. Somuch EZer.

*Cough* Lazy *Cough*

Falcor 09-04-2001 12:32 AM

Efficiency is what counts. Putting the same line of code in every weapon isnt efficient. Its just stupid.

Falcor 09-04-2001 12:33 AM

And i am lazy for the fact that id rather not waist time on something that need not be done?

Admins 09-04-2001 04:50 PM

NPC Code:

for(i=0; i<weaponscount; i++) if (strequals(#w(i),Bow)) {
selectedweapon = i;
break;
}



works

Tyhm 09-05-2001 07:59 AM

Ack! There really IS a weaponscount variable!
*dok*:megaeek:

Falcor 09-05-2001 10:40 AM

You didnt know that? *smacks Tyhm*


har har

entravial 09-13-2001 08:10 AM

~AlphaFlame~

Is it just me, or did Stefan look at this thread and see it as something to do with setting the selected weapon? :confused:

Fromweapons would be good... as in, next version type good u.u

JeffTL 09-13-2001 08:23 AM

I guess I should have used #v or something to read my server string there...silly me.


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

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