Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Is_Object_Visible explanation
Is_Object_Visible explanation [message #469223] Wed, 13 June 2012 09:40 Go to next message
[KH]LordOfDeath is currently offline  [KH]LordOfDeath
Messages: 10
Registered: March 2008
Location: Germany
Karma: 0
Recruit
Hey i need a little explanation how to use "Is_Object_Visible(GameObject *Obj,GameObject *Visible);" function correctly

i wanna check if a player is NOT visible (spy) but i dont get the 2 parameters thing

1 parameter is the player GameObject right? but whats the other

if here is some1 who can tell me how to get if a player is visible or not visible pls feel free to reply Smile

LordOfDeath
Re: Is_Object_Visible explanation [message #469224 is a reply to message #469223] Wed, 13 June 2012 09:43 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
"Is_Object_Visible(looker,objtolookat);



this might be the thing you search

obj->As_SoldierGameObj()->Is_Visible()


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Wed, 13 June 2012 10:03]

Report message to a moderator

Re: Is_Object_Visible explanation [message #469226 is a reply to message #469223] Wed, 13 June 2012 10:09 Go to previous messageGo to next message
[KH]LordOfDeath is currently offline  [KH]LordOfDeath
Messages: 10
Registered: March 2008
Location: Germany
Karma: 0
Recruit
thx for the fast reply^^

is there a way just to check if a player is visible without an object who "looks" to the player?

i want let the spy can read the enemie's team chat
but i needa check to prevent normal SBHs to get the enemy team msgs

my idea to check for spy if objekt is created is down xD
its cus object gets created and after this it get its invisible status so i cant use it -.-

i think about edit the ssgm crate source to write the spy player id in to a file where the chat hook get its "spy info" what do i after spy is dead? i can recheck on the object destroyed or player leave event. but how can i single check the visibility of a player?

is my idea possible to send enemie's teamchat to a spy? xD if not i let the project die^^

EDIT: thx for the line ill check later^^
Re: Is_Object_Visible explanation [message #469237 is a reply to message #469226] Wed, 13 June 2012 12:27 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

By "visible" it sounds like you're talking about whether an object is cloaked or not, not if it's simply visible to another object (I don't know that that even takes stealthing into account either). You could always make a Spy_Script then attach it to the spy when they pick up the crate and if you want to check if somebody's a spy, simply do

if (Is_Script_Attached(obj,"My_Spy_Script"))
{
   ...do stuff for spies
}


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Is_Object_Visible explanation [message #469242 is a reply to message #469223] Wed, 13 June 2012 14:35 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Is_Visible() refers to the ability of objects with AI on them (e.g. turrets and the Obelisk) to "see" an object and thereby target it.

Is_Rendered() can be used to check if an object is rendered or not.

Is_Stealth() will tell you if an object is stealthed or not.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: Is_Object_Visible explanation [message #469246 is a reply to message #469223] Wed, 13 June 2012 15:07 Go to previous message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
Put this in a chat hook and it will send the enemy's team chat to any players that Commands->Set_Is_Visible has been used on.

	if (Type == TEXT_MESSAGE_TEAM) {
		int Team = Get_Player_Team(ID);
		cScTextObj *ChatEvent = 0;
		for (SLNode<SoldierGameObj> *z = GameObjManager::StarGameObjList.Head();z;z = z->Next()) {
			SoldierGameObj *Soldier = z->Data();
			if (!Soldier->Is_Visible() && Soldier->Get_Player_Type() != Team) {
				if (!ChatEvent) {
					ChatEvent = Send_Client_Text(Msg,TEXT_MESSAGE_TEAM,false,ID,-1,false,false);
				}
				ChatEvent->Set_Object_Dirty_Bits(Get_Player_ID(Soldier),NetworkObjectClass::BIT_CREATION);
			}
		}
	}




Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
Previous Topic: AI params questions
Next Topic: New 3rd Party to host legacy DCOM Renegade content.
Goto Forum:
  


Current Time: Wed Dec 18 00:58:14 MST 2024

Total time taken to generate the page: 0.00717 seconds