Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Weapon select (https://forums.graalonline.com/forums/showthread.php?t=20608)

kaddar 01-07-2002 11:36 AM

Weapon select
 
Is there a command to select weapon (index) but not run any scripts in it, only select it for you weapon usage?

BlKnight 01-07-2002 12:53 PM

Re: Weapon select
 
Quote:

Originally posted by kaddar
Is there a command to select weapon (index) but not run any scripts in it, only select it for you weapon usage?


What do you mean? You could have a variable set on the selected weapon...or have a thing go like this:

for (this.i=0;this.i<weaponscount-1;this.i++) {
if (strequals(#w(this.i),<WEAPON YOU ARE LOOK FOR HERE>)) {
this.selectedweapon=this.i;
}
}

Then you just use callweapon and for the index in call weapon use this.selectedweapon.

BocoC 01-07-2002 01:14 PM

selectedweapon [index];

Say you wanted to automatically set the player's weapon to weapon Bow.
NPC Code:

for (i=0;i<weaponscount;i++) {
if (strequals(#w(i),Bow)) {
selectedweapon=i;
}
}


BlKnight 01-07-2002 01:33 PM

Quote:

Originally posted by BocoC
selectedweapon [index];

Say you wanted to automatically set the player's weapon to weapon Bow.
NPC Code:

for (i=0;i<weaponscount;i++) {
if (strequals(#w(i),Bow)) {
selectedweapon=i;
}
}


Bah...I'm not used to these fancy n00b commands that make things which can already be done easier -_-

Falcor 01-07-2002 08:09 PM

showimg 200,#w(selectedweapon),x,y;

Have a nice day

G_yoshi 01-07-2002 10:04 PM

Quote:

Originally posted by Falcor
showimg 200,#w(selectedweapon),x,y;

Have a nice day

He meant is there a command that sets the player's weapon to whatever index you specify.

Saga2001 01-07-2002 10:21 PM

Quote:

Originally posted by G_yoshi


He meant is there a command that sets the player's weapon to whatever index you specify.

sweet sig!

kaddar 01-08-2002 12:04 AM

Thanks for all the info.

Blknight, I was considering your idea, but the problem is that it would not work in corralation with keydown(d) if I attempted to rescript the weaponfire as well as weaponselect unless the selected weapon was locked to the weapon-simulation.

And yes, that's what I'm doing, making something like graal2002 weaponselect. I have a menu visible where you can move between all your items, but I can't select the items. =D

IT works now! Yay.

Falcor 01-08-2002 03:41 AM

Oh, I did that in the backpacknpc, not a problem really, but you have to keep in mind that you might have hidden weapons. (system, and other stuff)

WHIPENIE4 01-08-2002 04:07 AM

[screen_name says:]

i almost forgot about the hidden weapons when i was scripting my inventory :P

i figured it out though


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

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