Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Find_Object only inside a Zone
Find_Object only inside a Zone [message #407989] Thu, 22 October 2009 09:30 Go to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
I was wondering if there is a way to search (find) an object only in the zone the script runs on.

afaik Find_Object(id) searches across the whole map and i need to get only inside the zone itself.


EDIT:
Oh and i you know how to add a Radar marker to it please tell ^^
(Supposed to be visible to both teams)


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Thu, 22 October 2009 09:43]

Report message to a moderator

Re: Find_Object only inside a Zone [message #407993 is a reply to message #407989] Thu, 22 October 2009 10:11 Go to previous messageGo to next message
Reaver11 is currently offline  Reaver11
Messages: 888
Registered: April 2007
Karma: 1
Colonel
Well I don't know about the first part.

for the second part I would just put a keycard a little bit under the map so no one can pick it up but yet the star will remain on the map Smile
Re: Find_Object only inside a Zone [message #407994 is a reply to message #407989] Thu, 22 October 2009 10:22 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
Hmm that would be usefull if i didn't wanted the color to change Razz

But if that isnt possible and there is no way of doind it in code i'll use that ^^


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: Find_Object only inside a Zone [message #408001 is a reply to message #407989] Thu, 22 October 2009 11:31 Go to previous messageGo to next message
crysis992 is currently offline  crysis992
Messages: 314
Registered: June 2008
Karma: 0
Recruit

i dont make a new topic, because my question is about le too.

i have a little problem:

I added the script Kamuix_Death_Team_Win to the GDI Guard Tower.

Now if NOD kill the tower nod dont win :/
I tried Value: 0-3 but nothing from them work Sad
so some1 know how to fix this problem? ^^
Re: Find_Object only inside a Zone [message #408006 is a reply to message #407989] Thu, 22 October 2009 12:33 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
Omar007 wrote on Thu, 22 October 2009 18:30

I was wondering if there is a way to search (find) an object only in the zone the script runs on.

afaik Find_Object(id) searches across the whole map and i need to get only inside the zone itself.


EDIT:
Oh and i you know how to add a Radar marker to it please tell ^^
(Supposed to be visible to both teams)



1. The easist way is a object loop and check everytime if:

Quote:

bool IsInsideZone(GameObject *zone,GameObject *obj); //is <solder/vehicle> inside <zone>. Will now work if object is inside a zone when its created (e.g. spawns inside zone or zone is moved around them with Create_Zone or Set_Zone_Box)



2.

Quote:

Commands->Set_Obj_Radar_Blip_Shape = (_Set_Obj_Radar_Blip_Shape)Address(bhs,"New_Set_Obj_Radar_Blip_Shape");
Commands->Set_Obj_Radar_Blip_Color = (_Set_Obj_Radar_Blip_Color)Address(bhs,"New_Set_Obj_Radar_Blip_Color");
Set_Obj_Radar_Blip_Shape_Player = (_Set_Obj_Radar_Blip_Shape_Player)Address(bhs,"New_Set_Obj_Radar_Blip_Shape_Player ");
Set_Obj_Radar_Blip_Color_Player = (_Set_Obj_Radar_Blip_Color_Player)Address(bhs,"New_Set_Obj_Radar_Blip_Color_Player ");



Quote:

i dont make a new topic, because my question is about le too.

i have a little problem:

I added the script Kamuix_Death_Team_Win to the GDI Guard Tower.

Now if NOD kill the tower nod dont win :/
I tried Value: 0-3 but nothing from them work Sad
so some1 know how to fix this problem? ^^


Cheater.


Bückstabü!
Re: Find_Object only inside a Zone [message #408008 is a reply to message #407989] Thu, 22 October 2009 13:06 Go to previous messageGo to next message
crysis992 is currently offline  crysis992
Messages: 314
Registered: June 2008
Karma: 0
Recruit

eh wtf?
Re: Find_Object only inside a Zone [message #408026 is a reply to message #408001] Thu, 22 October 2009 14:50 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
crysis992 wrote on Thu, 22 October 2009 20:31

i dont make a new topic, because my question is about le too.

i have a little problem:

I added the script Kamuix_Death_Team_Win to the GDI Guard Tower.

Now if NOD kill the tower nod dont win :/
I tried Value: 0-3 but nothing from them work Sad
so some1 know how to fix this problem? ^^

@crysis992
Uhm my post wasnt about LE...

About your problem: idk. Value 0 should work. Unless the script does something else then you think it does

@cAmpa
Ok im going to try that Thumbs Up


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Thu, 22 October 2009 14:55]

Report message to a moderator

Re: Find_Object only inside a Zone [message #408097 is a reply to message #407989] Fri, 23 October 2009 08:36 Go to previous message
E! is currently offline  E!
Messages: 70
Registered: February 2004
Karma: 0
Recruit
why not just writing your own function?

GameObject *Find_Object_In_Zone(int Team, GameObject *zone, GameObject *obj)
{
	GenericSLNode *x = BaseGameObjList->HeadNode;
	while (x)
	{
		GameObject *o = (GameObject *)x->NodeData;
		if (o && As_ScriptableGameObj(o))
		{
			if (IsInsideZone(zone,o) && Commands->Get_ID(o)==Commands->Get_ID(obj))
			{
				if ((Get_Object_Type(o) == Team) || (Team == 2))
				{
					return o;
				}
			}
		}
		x = x->NodeNext;
	}
	return 0;
}


<<SCUD-Storm Origin Creator>>
Previous Topic: Key hooks
Next Topic: CO-OP maps
Goto Forum:
  


Current Time: Wed Dec 18 21:39:15 MST 2024

Total time taken to generate the page: 0.00853 seconds