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)

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 10:34 AM.

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