Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   TROUBLE: stealth (https://forums.graalonline.com/forums/showthread.php?t=134261554)

Twilikari 01-05-2011 06:18 AM

TROUBLE: stealth
 
We've managed to get the stealth to work clientside, but only the player using it is invisible... to themselves...
Any ideas how to get it to work? And maybe so that you yourself see a faded version of yourself?

fowlplay4 01-05-2011 06:21 AM

Use a gani, set the player's alpha to 0 in the gani's script OR just make a blank gani and replace their walk, idle, etc. ganis with it.

WhiteDragon 01-05-2011 06:24 AM

And set the alpha to some value between 0 and 1 if you want it to be faded.

Twilikari 01-05-2011 06:24 AM

I didn't consider a GANI :o
but how would you make it so that the person stealthed could se themselves as about .5 alpha?

cbk1994 01-05-2011 06:31 AM

Quote:

Originally Posted by Twilikari (Post 1620497)
I didn't consider a GANI :o
but how would you make it so that the person stealthed could se themselves as about .5 alpha?

Use player.alpha = 0.5; in a clientside weapon that only they have.

DustyPorViva 01-05-2011 07:46 AM

You can also just use hideplayer(time).

xXziroXx 01-05-2011 08:19 AM

Quote:

Originally Posted by DustyPorViva (Post 1620504)
You can also just use hideplayer(time).

I would recommend against that. hideplayer() seems to be highly unreliable and doesn't hide people on other peoples screens half the time.

cbk1994 01-05-2011 01:54 PM

Quote:

Originally Posted by xXziroXx (Post 1620507)
I would recommend against that. hideplayer() seems to be highly unreliable and doesn't hide people on other peoples screens half the time.

Indeed. I haven't been able to get it to work at all recently.

Twilikari 01-05-2011 11:46 PM

Progress so far:
-I've got it too where there are no error messages in RC when I save it
- see the .5 on my screen
-There are no visible effects to other players, so no stealth
-I just realized I would also want to hide the nickname too...

Anymore tips?

fowlplay4 01-06-2011 12:51 AM

Hire a scripter.

Twilikari 01-06-2011 03:55 AM

It's not for a server, so much as self gain.

PHP Code:

findplayer("Graal753442").addweapon(this.name);
function 
onActionServerside() {
  if (
this.active=false) {
    
player.alpha=1;
  }
  else {
    
player.alpha=0;
  }
}      
//#CLIENTSIDE
function onCreated(){
this.active=false;
}
function 
onWeaponfired() {
  
this.active = !this.active;
  
triggerserver;  
    if (
this.active=false) {
      
player.alpha=1;
    } 
    else{
      
player.alpha=.5;
  }


PHP Code:

findplayer("Graal753442").addweapon(this.name);
function 
onActionServerside(this.active) {
  if (
this.active=false) {
    
player.alpha=1;
  }
  else {
    
player.alpha=0;
  }
}      
//#CLIENTSIDE
function onCreated(){
this.active=false;
}
function 
onWeaponfired() {
  
this.active = !this.active;
  
triggerserver(0,0,"serverside",this.name);  
    if (
this.active=false) {
      
player.alpha=1;
    } 
    else{
      
player.alpha=.5;
  }


These are twon versions. any tips/fixes?

Twinny 01-06-2011 09:12 AM

This is what I did for Classic iPhone stealth (removed some other parts to provide this),

Weapon: -Staff/Stealth
PHP Code:

//#CLIENTSIDE
function onCreated() {
  
player.attr[22] = "unstealth.gani";
}

function 
ChatBar.onAction() {
  if (
ChatBar.text == "/stealth") {
    
toggleStealth();
    
ChatBar.text "";
  }
}

function 
toggleStealth() {
  
this.stealth = !this.stealth;
  if (
this.stealth)
    
player.attr[22] = "stealth.gani";
  else
    
player.attr[22] = "unstealth.gani";


in the gani,
PHP Code:

function onPlayerEnters() {
  if (
clientr.isStaff)
    
player.alpha 0.4;
  else
    
player.alpha 0;


So, all staff can see the stealthed person at half alpha while no-one else can see them.

Twilikari 01-06-2011 11:27 PM

Quote:

Originally Posted by Twinny (Post 1620752)
This is what I did for Classic iPhone stealth (removed some other parts to provide this),

Weapon: -Staff/Stealth
PHP Code:

//#CLIENTSIDE
function onCreated() {
  
player.attr[22] = "unstealth.gani";
}

function 
ChatBar.onAction() {
  if (
ChatBar.text == "/stealth") {
    
toggleStealth();
    
ChatBar.text "";
  }
}

function 
toggleStealth() {
  
this.stealth = !this.stealth;
  if (
this.stealth)
    
player.attr[22] = "stealth.gani";
  else
    
player.attr[22] = "unstealth.gani";


in the gani,
PHP Code:

function onPlayerEnters() {
  if (
clientr.isStaff)
    
player.alpha 0.4;
  else
    
player.alpha 0;


So, all staff can see the stealthed person at half alpha while no-one else can see them.

that's exactly what i was looking for :o
Would it ne nad if i used this? I still wanna re-write it, but now the server I'm on wants a script ._.

callimuc 01-08-2011 07:57 PM

here i found this script:
PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/stealth") {
    if (
player.alpha == 1)
      
triggerserver("gui",this.name,"SetStealth",0);
    else
      
triggerserver("gui",this.name,"SetStealth",1);
  }


but for some reason player can still see your name. i also tried like:
PHP Code:

    if (player.alpha == 1


cbk1994 01-08-2011 08:24 PM

Quote:

Originally Posted by callimuc (Post 1621342)
here i found this script:
PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/stealth") {
    if (
player.alpha == 1)
      
triggerserver("gui",this.name,"SetStealth",0);
    else
      
triggerserver("gui",this.name,"SetStealth",1);
  }


but for some reason player can still see your name. i also tried like:
PHP Code:

    if (player.alpha == 1


player.alpha does not affect the player's name. My recommendation would be to set the player's name to "" on serverside, or use hidePlayer.


All times are GMT +2. The time now is 01:15 AM.

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