Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Hidden NPCW Skipping (https://forums.graalonline.com/forums/showthread.php?t=28932)

zallus-k 05-11-2002 11:25 AM

Hidden NPCW Skipping
 
Does anyone know of a process to skip past nidden NPCWs in a menu system? I tried several times without luck. Oh, and in case it matters, the NPC only shows the current, previous, and next NPCWs in the list.

Neonight 05-11-2002 11:33 AM


Jagen:
if(!startswith(-,#w(index)))
try somethin like that

zallus-k 05-11-2002 11:42 AM

How about I tried
NPC Code:

for(this.zix=0;startswith(-,#w(selectedweapon-this.zix));this.zix++){;}
selectedweapon=selectedweapon-(this.zix+1);


And it didn't work?

zallus-k 05-11-2002 12:04 PM

Hey.
 
I really need this quickly, seeing as electricity to this laptop is running out. Please, does anyone know?

amonrabr 05-11-2002 08:48 PM

Quote:

Originally posted by Neonight

Jagen:
if(!startswith(-,#w(index)))
try somethin like that

It doesnt work because the "-" is not in the weapons name...
I made a script long time ago that I had to use something like, I just saw that I usully didnt put images on the hidden weapons so I used "if(!startswith(-,#W(index)))", but I dunno if there is another way

G_yoshi 05-11-2002 10:57 PM

Quote:

Originally posted by zallus-k
How about I tried
NPC Code:

for(this.zix=0;startswith(-,#w(selectedweapon-this.zix));this.zix++){;}
selectedweapon=selectedweapon-(this.zix+1);


And it didn't work?

I would say create a string array or a string list of acceptable or allowable NPCW names and check from there...just leave out the hidden weapons :D

screen_name 05-11-2002 11:57 PM

keep a string or something with the weapon list in it (of the player)
NPC Code:

for (this.inc=0;this.inc<weaponscount;this.inc++) {
if (!startswith(-,#w(this.inc))) {
addstring player.weaponlist,#w(this.inc);
}
}


zallus-k 05-12-2002 12:38 AM

Bah.
 
I have pretty much lost all hope of figuring this out. Here's the code that I ended up with, try to figure it out if you can:

PHP Code:

function WeaponSelect() {
  if((
keydown(9) && !inws) || (mousescreenx 70 && mousescreeny 70 && mousedown)) {
    
disabledefmovement;
    
sleep 0.2;
    
setani idle,;
    
set inws;
    
setarray this.wlist,256;
    
this.p=0;
    for (
this.zfm=0;this.zfm<weaponscount;this.zfm++) {if (!startswith(-,#w(this.zfm))) this.wlist[this.p]==zfm;this.p++;}
  
}
  if (
inws) {
    for(
this.pi=0;selectedweapon!=this.wlist[this.pi];this.pi++) {;}
    if(
selectedweapon!=0)this.pi++;
    
showimg 1032,wpn2.png,13,74;
    
changeimgvis 1032,4;
    
showimg 1033,#W,13+7,74+43;
    
changeimgvis 1033,4;
    
showimg 1036,@ - #w,13+7+32+4+5,74+43+7;
    
changeimgvis 1036,4;
    if(
selectedweapon 0) {
      
showimg 1034,#W(this.wlist[this.pi-1]),13+7,74+7;
      
changeimgcolors 1034,1,1,1,0.99;
      
changeimgvis 1034,4;
    }else{
hideimg 1034;}
    if(
selectedweapon < (weaponscount-1)) {
      
showimg 1035,#W(this.wlist[this.pi+1]),13+7,74+79;
      
changeimgcolors 1035,1,1,1,0.99;
      
changeimgvis 1035,4;
    }else{
hideimg 1035;}
    if((
keydown(5) || keydown(9)) || ((mousescreenx 52 || mousescreeny 185) && mousedown)) {
      
hideimg 1032;
      
hideimg 1033;
      
hideimg 1034;
      
hideimg 1035;
      
hideimg 1036;
      
enabledefmovement;
      unset 
inws;
      
sleep 0.2;
    }
    if((
keydown(0) || keydown(1)) || (mousescreenx 20 && mousescreeny 81 && mousescreenx 52 && mousescreeny 113 && mousedown)) {
      for(
this.zix=0;startswith(-,#w(selectedweapon-this.zix));this.zix++){;}
      
selectedweapon=selectedweapon-(this.zix+1);
      
sleep 0.1;
    }
    if((
keydown(2) || keydown(3)) || (mousescreenx 20 && mousescreeny 153 && mousescreenx 52 && mousescreeny 185 && mousedown)) {
      if(
startswith(-,#w(selectedweapon+1))) {
        
selectedweapon=selectedweapon+2;
      }else{
        
selectedweapon=selectedweapon+1;
      }
      
sleep 0.1;
    }

  }



Bhala 05-13-2002 08:45 AM

make sure all your weapons use a clear img & just check for that img on the weapon.... ie make them use null.png & do
if(!strequals(#W,null.png)){
//do stuff here
}


All times are GMT +2. The time now is 04:36 AM.

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