Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Base Defense Team Change  () 1 Vote
Base Defense Team Change [message #330814] Fri, 16 May 2008 22:38 Go to next message
_SSnipe_ is currently offline  _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

http://i72.photobucket.com/albums/i172/Tanner2007/ScreenShot50.png
Re: Base Defense Team Change [message #330815 is a reply to message #330814] Fri, 16 May 2008 22:54 Go to previous messageGo to next message
nopol10 is currently offline  nopol10
Messages: 1043
Registered: February 2005
Location: Singapore
Karma: 0
General (1 Star)
Commands->Set_Player_Type(

should work.


nopol10=Nopol=nopol(GSA)

http://i14.photobucket.com/albums/a330/napalmic/siggy.jpg
Re: Base Defense Team Change [message #330818 is a reply to message #330815] Fri, 16 May 2008 23:26 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 #330827 is a reply to message #330814] Sat, 17 May 2008 01:23 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
yes.

Bückstabü!
Re: Base Defense Team Change [message #330828 is a reply to message #330814] Sat, 17 May 2008 01:24 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 Go to previous messageGo to next message
reborn is currently offline  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 #330846 is a reply to message #330814] Sat, 17 May 2008 06:13 Go to previous messageGo to next message
IronWarrior is currently offline  IronWarrior
Messages: 2460
Registered: November 2004
Location: England UK
Karma: 0
General (2 Stars)
Jesus, what the fuck have you done to that map in that image.
Re: Base Defense Team Change [message #330847 is a reply to message #330814] Sat, 17 May 2008 06:18 Go to previous messageGo to next message
Dreganius is currently offline  Dreganius
Messages: 780
Registered: April 2007
Location: Melbourne, Australia
Karma: 0
Colonel
I think the term is "statutory rape".
Rocked Over


http://www.ren40k.net/RenX40kSignature.jpg
Heresy grows from idleness!
Re: Base Defense Team Change [message #330871 is a reply to message #330847] Sat, 17 May 2008 11:50 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
-DM-Karandras wrote on Sat, 17 May 2008 15:18

I think the term is "statutory rape".
Rocked Over

Gunz international FTW


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

Re: Base Defense Team Change [message #330880 is a reply to message #330846] Sat, 17 May 2008 12:24 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 Go to previous messageGo to next message
reborn is currently offline  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 #330906 is a reply to message #330814] Sat, 17 May 2008 15:32 Go to previous messageGo to next message
IronWarrior is currently offline  IronWarrior
Messages: 2460
Registered: November 2004
Location: England UK
Karma: 0
General (2 Stars)
Reminds me of a CSS Zombie map, it's nothing but crates like that all over.
Re: Base Defense Team Change [message #330936 is a reply to message #330906] Sat, 17 May 2008 20:08 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 #330940 is a reply to message #330936] Sat, 17 May 2008 20:24 Go to previous messageGo to next message
IronWarrior is currently offline  IronWarrior
Messages: 2460
Registered: November 2004
Location: England UK
Karma: 0
General (2 Stars)
SSnipe wrote on Sun, 18 May 2008 13:08

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 =/


Yeah I know, when I was messing with LE, I wish there was something other then crates to make "land" or blocks out.
Re: Base Defense Team Change [message #330943 is a reply to message #330814] Sat, 17 May 2008 20:56 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 #330959 is a reply to message #330814] Sun, 18 May 2008 02:47 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
There isn't one afaik, you'll have to make it.


Re: Base Defense Team Change [message #330962 is a reply to message #330959] Sun, 18 May 2008 02:58 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
reborn wrote on Sun, 18 May 2008 02:47

There isn't one afaik, you'll have to make it.

nvm then Smile
Re: Base Defense Team Change [message #330966 is a reply to message #330814] Sun, 18 May 2008 03:11 Go to previous messageGo to next message
reborn is currently offline  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 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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

Smile
Re: Base Defense Team Change [message #330972 is a reply to message #330814] Sun, 18 May 2008 03:26 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
You would have to make one, use the partial name function for the best results ("Get_Part_Name"). Shouldn't be too hard. Smile


Re: Base Defense Team Change [message #330975 is a reply to message #330972] Sun, 18 May 2008 03:29 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
reborn wrote on Sun, 18 May 2008 03:26

You would have to make one, use the partial name function for the best results ("Get_Part_Name"). Shouldn't be too hard. Smile

ok cool and now....dumb question the codes...what files do i put them under?

like
gmscripts or gmmain and what header files Smile
Re: Base Defense Team Change [message #330978 is a reply to message #330814] Sun, 18 May 2008 03:33 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Put all of it in gmmain.cpp, apart from the declaration, which obviously would then go in gmmain.h.


Re: Base Defense Team Change [message #330980 is a reply to message #330978] Sun, 18 May 2008 03:41 Go to previous messageGo to next message
_SSnipe_ is currently offline  _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 Go to previous messageGo to previous message
reborn is currently offline  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);
};



Previous Topic: W3d import error-dsp_shipradar.w3d
Next Topic: [Release]Some skins
Goto Forum:
  


Current Time: Tue May 07 07:08:44 MST 2024

Total time taken to generate the page: 0.01668 seconds