Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Eliminating the Sword (https://forums.graalonline.com/forums/showthread.php?t=77793)

Angel_Light 12-02-2007 09:42 PM

Eliminating the Sword
 
How do I get rid of the default sword? I got setSword( NULL, 0); and replaceAni( "sword", NULL); Which get rid of the physical part of the sword. But a player can still walk up to a bush push S, and with the player ani staying idle, the bush is miraculously being cut. I.E. the bush is vanishing and the leaps are showing but the player does nothing.

Rapidwolve24 12-02-2007 10:24 PM

Custom attack system.

Angel_Light 12-02-2007 11:03 PM

I have that, It is just not removing the sword effect.

coreys 12-02-2007 11:36 PM

disableWeapons();

Kyranki 12-02-2007 11:59 PM

enablefeatures() is actually the best way to do it.

Angel_Light 12-03-2007 12:42 AM

thanks guys

cbk1994 12-03-2007 02:26 AM

You can disable the sword through enablefeatures?

Crow 12-03-2007 04:26 PM

Quote:

Originally Posted by cbkbud (Post 1361879)
You can disable the sword through enablefeatures?

Actually...no.

coreys 12-03-2007 04:37 PM

Quote:

Originally Posted by Kyranki (Post 1361844)
enablefeatures() is actually the best way to do it.

...no o_o
You have to use disableWeapons(); o.0 There is not feature in enablefeatures for sword usage...

Angel_Light 12-03-2007 11:01 PM

yeah I used disableweps

Luigi203 12-03-2007 11:47 PM

disablesword()?

Crow 12-03-2007 11:55 PM

Quote:

Originally Posted by Luigi203 (Post 1362001)
disablesword()?

Doesnt exist.

napo_p2p 12-03-2007 11:56 PM

Quote:

Originally Posted by Luigi203 (Post 1362001)
disablesword()?

I could've sworn that disablesword was a command, but it doesn't appear in the list of commands on the wiki. It either didn't make it to documentation, is an old (now unsupported) command, or was never a command to begin with.

DustyPorViva 12-04-2007 02:08 AM

You might be thinking of hidesword(int), used to be used on old Graal to hide the sword in case you used the sword sprite indexes and didn't want the sword to be shown.

Kyranki 12-04-2007 02:43 AM

Actually, Vash. enablefeatures(params); disables all the features except for those that are listed in the parameters. And one of those parameters is the ability to use the sword. Which means if you use enablefeatures(params) and do not include (I forget the number of the param for weapons) you will lose the ability to use the sword and weapons.

Considering this is how I do it on Arca, It is possible to disable weapons using enablefeatures(params) unless I "ZOMGWTFPWNED the graal servers" to make this work.

Angel_Light 12-04-2007 05:13 AM

look at the wiki. You can disable the qmenu though.

napo_p2p 12-04-2007 06:07 AM

Quote:

Originally Posted by Kyranki (Post 1362041)
Actually, Vash. enablefeatures(params); disables all the features except for those that are listed in the parameters. And one of those parameters is the ability to use the sword. Which means if you use enablefeatures(params) and do not include (I forget the number of the param for weapons) you will lose the ability to use the sword and weapons.

NPC Code:
      1 - M key (map)
2 - P key (pause)
4 - Q key (weapon select)
8 - R key (show ratings)
0x10 - S+A key combination for dropping items
0x20 - S+D key combination for switching weapons
0x40 - TAB key (if disabled then you cannot switch to the chat field with TAB)
0x80 - display of chat text
0x100 - display of the hearts over player heads
0x200 - display of nicknames
0x400 - toall/PM-icons on the minimap
0x800 - right-click on players opens their profile
0x1000 - emoticons (disable it if you want to do other stuff with control+keys)
0x2000 - Alt+5 for making snapshots
0x4000 - Alt+8/9 for zooming
0x8000 - the logframe where savelog stuff is added



There is no flag for weapons/swords for enablefeatures.

Kyranki 12-04-2007 06:35 AM

Maybe it's showstats dunno.

Inverness 12-04-2007 12:33 PM

Thats called being owned in the face, Stan.
Quote:

Originally Posted by commands.rtf
disableweapons; disables the player’s sword+bombs+darts


Crow 12-04-2007 04:13 PM

Quote:

Originally Posted by Kyranki (Post 1362073)
Maybe it's showstats dunno.

GUI.

coreys 12-04-2007 04:34 PM

Quote:

Originally Posted by Inverness (Post 1362095)
Thats called being owned in the face, Stan.

<3!

Tigairius 12-04-2007 09:01 PM

Quote:

Originally Posted by Kyranki (Post 1362073)
Maybe it's showstats dunno.

Sometimes you seem to be too confident in yourself. You should double check sometimes to refrain from making yourself look stupid in the future, I do!

cbk1994 12-04-2007 11:09 PM

Quote:

Originally Posted by Kyranki (Post 1362041)
Actually, Vash. enablefeatures(params); disables all the features except for those that are listed in the parameters. And one of those parameters is the ability to use the sword. Which means if you use enablefeatures(params) and do not include (I forget the number of the param for weapons) you will lose the ability to use the sword and weapons.

Considering this is how I do it on Arca, It is possible to disable weapons using enablefeatures(params) unless I "ZOMGWTFPWNED the graal servers" to make this work.

Think before you speak.

Kyranki 12-05-2007 03:50 AM

I get the point. o_o

If so, would someone kindly care to explain what enablefeatures() is doing that makes it so the s button doesn't work then?

Edit: Ok, wait. I have a custom movement system so I feel like an *******. But it doesn't use disableweapons() anywhere. Would disabledefmovement() disable the sword as well? o_O

Edit 2: Yeah, disabledefmovement() is what was disabling the sword (tested it first ;o).

Rapidwolve24 12-05-2007 04:10 AM

Quote:

Originally Posted by Kyranki (Post 1362201)
I get the point. o_o

If so, would someone kindly care to explain what enablefeatures() is doing that makes it so the s button doesn't work then?

Edit: Ok, wait. I have a custom movement system so I feel like an *******. But it doesn't use disableweapons() anywhere. Would disabledefmovement() disable the sword as well? o_O

Edit 2: Yeah, disabledefmovement() is what was disabling the sword (tested it first ;o).

Read napo's post, enablefeatures keeps the declared bitmaps enabled.

For example:
enablefeatures( 1 );
Would keep the "M" button enabled for Graal's map viewer. Every other listed feature will not work.

If you want to add another feature append a "-" sign and then another bitflag.
enablefeatures( 1 - 2);
Would enable both the "M" button for the default map viewer, and the "P" to enable Graal's standard pause.

---

disabledefmovement(); disables the player's ability to move, not sure if it prevents the player from swinging or not.

BigBear3 12-05-2007 04:10 AM

Quote:

Originally Posted by Tigairius (Post 1362143)
Sometimes you seem to be too confident in yourself. You should double check sometimes to refrain from making yourself look stupid in the future, I do!

Looooooooooooooooooooooooooool.

Angel_Light 12-05-2007 04:33 AM

also enablefeatures( 1 | 2 | 4); "|" works too.

Kyranki 12-05-2007 04:36 AM

@ rapidwolve, I tested some with only a weapon with disabledefmovement() and without any weapons at all. He could swing without the weapon and when the weapon was added he couldn't swing.

Rapidwolve24 12-05-2007 04:39 AM

Quote:

Originally Posted by Kyranki (Post 1362211)
@ rapidwolve, I tested some with only a weapon with disabledefmovement() and without any weapons at all. He could swing without the weapon and when the weapon was added he couldn't swing.

What weapon are you talking about?

Kyranki 12-05-2007 05:00 AM

It was a custom movement system :o I'm referring to a Weapon NPC of course.

Rapidwolve24 12-05-2007 05:02 AM

Quote:

Originally Posted by Kyranki (Post 1362213)
It was a custom movement system :o I'm referring to a Weapon NPC of course.

So when your custom weapon is equipped (or in the inventory) the character cannot swing, but when it isn't they can? I don't quite follow you.

Kyranki 12-05-2007 05:04 AM

I was testing the usage of disabledefmovement() and it's relevancy as far as removing functionality for the default sword swing.

I removed all the testers weapon npcs. Then had them relog in. I had them press s and the default swing worked. Then I added the custom movement to them which contains the "disabledefmovement()" function and asked them to press s again and it didn't work.

Get me? :p

Rapidwolve24 12-05-2007 05:07 AM

Quote:

Originally Posted by Kyranki (Post 1362216)
I was testing the usage of disabledefmovement() and it's relevancy as far as removing functionality for the default sword swing.

I removed all the testers weapon npcs. Then had them relog in. I had them press s and the default swing worked. Then I added the custom movement to them which contains the "disabledefmovement()" function and asked them to press s again and it didn't work.

Get me? :p

Oh, my bad I completely misunderstood. Hmm, then apparently disabledefmovement() does disable the default sword swing. Never really used it for that though, doesn't really seem practical but you have a custom movement system so that makes sense.

Tolnaftate2004 12-05-2007 06:35 AM

Quote:

Originally Posted by Rapidwolve24 (Post 1362205)
If you want to add another feature append a "-" sign and then another bitflag.
enablefeatures( 1 - 2);
Would enable both the "M" button for the default map viewer, and the "P" to enable Graal's standard pause.

I hope you mean "+".

Crow 12-05-2007 05:10 PM

Quote:

Originally Posted by Tolnaftate2004 (Post 1362232)
I hope you mean "+".

You stole my post :<

Angel_Light 04-12-2008 05:18 AM

*bump* still no working solution.

EDIT: disableweapons()/disablemovement() work, but seem quite unpractical. Is there a way to just disable the sword? Also is there anyway to make so the player can not pick up the tile bushes?

DustyPorViva 04-12-2008 05:21 AM

disableweapons and simply rescript the weapon(D)?

Angel_Light 04-12-2008 05:29 AM

I GOT IT!!! Without disabling weapons. I feel really stupid for not realizing this earlier. XP

PHP Code:

setSword"", -1); 

will disable it all together.

Now as for the bush matter. I'm still lost other than using disabling the movement System.

DustyPorViva 04-12-2008 05:40 AM

That's odd... I thought negatives just made it a healing sword.
Like I said, you can simply just disable weapons... which will only disable the sword and weapon, and rescript the weapons(if you still need to use them). It's not that hard to rescript the weapon function.

Angel_Light 04-12-2008 06:04 AM

Well. The weapons sys I already have needs weapons to be enabled (for onKeyPressed and stuff to work)


All times are GMT +2. The time now is 09:27 PM.

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