Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Random Teleporting
Re: Random Teleporting [message #267796 is a reply to message #267791] Thu, 21 June 2007 11:37 Go to previous messageGo to previous message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma:
General (2 Stars)

Append to z.cpp or use where you want..:

void z_Teleport_Enter_Random_ID::Created(GameObject *obj)
{
	RandomT = Commands->Get_Random_Int(1,4);
	enablemsg = Get_Int_Parameter("EnableMessage");
	disablemsg = Get_Int_Parameter("DisableMessage");
	id1 = Get_Int_Parameter("ID1");
	id2 = Get_Int_Parameter("ID2");
	id3 = Get_Int_Parameter("ID3");
	id4 = Get_Int_Parameter("ID4");
	GotoObject1 = Commands->Find_Object(id1);
	GotoObject2 = Commands->Find_Object(id2);
	GotoObject3 = Commands->Find_Object(id3);
	GotoObject4 = Commands->Find_Object(id4);
	loc1 = Commands->Get_Position(GotoObject1);
	loc2 = Commands->Get_Position(GotoObject2);
	loc3 = Commands->Get_Position(GotoObject3);
	loc4 = Commands->Get_Position(GotoObject4);

	if (Get_Int_Parameter("Start_Enabled"))
	{
		Teleport = true;
	}
	else Teleport = false;
}
void z_Teleport_Enter_Random_ID::Entered(GameObject *obj, GameObject *enter)
{
	team = Commands->Get_Player_Type(enter);
	if (Teleport)
	{
		if (team == Get_Int_Parameter("Team"))
		{
			if (RandomT == 1)
			{
				Commands->Set_Position(enter,loc1);
			}
			if (RandomT == 2)
			{
				Commands->Set_Position(enter,loc2);
			}
			if (RandomT == 3)
			{
				Commands->Set_Position(enter,loc3);
			}
			if (RandomT == 4)
			{
				Commands->Set_Position(enter,loc4);
			}
		}
	}
}
void z_Teleport_Enter_Random_ID::Custom(GameObject *obj, int message, int param, GameObject *sender)
{
	if (message == enablemsg)
	{
		Teleport = true;
	}
	if (message == disablemsg)
	{
		Teleport = false;
	}
}
ScriptRegistrant<z_Teleport_Enter_Random_ID> z_Teleport_Enter_Random_ID_Registrant("z_Teleport_Enter_Random_ID","Team=0:int,Start_Enabled=1:int,EnableMessage=1000:int,DisableMessage=2000:int,ID1=123:int,ID2=123:int,ID3=123:int,ID4=123:int");


Append to z.h or use where you want..:

class z_Teleport_Enter_Random_ID : public ScriptImpClass {
	void Created(GameObject *obj);
	void Entered(GameObject *obj,GameObject *enter);
	void Custom(GameObject *obj,int message,int param,GameObject *sender);
	bool Teleport;
	int RandomT;
	int team;
	int id1;
	int id2;
	int id3;
	int id4;
	int enablemsg;
	int disablemsg;
	GameObject *GotoObject1;
	GameObject *GotoObject2;
	GameObject *GotoObject3;
	GameObject *GotoObject4;
	Vector3 loc1;
	Vector3 loc2;
	Vector3 loc3;
	Vector3 loc4;
};


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Exciting new feature for Renegade's multiplayer
Next Topic: CoOp Question
Goto Forum:
  


Current Time: Sun Dec 22 03:15:17 MST 2024

Total time taken to generate the page: 0.00537 seconds