Home » Renegade Discussions » Mod Forum » Question...
Re: Question... [message #466348 is a reply to message #466347] |
Wed, 18 April 2012 20:01 |
|
Whitedragon
Messages: 832 Registered: February 2003 Location: California
Karma:
|
Colonel |
|
|
robbyke wrote on Wed, 18 April 2012 17:55 | i do everything trough scripting
|
I also prefer doing stuff through scripts.
For what you want to do you should create the zone in the level loaded hook.
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.
}
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 - )
[Updated on: Wed, 18 April 2012 20:02] Report message to a moderator
|
|
|
|
|
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: Mon Dec 23 06:08:01 MST 2024
Total time taken to generate the page: 0.01107 seconds
|