Home » Renegade Discussions » Mod Forum » Base Defense Team Change
() 1 Vote
Base Defense Team Change [message #330814] |
Fri, 16 May 2008 22:38 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
Is there a script to change the team on a base defense when doing a command
what i mean is when i do this command it spawns a turrent and gt
when im on gdi the turrent attacks me and gt attacks me when im on nod....so question is....is there a script that can change what team a gt or turrent attack when i do the command? i whould edit the objects file but theres only one nod_turren_desc_impoverd or something like that if you look in the ss i spawn those 2 things but im on gdi and the turrent's attack me
|
|
|
|
Re: Base Defense Team Change [message #330818 is a reply to message #330815] |
Fri, 16 May 2008 23:26 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
nopol10 wrote on Fri, 16 May 2008 22:54 | Commands->Set_Player_Type(
should work.
|
gdi=
Commands->Set_Player_Type(1);
nod
Commands->Set_Player_Type(0);
look about right?
|
|
|
Re: Base Defense Team Change [message #330819 is a reply to message #330818] |
Fri, 16 May 2008 23:34 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
SSnipe wrote on Fri, 16 May 2008 23:26 |
nopol10 wrote on Fri, 16 May 2008 22:54 | Commands->Set_Player_Type(
should work.
|
gdi=
Commands->Set_Player_Type(1);
nod
Commands->Set_Player_Type(0);
look about right?
|
wait nvm cuase see i have it so any team can do the command gdi and nod.....and need to be able to change what team they defences attack depending on hwo does the command.....aka
if im on gdi and type !test they pop up and turrents wont shot me only nod
and if im on nod and type !test tht guard towers and turrents shoot gdi players not me (nod)
will this work? cant test it right now but do you guys think it could work?
class test3ChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
Vector3 Pos = Commands->Get_Position(obj);
Pos.Z += 5.471f,Pos.Y += -6.268f,Pos.X += -2.795f;
GameObject *ct = Commands->Create_Object("GDI_Guard_Tower",Pos);
Commands->Set_Facing(ct,Pos.Z += -90.0f);
if (Get_Object_Type(obj) == 0) {
Commands->Set_Player_Type(ct,1);
}
else {
Commands->Set_Player_Type(ct,0);
}
}
};
ChatCommandRegistrant<test3ChatCommand> test3ChatCommandReg("!test3",CHATTYPE_ALL,0,GAMEMODE_ALL);
[Updated on: Fri, 16 May 2008 23:45] Report message to a moderator
|
|
|
|
Re: Base Defense Team Change [message #330828 is a reply to message #330814] |
Sat, 17 May 2008 01:24 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
ok it does work but having it mulitplie times in one code only works for the FIRST one how can i fix it? you want me to post code?
|
|
|
Re: Base Defense Team Change [message #330833 is a reply to message #330814] |
Sat, 17 May 2008 02:21 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
class test3ChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
int team;
team = Commands->Get_Player_Type(obj);
Vector3 Pos = Commands->Get_Position(obj);
Pos.Z += 5.471f,Pos.Y += -6.268f,Pos.X += -2.795f;
GameObject *ct = Commands->Create_Object("GDI_Guard_Tower",Pos);
Commands->Set_Facing(ct,Pos.Z += -90.0f);
Commands->Set_Player_Type(ct,team);
}
};
ChatCommandRegistrant<test3ChatCommand> test3ChatCommandReg("!test3",CHATTYPE_ALL,0,GAMEMODE_ALL);
This code will make the Guard Tower teamed to whatever team the person is that is typing the command.
I do not understand your last question. :-/
|
|
|
|
|
|
Re: Base Defense Team Change [message #330880 is a reply to message #330846] |
Sat, 17 May 2008 12:24 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
IronWarrior wrote on Sat, 17 May 2008 06:13 | Jesus, what the fuck have you done to that map in that image.
|
i needed a floor....to be one level...i make like a maze and base of those big block things....use them for walls and roof and floor...like i said a maze type thing but i need a even floor
|
|
|
Re: Base Defense Team Change [message #330902 is a reply to message #330814] |
Sat, 17 May 2008 15:06 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Honestly man, that many objects controlled by the server will cause serious warp and lag for the players. The more players the worse the lag will be.
Like seriously dude, it'll be bad.
|
|
|
|
Re: Base Defense Team Change [message #330936 is a reply to message #330906] |
Sat, 17 May 2008 20:08 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
IronWarrior wrote on Sat, 17 May 2008 15:32 | Reminds me of a CSS Zombie map, it's nothing but crates like that all over.
|
i wish they had other things besides crates =/
|
|
|
|
Re: Base Defense Team Change [message #330943 is a reply to message #330814] |
Sat, 17 May 2008 20:56 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
i dont want to make a new post....but where can i find a teleport script so as soon as someone goes into a zone it gets teleported to 3 points and it randomly chooses which of the three or more spots
|
|
|
|
|
Re: Base Defense Team Change [message #330966 is a reply to message #330814] |
Sun, 18 May 2008 03:11 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
void RequestSpawn(GameObject *obj) {
int RandomSpawn = Commands->Get_Random_Int(1,33);
Vector3 NewPos;
Spawn:
if (strcmp(The_Game()->MapName, "C&C_Under.mix") == 0) {
if (RandomSpawn == 1 && Spawn1OK == true) {
Spawn1OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 2 && Spawn2OK == true) {
Spawn2OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 3 && Spawn3OK == true) {
Spawn3OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
GameObject *Refresh;
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
char param[5];
sprintf(param,"%d",RandomSpawn);
Commands->Attach_Script(Refresh,"KAK_DM_Refresh_Spawn",param);
Commands->Set_Position(obj,NewPos);
}
else if (strcmp(The_Game()->MapName, "C&C_someothermap.mix") == 0) {
if (RandomSpawn == 1 && Spawn1OK == true) {
Spawn1OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 2 && Spawn2OK == true) {
Spawn2OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 3 && Spawn3OK == true) {
Spawn3OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
GameObject *Refresh;
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
char param[5];
sprintf(param,"%d",RandomSpawn);
Commands->Attach_Script(Refresh,"KAK_DM_Refresh_Spawn",param);
Commands->Set_Position(obj,NewPos);
}
}
void KAK_DM_Refresh_Spawn::Created(GameObject *obj) {
Commands->Start_Timer(obj,this,5.0f,Get_Int_Parameter("SpawnNum"));
}
void KAK_DM_Refresh_Spawn::Timer_Expired(GameObject *obj, int number) {
if (number == 1) Spawn1OK = true;
else if (number == 2) Spawn2OK = true;
else if (number == 3) Spawn3OK = true;
Commands->Destroy_Object(obj);
}
class KAK_DM_Refresh_Spawn : public ScriptImpClass {
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
};
ScriptRegistrant<KAK_DM_Refresh_Spawn> KAK_DM_Refresh_Spawn_Registrant("KAK_DM_Refresh_Spawn","SpawnNum=0:int");
class teleChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
RequestSpawn(obj);
}
};
ChatCommandRegistrant<teleChatCommand> teleChatCommandReg("!tele",CHATTYPE_ALL,0,GAMEMODE_ALL);
You will need to change the places it can spawn to, instead of 0,0,0, you can get these values from level edit, but I prefer to walk around ingame and decide for myself, when making allot I find it's quicker anyway...
Use this chat hook to get the precise floating point values for where you're standing (also gives some other info too, but don't worry about that).
class infoChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
const char *preset = Commands->Get_Preset_Name(obj);
const char *model = Get_Model(obj);
const char *weapon = Get_Current_Weapon(obj);
const char *shield = Get_Shield_Type(obj);
const char *skin = Get_Skin(obj);
Vector3 CurPosition = Commands->Get_Position(obj);
Console_Input(StrFormat("msg Character preset name is: %s",preset).c_str());
Console_Input(StrFormat("msg Character model name is: %s",model).c_str());
Console_Input(StrFormat("msg The preset name of the weapon is: %s",weapon).c_str());
Console_Input(StrFormat("msg The shield type is: %s",shield).c_str());
Console_Input(StrFormat("msg The skin type is: %s",skin).c_str());
Console_Input(StrFormat("msg NewPos.X = %ff;",CurPosition.X).c_str());
Console_Input(StrFormat("msg NewPos.Y = %ff;",CurPosition.Y).c_str());
Console_Input(StrFormat("msg NewPos.Z = %ff;",CurPosition.Z).c_str());
}
};
ChatCommandRegistrant<infoChatCommand> infoChatCommandReg("!info",CHATTYPE_TEAM,0,GAMEMODE_ALL);
That should make you spawn in any three random places based on whatever map you're on. You can easily extend it for as many maps as needed.
|
|
|
Re: Base Defense Team Change [message #330971 is a reply to message #330966] |
Sun, 18 May 2008 03:16 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
reborn wrote on Sun, 18 May 2008 03:11 |
void RequestSpawn(GameObject *obj) {
int RandomSpawn = Commands->Get_Random_Int(1,33);
Vector3 NewPos;
Spawn:
if (strcmp(The_Game()->MapName, "C&C_Under.mix") == 0) {
if (RandomSpawn == 1 && Spawn1OK == true) {
Spawn1OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 2 && Spawn2OK == true) {
Spawn2OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 3 && Spawn3OK == true) {
Spawn3OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
GameObject *Refresh;
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
char param[5];
sprintf(param,"%d",RandomSpawn);
Commands->Attach_Script(Refresh,"KAK_DM_Refresh_Spawn",param);
Commands->Set_Position(obj,NewPos);
}
else if (strcmp(The_Game()->MapName, "C&C_someothermap.mix") == 0) {
if (RandomSpawn == 1 && Spawn1OK == true) {
Spawn1OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 2 && Spawn2OK == true) {
Spawn2OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
else if (RandomSpawn == 3 && Spawn3OK == true) {
Spawn3OK = false;
NewPos.X = 0.0f;
NewPos.Y = 0.0f;
NewPos.Z = 0.0f;
}
GameObject *Refresh;
Refresh = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
char param[5];
sprintf(param,"%d",RandomSpawn);
Commands->Attach_Script(Refresh,"KAK_DM_Refresh_Spawn",param);
Commands->Set_Position(obj,NewPos);
}
}
void KAK_DM_Refresh_Spawn::Created(GameObject *obj) {
Commands->Start_Timer(obj,this,5.0f,Get_Int_Parameter("SpawnNum"));
}
void KAK_DM_Refresh_Spawn::Timer_Expired(GameObject *obj, int number) {
if (number == 1) Spawn1OK = true;
else if (number == 2) Spawn2OK = true;
else if (number == 3) Spawn3OK = true;
Commands->Destroy_Object(obj);
}
class KAK_DM_Refresh_Spawn : public ScriptImpClass {
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
};
ScriptRegistrant<KAK_DM_Refresh_Spawn> KAK_DM_Refresh_Spawn_Registrant("KAK_DM_Refresh_Spawn","SpawnNum=0:int");
class teleChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
RequestSpawn(obj);
}
};
ChatCommandRegistrant<teleChatCommand> teleChatCommandReg("!tele",CHATTYPE_ALL,0,GAMEMODE_ALL);
You will need to change the places it can spawn to, instead of 0,0,0, you can get these values from level edit, but I prefer to walk around ingame and decide for myself, when making allot I find it's quicker anyway...
Use this chat hook to get the precise floating point values for where you're standing (also gives some other info too, but don't worry about that).
class infoChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
const char *preset = Commands->Get_Preset_Name(obj);
const char *model = Get_Model(obj);
const char *weapon = Get_Current_Weapon(obj);
const char *shield = Get_Shield_Type(obj);
const char *skin = Get_Skin(obj);
Vector3 CurPosition = Commands->Get_Position(obj);
Console_Input(StrFormat("msg Character preset name is: %s",preset).c_str());
Console_Input(StrFormat("msg Character model name is: %s",model).c_str());
Console_Input(StrFormat("msg The preset name of the weapon is: %s",weapon).c_str());
Console_Input(StrFormat("msg The shield type is: %s",shield).c_str());
Console_Input(StrFormat("msg The skin type is: %s",skin).c_str());
Console_Input(StrFormat("msg NewPos.X = %ff;",CurPosition.X).c_str());
Console_Input(StrFormat("msg NewPos.Y = %ff;",CurPosition.Y).c_str());
Console_Input(StrFormat("msg NewPos.Z = %ff;",CurPosition.Z).c_str());
}
};
ChatCommandRegistrant<infoChatCommand> infoChatCommandReg("!info",CHATTYPE_TEAM,0,GAMEMODE_ALL);
That should make you spawn in any three random places based on whatever map you're on. You can easily extend it for as many maps as needed.
|
wow ty whats the command line so i can be able to use the command ON a player...or on myself like
!tele ren00b
|
|
|
|
|
|
Re: Base Defense Team Change [message #330980 is a reply to message #330978] |
Sun, 18 May 2008 03:41 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
reborn wrote on Sun, 18 May 2008 03:33 | Put all of it in gmmain.cpp, apart from the declaration, which obviously would then go in gmmain.h.
|
ah which ones that one lol
|
|
|
Re: Base Defense Team Change [message #330982 is a reply to message #330814] |
Sun, 18 May 2008 04:14 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
class KAK_DM_Refresh_Spawn : public ScriptImpClass {
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
};
|
|
|
Goto Forum:
Current Time: Sat Jan 25 11:54:54 MST 2025
Total time taken to generate the page: 0.01177 seconds
|