Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Random Teleporting
Random Teleporting [message #267791] Thu, 21 June 2007 11:16 Go to next message
Brandon is currently offline  Brandon
Messages: 282
Registered: August 2006
Location: United States
Karma: 0
Recruit
Okay, so I was told you could make numerous powerups and give it the Teleport_On_Pickup script and set it up differently every time for random teleporting. This seems pretty easy to setup but I have one question, can I Add powerups to the list or do I have to do like Ai Bots and just Mod existing presets to my liking? If I have to Mod, then when I make different modifications to the presets for different levels do I just put the C&C_mapname.ddb (rename to .gm) in the Server/data folder and it'll work when that level loads? Because I want certain settings to apply only on certain levels etc.
Re: Random Teleporting [message #267796 is a reply to message #267791] Thu, 21 June 2007 11:37 Go to previous messageGo to next message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma: 0
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
Re: Random Teleporting [message #267797 is a reply to message #267791] Thu, 21 June 2007 11:41 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)
SSGM has the same capabilities as SSAOW 1.5 did with regards to loading specific object files specifically on a per map basis. You just need to declare this in the ssgm.ini file.
So make all your preset mods for each map, and save say the one for volcano as objects.vol, then in the ssgm.ini file under [C&C_Volcano.mix] declare "ObjectsFile=vol". This will load that specific objects file with your mods for that map.



Re: Random Teleporting [message #267799 is a reply to message #267797] Thu, 21 June 2007 11:47 Go to previous messageGo to next message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma: 0
General (2 Stars)

edit:
Quote:

Reborn in other topic:
SSGM has not modified the objects file from SSAOW 1.5 in anyway other then removing some scripts that where not needed.
Meaning that you can just use your objects file from SSAOW 1.5 and just rename it to objects.gm without breaking any features from SSGM. This is incredibly helpful in my opinion. =]



https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png

[Updated on: Thu, 21 June 2007 11:49]

Report message to a moderator

Re: Random Teleporting [message #267801 is a reply to message #267791] Thu, 21 June 2007 11:50 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)
That was one of the first things I asked, luckily for everyone WhiteDragon hooked all the scripts tot he presets via the scripts.dll itself rather then updating the objects file. He can rename the objects.aow file from his ssaow 1.5 mod to objects.gm with no ill effect at all. It won't break anything. =]


You bugger you changed your post Razz



[Updated on: Thu, 21 June 2007 11:50]

Report message to a moderator

Re: Random Teleporting [message #268433 is a reply to message #267791] Sat, 23 June 2007 14:54 Go to previous message
Brandon is currently offline  Brandon
Messages: 282
Registered: August 2006
Location: United States
Karma: 0
Recruit
Umm... so I add that stuff to those files by opening the files in notepad? Is there anything that needs to be editted by me in that? How will this work?
Previous Topic: Exciting new feature for Renegade's multiplayer
Next Topic: CoOp Question
Goto Forum:
  


Current Time: Sun Dec 22 03:00:59 MST 2024

Total time taken to generate the page: 0.00785 seconds