Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-05-2011, 06:18 AM
Twilikari Twilikari is offline
Registered User
Twilikari's Avatar
Join Date: Nov 2010
Location: America
Posts: 86
Twilikari is on a distinguished road
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?
Reply With Quote
  #2  
Old 01-05-2011, 06:21 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.
__________________
Quote:
Reply With Quote
  #3  
Old 01-05-2011, 06:24 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
And set the alpha to some value between 0 and 1 if you want it to be faded.
Reply With Quote
  #4  
Old 01-05-2011, 06:24 AM
Twilikari Twilikari is offline
Registered User
Twilikari's Avatar
Join Date: Nov 2010
Location: America
Posts: 86
Twilikari is on a distinguished road
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?
Reply With Quote
  #5  
Old 01-05-2011, 06:31 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Twilikari View Post
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.
__________________
Reply With Quote
  #6  
Old 01-05-2011, 07:46 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
You can also just use hideplayer(time).
Reply With Quote
  #7  
Old 01-05-2011, 08:19 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by DustyPorViva View Post
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.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #8  
Old 01-05-2011, 01:54 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
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.
__________________
Reply With Quote
  #9  
Old 01-05-2011, 11:46 PM
Twilikari Twilikari is offline
Registered User
Twilikari's Avatar
Join Date: Nov 2010
Location: America
Posts: 86
Twilikari is on a distinguished road
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?
Reply With Quote
  #10  
Old 01-06-2011, 12:51 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Hire a scripter.
__________________
Quote:
Reply With Quote
  #11  
Old 01-06-2011, 03:55 AM
Twilikari Twilikari is offline
Registered User
Twilikari's Avatar
Join Date: Nov 2010
Location: America
Posts: 86
Twilikari is on a distinguished road
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?
Reply With Quote
  #12  
Old 01-06-2011, 09:12 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
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.
Reply With Quote
  #13  
Old 01-06-2011, 11:27 PM
Twilikari Twilikari is offline
Registered User
Twilikari's Avatar
Join Date: Nov 2010
Location: America
Posts: 86
Twilikari is on a distinguished road
Quote:
Originally Posted by Twinny View Post
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 ._.
Reply With Quote
  #14  
Old 01-08-2011, 07:57 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
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
Reply With Quote
  #15  
Old 01-08-2011, 08:24 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by callimuc View Post
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.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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