Find_Object only inside a Zone [message #407989] |
Thu, 22 October 2009 09:30 |
|
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)
[Updated on: Thu, 22 October 2009 09:43] Report message to a moderator
|
|
|
|
|
|
Re: Find_Object only inside a Zone [message #408006 is a reply to message #407989] |
Thu, 22 October 2009 12:33 |
|
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 #408026 is a reply to message #408001] |
Thu, 22 October 2009 14:50 |
|
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
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
[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 |
|
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>>
|
|
|