Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   "hidden" Variable for Weapons (https://forums.graalonline.com/forums/showthread.php?t=63173)

Inverness 01-03-2006 10:44 AM

"hidden" Variable for Weapons
 
It would be greatly appreciate if a built-in "hidden" variable was added so weapons can be made invisible to the default weapons menu without adding a negative in the weapon name. Doing so makes it a hassle when calling a public function on a hidden weapon since you must use the makevar() function due to the negative, it would be must easier to not have to use it.

ApothiX 01-03-2006 11:23 AM

PHP Code:

CoolHiddenWeapon = (@"-CoolHiddenWeapon");
CoolHiddenWeapon.GaspPublicFunction(); 


Lance 01-03-2006 11:43 AM

Quote:

Originally Posted by Inverness
It would be greatly appreciate if a built-in "hidden" variable was added so weapons can be made invisible to the default weapons menu without adding a negative in the weapon name. Doing so makes it a hassle when calling a public function on a hidden weapon since you must use the makevar() function due to the negative, it would be must easier to not have to use it.

Why not use findweapon?

Skyld 01-03-2006 02:15 PM

Quote:

Originally Posted by Inverness
It would be greatly appreciate if a built-in "hidden" variable was added so weapons can be made invisible to the default weapons menu without adding a negative in the weapon name. Doing so makes it a hassle when calling a public function on a hidden weapon since you must use the makevar() function due to the negative, it would be must easier to not have to use it.

I agree with Lance. As he's said before, using findweapon() removes ambiguity.

Inverness 01-06-2006 01:42 AM

You don't get it, I don't want to have to use any type of function to access the weapon.
just WeaponName.function() instead of findweapon(weaponname).function();
It just looks better the first way.
Quote:

Originally Posted by ApothiX
PHP Code:

CoolHiddenWeapon = (@"-CoolHiddenWeapon");
CoolHiddenWeapon.GaspPublicFunction(); 


I already use that in scripts, however variables without leaders are global and using this.varname.function(); just looks bad to me :P
While serverside global variables work fine, clientside global variables work sometimes and sometimes not, i'm not exactly sure on the reason.

However this topic is about having a weapon.hidden variable not the findweapon() function, everything you all said was completely useless.

Yen 01-06-2006 03:00 AM

I support Invy.

-Munches on his bri-- cookie.-

Skyld 01-06-2006 03:06 AM

Quote:

Originally Posted by Inverness
... However this topic is about having a weapon.hidden variable not the findweapon() function, everything you all said was completely useless.

Quote:

Originally Posted by Inverness
... Doing so makes it a hassle when calling a public function on a hidden weapon since you must...

... which is what findWeapon() is for, while demoting ambiguity!

Inverness 01-07-2006 01:27 AM

Quote:

Originally Posted by Skyld
... which is what findWeapon() is for, while demoting ambiguity!

I know that, what you quoted was just a comment and my personal opinion, something to consider with the topic.

ApothiX 01-07-2006 04:15 AM

Quote:

Originally Posted by Inverness
I already use that in scripts, however variables without leaders are global and

The fact that it is global was my point. You only have to do that once in a System NPC, and you can use that variable in any other NPCs.

Inverness 01-07-2006 08:09 PM

Anyways, adding a negative before a weapon name just looks bad to me, thats mostly why I wont the weapon.hidden variable.

ApothiX 01-07-2006 08:31 PM

Quote:

Originally Posted by Inverness
Anyways, adding a negative before a weapon name just looks bad to me, thats mostly why I wont the weapon.hidden variable.

Well, no one sees the weapon with the negative before it anyway ;)

Also, I don't get how so many people misspell 'want' with 'wont' o_O a and o are on opposite sides of the keyboard

Inverness 01-08-2006 04:29 AM

Quote:

Originally Posted by ApothiX
Well, no one sees the weapon with the negative before it anyway ;)

Also, I don't get how so many people misspell 'want' with 'wont' o_O a and o are on opposite sides of the keyboard

Me neither, didn't even see that mistake :O.
And in respose to the first statement, I'm the NPC Admin, I see it all the damn time when i'm scripting and have to work around it to.
Just having to use a function to get around the negative in the weapon name annoys me, even if I only have to use it once for a global variable, I just don't want to have to do it at all.
I also think there should be a nodelete flag for weapons instead of putting the * before the weapon name.

ApothiX 01-08-2006 12:53 PM

Quote:

Originally Posted by Inverness
Me neither, didn't even see that mistake :O.
And in respose to the first statement, I'm the NPC Admin, I see it all the damn time when i'm scripting and have to work around it to.
Just having to use a function to get around the negative in the weapon name annoys me, even if I only have to use it once for a global variable, I just don't want to have to do it at all.
I also think there should be a nodelete flag for weapons instead of putting the * before the weapon name.

You're damn picky :P It's more organised in the WNPC list with the * and - signs, I would rather be able to just look at it and tell what it does, rather than have to go in to the code and try to find a 'hidden=true;' variable (which would most likely be in the stupidest place, judging by some people's scripting habits.)

Also, it has been said that findWeapon("") is a better way to do it anyway, so why not just use that? :|


[edit] re-reading my post it seems like that 'some people's scripting habits' was directed at you, take note that it wasn't. It was just a generalised assumption.[/edit]

Inverness 01-10-2006 02:44 AM

Quote:

Originally Posted by ApothiX
You're damn picky :P It's more organised in the WNPC list with the * and - signs, I would rather be able to just look at it and tell what it does, rather than have to go in to the code and try to find a 'hidden=true;' variable (which would most likely be in the stupidest place, judging by some people's scripting habits.)

Also, it has been said that findWeapon("") is a better way to do it anyway, so why not just use that? :|


[edit] re-reading my post it seems like that 'some people's scripting habits' was directed at you, take note that it wasn't. It was just a generalised assumption.[/edit]

Yes I know i'm picky, I hear that all the time. And even though the * and - signs in the weapon list do organize it, an alternative could be color coding or something else even. Though I talked to Stefan and he said the server needs to know the settings to, not just the client, so he wont be changing it anytime soon I suppose.

Yen 01-10-2006 03:21 AM

Doesn't the 'protectedweapons' server option prevent NPCs from being deleted?

Inverness 01-10-2006 03:34 AM

Quote:

Originally Posted by Yen
Doesn't the 'protectedweapons' server option prevent NPCs from being deleted?

I think that keeps them from being deleted by the destroy() function.

After reading another thread I think an alternative to using a hidden variable would be to have a checkbox in the window where you set the weapon name for making it hidden and one for the no-delete. That way the server would know, and you wouldn't need a hidden variable.

Lance 01-10-2006 04:10 AM

Quote:

Originally Posted by Inverness
I think that keeps them from being deleted by the destroy() function.

If memory serves me right, it prevents the client from entirely removing the weapon from the account (you can delete the weapon with the client, but when you reconnect you will have it again).


All times are GMT +2. The time now is 11:38 AM.

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