Home » Renegade Discussions » Mod Forum » Question...
Re: Question... [message #466835 is a reply to message #466348] |
Sat, 28 April 2012 16:19 |
robbyke
Messages: 348 Registered: September 2010 Location: Belgium
Karma:
|
Recruit |
|
|
Whitedragon wrote on Thu, 19 April 2012 05:01 |
The code below will create a zone at the base center. For some maps, like Canyon and Glacier, you'll need more than one zone to properly cover the base.
Vector3 Get_Base_Center(int Team) {
Vector3 ReturnPos(0.0f,0.0f,0.0f);
BaseControllerClass *Base = BaseControllerClass::Find_Base(Team);
if (Base) {
int Num = 0;
for (Num = 0;Num < Base->BuildingList.Count();Num++) {
ReturnPos += Commands->Get_Position(Base->BuildingList[Num]);
}
if (Num) {
ReturnPos /= (float)Num;
}
}
return ReturnPos;
}
void LevelLoaded() {
Vector3 Size = Vector3(50.0f,50.0f,50.0f); //Should load the size per map from a config file.
Matrix3 Rotation(true);
Rotation.Rotate_Z(1.0f); //Should load a rotation per map from a config file.
OBBoxClass Box(Get_Base_Center(0),Size,Rotation); //Create the bounding box with the position of the Nod base, and the size and rotation defined earlier.
GameObject* Zone = Create_Zone("Script_Zone_All",Box);
//Attach whatever script you want to the zone now.
}
|
i wanted to use this but i cant, buildinglist is inaccesible, so i cant do it this
Owner of kambot TT server
kambot.freeforums.org
|
|
|
|
|
Question...
By: FeaR on Tue, 10 April 2012 01:18
|
|
|
Re: Question...
|
|
|
Re: Question...
By: FeaR on Tue, 10 April 2012 01:42
|
|
|
Re: Question...
|
|
|
Re: Question...
By: robbyke on Tue, 10 April 2012 08:16
|
|
|
Re: Question...
By: Ethenal on Tue, 10 April 2012 16:56
|
|
|
Re: Question...
|
|
|
Re: Question...
By: FeaR on Wed, 11 April 2012 01:27
|
|
|
Re: Question...
By: FeaR on Wed, 11 April 2012 09:03
|
|
|
Re: Question...
By: jlhill17 on Wed, 11 April 2012 13:40
|
|
|
Re: Question...
|
|
|
Re: Question...
By: FeaR on Thu, 12 April 2012 13:40
|
|
|
Re: Question...
By: robbyke on Wed, 18 April 2012 02:31
|
|
|
Re: Question...
|
|
|
Re: Question...
By: robbyke on Wed, 18 April 2012 08:18
|
|
|
Re: Question...
|
|
|
Re: Question...
By: robbyke on Wed, 18 April 2012 17:55
|
|
|
Re: Question...
|
|
|
Re: Question...
By: robbyke on Thu, 19 April 2012 15:31
|
|
|
Re: Question...
By: robbyke on Sat, 28 April 2012 16:19
|
|
|
Re: Question...
By: Omar007 on Wed, 18 April 2012 15:07
|
|
|
Re: Question...
|
|
|
Re: Question...
By: robbyke on Thu, 19 April 2012 18:53
|
|
|
Re: Question...
|
|
|
Re: Question...
By: robbyke on Fri, 20 April 2012 05:52
|
|
|
Re: Question...
|
|
|
Re: Question...
By: jonwil on Fri, 20 April 2012 07:14
|
|
|
Re: Question...
By: robbyke on Fri, 20 April 2012 11:07
|
Goto Forum:
Current Time: Wed Dec 18 20:57:45 MST 2024
Total time taken to generate the page: 0.01157 seconds
|