Graal Forums

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

sage_chaozu 10-01-2002 05:33 AM

Disabling Swords
 
I am wondering if anyone has stumbled upon this or have noticed this. This code disables the sword

code:

setsword 0,#1;

I hope you can all understand what that statement says.

emortylone 10-01-2002 06:54 AM

Does that not just set it as a level 0 sword? He he, I just set ap to 100 for my HP System, never really occured to me otherwise...
Good thinking :D
---Shifter

sage_chaozu 10-01-2002 08:23 AM

no slicing either
 
well it does set to zero, but I also noticed that when I press s.. I do not slice my sword either

emortylone 10-01-2002 08:59 AM

Ah, he he. I didn't realize doing that would. Thanks, of course you should set a var (preferably a string though) to refer back to the sword. If you set a var and they get dc'ed or restart it clears =/
---Shifter

sage_chaozu 10-01-2002 09:03 AM

duh
 
duh, I know.. I am not a newbie scripter ;)
Just haven't posted that much :D

Graal2001_NAT 10-01-2002 09:25 AM

yes, sage chaozu is a very good scripter :)

screen_name 10-01-2002 03:25 PM

I used to use this method, but slightly modified.

NPC Code:

setsword no-sword.png,0;



But now I use disabledefmovement.

emortylone 10-01-2002 11:09 PM

LOL, I know you aren't Sage, I"ve heard a few people tell me that Sage could own me in scripting =/ Gets old fast, considering I've never seen him and they've never seen my stuff :(
---Shifter

Com013 10-03-2002 01:41 AM

Quote:

Originally posted by screen_name
NPC Code:

setsword no-sword.png,0;



That's what we do on Classic.

Graal2001_Developer1 10-03-2002 02:13 AM

Best way is probably to rescript the whole movement etc.

Dach 10-03-2002 07:57 AM

Quote:

Originally posted by Graal2001_Developer1
Best way is probably to rescript the whole movement etc.
He posted this so you don't have to do that...

Com013 10-03-2002 10:43 AM

Quote:

Originally posted by Graal2001_Developer1
Best way is probably to rescript the whole movement etc.
But how do you want to carry NPCs with a replaced movement?

Graal2001_NAT 10-03-2002 11:51 AM

Quote:

Originally posted by Com013

But how do you want to carry NPCs with a replaced movement?

ganis, triggeraction, and some tiles[] or board[] commands

Graal2001_Developer1 10-03-2002 05:12 PM

Quote:

Originally posted by Com013

But how do you want to carry NPCs with a replaced movement?

or like 2k2 does :P
I did something like this with the bombs for Atlantis
actually it's no problem to replace this...

Loriel 10-03-2002 11:45 PM

Quote:

Originally posted by Graal2001_Developer1
I did something like this with the bombs for Atlantis
actually it's no problem to replace this...

But he wants to carry NPCs, like NPCs that have a script and stuff.

Lit 10-04-2002 12:47 AM

so what u want is swords disabled but not the NPCs Weapons Or anything in that order may i ask why and why dont u use
PHP Code:

if (playerenters) {toweapons *WeaponsDisabled;}     if (!strequals(#l,Levelname)) {destroy;} 

Eh?

R0b1n-NPC 10-04-2002 01:23 AM

Quote:

Originally posted by Lit
so what u want is swords disabled but not the NPCs Weapons Or anything in that order may i ask why and why dont u use
PHP Code:

if (playerenters) {toweapons *WeaponsDisabled;}     if (!strequals(#l,Levelname)) {destroy;} 

Eh?

AHHHHHH WHERES THE CARRIGE RETURNS!!!!!!!!!!!!?!?!??!?!?!?!?

PHP Code:

if (playerenters) {
  
toweapons *WeaponsDisabled;
}
if (!
strequals(#l,Levelname)) {
  
destroy;


Also Kaimetsu is right, your script would do bugger all..

Com013 10-04-2002 04:34 AM

With that script you could simply select another weapon.
Use timeouts and set selectedweapon to this weapon always.
I did so in the Nimda sparring.

But we are off-topic now.

We wanted to disable the sword, and just the sword.
By doing "setsword no-sword.png,0;" you still have a zero displayed.
Using disabledefmovement would hide that, but I couldn't carry NPCs anymore.
I know how to carry tile objects like bushes and so, and yes I could even make the player carry a bomb, but I can't make him carry a whole script.

sage_chaozu 10-04-2002 04:42 AM

Disabling NPC Weapons
 
if (playerenters) {
if (!isweapon) {
toweapons NoWeaponSelected;
}
disableselectweapons;
timeout = .05;
}

if (timeout) {
if (!strequals(#w(selectedweapon),NoWeaponSelected)) {
for (this.index = 0; this.index <= weaponscount; this.index++){
if (strequals(#w(this.index),NoWeaponSelected))
break;
}
selectedweapon = this.index;
}
timeout = .05;
}

That should be the correct way to disable npc weapons...
almost forgot the disable q select

R0b1n-NPC 10-04-2002 04:47 AM

disableweapons;

AlexH 10-04-2002 04:49 AM

Quote:

Originally posted by R0b1n-NPC
disableweapons;
That disables all weaons including D NPCs.
His just stops the sword from working.

sage_chaozu 10-04-2002 04:49 AM

Disableweapons?
 
Disable Weapons does not let you use your sword...
that script lets you use your sword...

also, I had to re-edit because I forgot about disableselectweapons;

Graal2001_Developer1 10-04-2002 04:54 PM

Quote:

Originally posted by Kaimetsu


Hmm. Surely shoot and putnpc2 could do the trick. I'm not sure, I haven't ever really used shoot.

But it's the way it works ;)
after doing shoot the control-npc would get triggered, you set some params with setshootparams and it reads them out
after this you can place the right NPC whre you actually throw it

emortylone 10-04-2002 11:11 PM

Why would you really want to disable JUST the sword?? I generally do it the other way, KEEP just the sword, in which case you run it on a timeout, and have it set a this.var of what the selectedweapon is. Such as like:
NPC Code:

if (created)
{ toweapons *Sword-Only;
this.weap=selectedweapon;
timeout=0.25;
}

if (timeout)
{ if (!selectedweapon=this.weap)
{ selectedweapon=this.weap;}
timeout=0.25;
}


Is it setting the selected weapon or setplayerprop, god, I dunno, I have one I made that I just repeatedly used. I'm scripted out for a few days, I just made a security system, took AGES to do, it wasn't necessarily hard, just long coded. Angel wanted it scripted, so I did :P I worked on it a total of three days, but it was mostly sitting down and doing one thing, coming back hours l8er or what not ;) It's got a keypad that you can click or type in.
---Shifter

sage_chaozu 10-05-2002 12:54 AM

Quote:

Originally posted by emortylone

NPC Code:

if (created)
{ toweapons *Sword-Only;
this.weap=selectedweapon;
timeout=0.25;
}

if (timeout)
{ if (!selectedweapon=this.weap)
{ selectedweapon=this.weap;}
timeout=0.25;
}



I don't think that would work as good as the example I posted earlier because the weapon's index would change if a weapon whose index is lower gets deleted.

Also one reason why to have the sword disabled is so you can have a server whose primary weapon is not a sword. Like for instance it could be a regular pistol or socom.


All times are GMT +2. The time now is 05:47 AM.

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