Graal Forums

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

adam 06-11-2003 04:15 AM

disable sword
 
If anybody has experience with this I wouldn't mind a little help finding an answer.

I want to basically disable the s key.
I've tried a few things, I searched on the board and found a few things that didn't work.

A way to disable the sword so I can make a new one for the s key. I've tried setting the swordpower to 0, but it won't let me? I've tried replaceani but it still cuts and stuff and freezes you a little.

It would be nice if there was a enablefeatures option to get rid of the sword or something like that though.

Pokilty 06-11-2003 04:34 AM

i know i got it to work a while ago by just setting the gani to idle whenever the player pressed S so they never used the sword.if u wanna make a system then just set S to whatever you need.

Tseng 06-11-2003 05:08 AM

Re: disable sword
 
Copy the sword.gani to a new gani named swordsafe.gani.

A weapon script should have (clientsided):

if (created) {
replaceani sword,swordsafe;
}

Press S.

adam 06-11-2003 05:27 AM

Re: Re: disable sword
 
Quote:

Originally posted by Tseng
Copy the sword.gani to a new gani named swordsafe.gani.

A weapon script should have (clientsided):

if (created) {
replaceani sword,swordsafe;
}

Press S.

and this doesn't even pause the player or destroy bushes/ tiles?

I guess I could live with that, if it's the best I can get.

Tseng 06-11-2003 05:40 AM

Re: Re: Re: disable sword
 
Quote:

Originally posted by adam


and this doesn't even pause the player or destroy bushes/ tiles?

I guess I could live with that, if it's the best I can get.

What it doesn't do, script!

osrs 06-11-2003 11:23 PM

As Tseng said,replaceani would be a good idea,then if you want,script a new "HP System",trigger an action to hurt the players and etc.
Im not sure about bushes/tiles,but i think hitobjects would work. :grin:

adam 06-11-2003 11:30 PM

Re: Re: Re: Re: disable sword
 
Quote:

Originally posted by Tseng


What it doesn't do, script!

Did I say it wrong? Sorry, I said it really weird didn't I.. I "didn't" want it to do any of that. I already have scripts to do all that tile stuff, and that pause in the player is annoying. I don't want anything to happen when you press s, no tile slashes, no pauses, no nothing. And I don't feel like rescripting player movement, too messy sometimes. And I always end up doing it in such weird ways.

Neoreno 06-11-2003 11:37 PM

How about...
NPC Code:
disableweapons;



That might be what yer looking fer.

TripleE 06-12-2003 12:35 AM

Quote:

Originally posted by Neoreno
How about...
NPC Code:
disableweapons;



That might be what yer looking fer.

I think you misunderstood.
NPC Code:
disableweapons;


would be if he wanted to disable everything including npc's,and sword. He justs wants the space bar,number 5,and s to be clear so he can put a new action there. Adam doesnt want a sword.;)

Neoreno 06-12-2003 01:05 AM

He could use disableweapons, but then he'd have to rescript the state, and the NPCW firing. :P

Tseng 06-12-2003 01:13 AM

Quote:

Originally posted by Neoreno
He could use disableweapons, but then he'd have to rescript the state, and the NPCW firing. :P
It'd be rather foolish to disable all weapons just to script a sword.

Dark-Dragoon 06-12-2003 01:13 AM

Quote:

Originally posted by Neoreno
He could use disableweapons, but then he'd have to rescript the state, and the NPCW firing. :P
Now that could break some inefficiency records.

Neoreno 06-12-2003 01:17 AM

Quote:

Originally posted by Dark-Dragoon

Now that could break some inefficiency records.

Well, if he was doing it anyways, it wouldn't really matter that much. But if he's not, then you're right, horribly inefficient.

adam 06-12-2003 01:20 AM

well thanx for the suggestions.

osrs 06-12-2003 02:30 AM

some new flags should be added for "enablefeatures" for disabling they keys A,S and maybe D.

Chicken_l33t 06-12-2003 04:20 AM

// NPC made by Chicken NaNa
if (timeout || playerenters){
timeout = 0.05;
if (keydown2(keycode(S),true) || keydown(5))
{
setsword nosword.png,0;
replaceani sword,idle;
setplayerprop #c,Hmm;
}
}

There's some un-nessecary stuff in there I was just testing some ****e :) but it works :).

adam 06-12-2003 04:32 AM

Quote:

Originally posted by Chicken_l33t
// NPC made by Chicken NaNa
if (timeout || playerenters){
timeout = 0.05;
if (keydown2(keycode(S),true) || keydown(5))
{
setsword nosword.png,0;
replaceani sword,idle;
setplayerprop #c,Hmm;
}
}

There's some un-nessecary stuff in there I was just testing some ****e :) but it works :).

Yea, but did you try it online :p

Tseng 06-12-2003 06:03 AM

Quote:

Originally posted by Chicken_l33t
// NPC made by Chicken NaNa
if (timeout || playerenters){
timeout = 0.05;
if (keydown2(keycode(S),true) || keydown(5))
{
setsword nosword.png,0;
replaceani sword,idle;
setplayerprop #c,Hmm;
}
}

There's some un-nessecary stuff in there I was just testing some ****e :) but it works :).

Why use a timeout and set the sword each time as well as replace the ani each time? That seems rather inefficient.

ASouthernMan 06-12-2003 06:06 AM

You COULD just disable weapons, readd the A button features (not hard), and assign D to a different function, like instead of using toweapons in weapons, you could run a flag that is added when you press D, then remove it

Tseng 06-12-2003 06:43 AM

Quote:

Originally posted by ASouthernMan
You COULD just disable weapons, readd the A button features (not hard), and assign D to a different function, like instead of using toweapons in weapons, you could run a flag that is added when you press D, then remove it
What? toweapons adds a weapon to the weapon list from a level (And in my opinion, toweapons needs to be either removed or the server option should be instated which I suggested to stefan for disabletoweapons=true...weapons should be added/edited with NC only, and with the NC Rights system this is easier than ever.)

Anyway, as I was saying; toweapons adds a weapon to the weapon list from a level. What does that have to do with assigning D to a different function?

Neoreno 06-12-2003 11:30 AM

Classic sorta depends on toweapons, bad idea to take it away right now.

Chicken_l33t 06-12-2003 01:45 PM

I said there was alot of un-nessecary code in there becasue I was testing.
he didn't ask for it to work online nor did he say offline aswell so yeh, aint sure about that one though.

adam 06-12-2003 04:29 PM

Quote:

Originally posted by Neoreno
Classic sorta depends on toweapons, bad idea to take it away right now.
He said he wanted it to be a serveroption, not to be removed entirely.

Tseng 06-12-2003 04:48 PM

Quote:

Originally posted by adam


He said he wanted it to be a serveroption, not to be removed entirely.

Either way works. :)

But I would prefer a serveroption (disabletoweapons=true), since that works the best for the most people (each server can determine if they want it allowed or not).

TripleE 06-13-2003 03:06 AM

Quote:

Originally posted by Chicken_l33t
I said there was alot of un-nessecary code in there becasue I was testing.
he didn't ask for it to work online nor did he say offline aswell so yeh, aint sure about that one though.

I got the impression that he wanted it for online use,but it works anyways offline. And like Tseng said why use so many timeouts?They arent needed.

osrs 06-13-2003 06:15 PM

Quote:

Originally posted by Tseng


What? toweapons adds a weapon to the weapon list from a level (And in my opinion, toweapons needs to be either removed or the server option should be instated which I suggested to stefan for disabletoweapons=true...weapons should be added/edited with NC only, and with the NC Rights system this is easier than ever.)

Anyway, as I was saying; toweapons adds a weapon to the weapon list from a level. What does that have to do with assigning D to a different function?

I like your suggestion,i think it should be added on serveroptions.


All times are GMT +2. The time now is 09:33 AM.

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