Home » Renegade Discussions » Mod Forum » Question...
Re: Question... [message #466329 is a reply to message #465856] |
Wed, 18 April 2012 08:18 |
robbyke
Messages: 348 Registered: September 2010 Location: Belgium
Karma:
|
Recruit |
|
|
what am i doing wrong? cause my script wont work
Vector3 Size = Vector3(35.0f,35.0f,500.0f); //Size of the script zone.
Matrix3 Rotation(true);
Rotation.Rotate_Z(Commands->Get_Facing(o)); //Set the rotation of the script zone to the same as the beacon.
Vector3 Pos = Commands->Get_Position(o);
Pos.Z -= 100;//lowering postion of box to make sure to cover whole base
OBBoxClass Box(Pos,Size,Rotation); //Create the bounding box with the position of the beacon, and the size and rotation defined earlier.
GameObject* Zone = Create_Zone("Script_Zone_All",Box);
Attach_Script_Once(Zone,"",Team);
void KB_Base_Zone::Entered(GameObject *obj, GameObject *enterer)
{
int Team = Get_Int_Parameter("Team");
if (Is_Soldier(enterer))
{
StringClass Msg;
if(Team == Commands->Get_Player_Type(enterer))
{
Commands->Set_Is_Visible(obj,false);
Attach_Script_Once(enterer,"KB_Friendly_Zone_Generated","");
Msg.Format("CMSGP %d 0,255,0 You've moved in range of your base, enemy defences will ignore you from here!",Get_Player_ID(obj));
Console_Input(Msg);
}
else
{
Attach_Script_Once(enterer,"KB_Enemy_Zone_Generated","");
Msg.Format("CMSGP %d 255,0,0 You've moved in range of enemy base you can't build active defenses here!",Get_Player_ID(obj));
Console_Input(Msg);
}
}
if (Is_Vehicle(enterer) && Team == Commands->Get_Player_Type(enterer))
{
Set_Vehicle_Is_Visible(obj,false);
}
}
void KB_Base_Zone::Exited(GameObject *obj, GameObject *exiter)
{
StringClass Msg;
if (Is_Soldier(exiter) && Is_Script_Attached(exiter,"KB_Friendly_Zone_Generated"))
{
if(Is_Script_Attached(exiter,"KB_GAP_Generated")||Is_Script_Attached(exiter,"KB_Char_Spy"))
{
Msg.Format("CMSGP %d 255,0,0 You've moved out of your base",Get_Player_ID(exiter));
Remove_Script(exiter,"KB_Friendly_Zone_Generated");
Console_Input(Msg);
}
else
{
Commands->Set_Is_Visible(exiter,true);
Msg.Format("CMSGP %d 255,0,0 You've moved out of your base, enemy defences will automatically attack you from here!",Get_Player_ID(exiter));
Console_Input(Msg);
Remove_Script(exiter,"KB_Friendly_Zone_Generated");
}
}
if (Is_Vehicle(exiter))
{
if(Is_Script_Attached(exiter,"KB_GAP_Generated")||Is_Script_Attached(exiter,"KB_GAP_Generator")){}
else{Set_Vehicle_Is_Visible(exiter,true);}
}
if (Is_Soldier(obj) && Is_Script_Attached(exiter,"KB_Enemy_Zone_Generated") )
{
Msg.Format("CMSGP %d 255,0,0 You've moved out of the enemy base",Get_Player_ID(exiter));
Console_Input(Msg);
Remove_Script(exiter,"KB_Enemy_Zone_Generated");
}
}
ScriptRegistrant<KB_Base_Zone> KB_Base_Zone_Reg("KB_Base_Zone","Team:int");
its supposed to make ppl invisible in their own base
and unable to build stuff in the enemies
but it does nothing at all not even the message does this mean i made a mistake with the zone somewhere?
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: Fri Dec 20 23:31:48 MST 2024
Total time taken to generate the page: 0.00937 seconds
|