Jump to content

WIP - Renegade X Sandbox mode


Handepsilon
 Share

Recommended Posts

  • Developer

I have discovered that while using Enable Cheats command allow you to summon things in multiplayer, it only summons client-side, and no one else would be able to see or be affected by it, and not even you btw. So I invented this thing that replicate the Summon and GiveWeapons command, EXCEPT NOW IT WORKS IN SERVER :D

https://drive.google.com/file/d/0B6yEH_ ... sp=sharing

Summon is replaced into SandboxSpawn, while GiveWeapons is replaced by Gimme. The syntax is the same. This little gametype will turn your Renegade X server into a sandbox mode, all you need to do is put the file into this directory

[your Renx directory]/UDKGame/CookedPC/

Then put these parameters in the server Target box in the properties

?game=Rx_Sandbox_Game.Rx_Sandbox

In my test, the server manages to spawn in the actors server and client-side. The server gives collision and damages and allows you to drive the summoned vehicles. Weapons also works well. They're actually summoned to your inventory

Warning : Your buildings can still be destroyed. The internal modifier is still WIP and the included mutator doesn't work as of now. There is also no way to delete your summoned objects. Do not overdo it :P

Link to comment
Share on other sites

  • 2 months later...
  • Developer

Do I have to? Ok

SANDBOX SPAWN SECTION

Everything always starts with pressing F5 and typing : "sandboxspawn renx_game."

Renegade X Vanilla vehicle

Prefix : "Rx_Vehicle_"

Humvee

Buggy

APC_GDI

APC_Nod

LightTank

MediumTank

FlameTank

StealthTank

MammothTank

Chinook_GDI

Chinook_Nod

Orca

Apache

A10

C130

Hovercraft_GDI

Tiberian Sun Vehicles

Prefix : "TS_Vehicle_"

Wolverine

HoverMRLS

Titan

Buggy

ReconBike

TickTank

Misc

APB_Vehicle_TeslaTank

Deployables

Prefix : "Rx_Weapon_Deployed"

ProxyC4

RemoteC4

TimedC4

ATMine

IonCannonBeacon

NukeBeacon

ALSO (not following Prefix)

Rx_Weapon_CrateNuke (faster NukeBeacon)

Defence

Rx_Defence_

GunEmplacement (not mannable)

RocketEmplacement (not mannable)

Turret (Nod aligned)

SAM Site (Nod aligned)

GuardTower (GDI aligned)

AATower (GDI aligned)

Projectiles (not all of them is useful)

Rx_Projectile_

Grenade

MissileLauncher

SmokeGrenade

EMPGrenade

Rocket_AGT

and much more....

WEAPON ACQUIRING SECTION

Everything always starts with pressing F5 and typing : "gimme renx_game.Rx_Weapon_"

AutoRifle_GDI

AutoRifle_Nod

Airstrike_GDI

Airstrike_Nod

ATMine

Carbine

ChemicalThrower

VoltAutoRifle_GDI

VoltAutoRifle_Nod

FlameThrower

PersonalIonCannon

Railgun

RamjetRifle

SniperRifle_GDI

SniperRifle_Nod

LaserRifle

LaserChaingun

RepairTool

RepairGun

RepairGunAdvanced

ProxyC4

TiberiumAutoRifle

TiberiumFlechetteRifle

NukeBeacon

IonCannonBeacon

MarksmanRifle_GDI

MarksmanRifle_Nod

SMG_GDI

SMG_Nod

Chaingun_GDI

Chaingun_Nod

and much more....

There are a lot more class you can get/summon. There are too many to mention however

Link to comment
Share on other sites

  • 9 months later...
  • 2 months later...

Do you mind to update this? It's currently telling us that the version is out of date if I run the server with this mutator.

 

Edit: nvm, edited the config file and updated the version that way.

Edit2: Nope can't get the server to show on serverlist. Please come online so we can look at this @Handepsilon

Link to comment
Share on other sites

  • Developer

You mean this line?

Quote

GameVersion=Open Beta 5.003
GameVersionNumber=5003

Try to delete those lines, or better yet, try removing UDKRxSandbox.ini altogether.

It was my attempt to limit the items able to be spawned so it's not going to crash the server by spammed items

Link to comment
Share on other sites

  • Developer

I'm pretty sure there should be nothing in the game info that will prevent it unless there's some structural class changes that I am not aware of. These should be the only relevant classes in the mod

Rx_Sandbox.uc

Spoiler

/**
 * Rx_Sandbox
 *
 * */
class Rx_Sandbox extends Rx_Game
	config(RxSandbox);

var config int ActorSpawnLimit;

var bool bSandbox;


function ToggleSandboxMode()
{
	bSandbox = !bSandbox;
	
}

DefaultProperties
{	
	PlayerControllerClass	   = class'Rx_Controller_Sandbox'

}

 

Rx_Controller_Sandbox

Spoiler
class Rx_Controller_Sandbox extends Rx_Controller;

var array<Actor> SpawnedActors;
var bool bSpawnDisabled;
var int HelpedTier;

exec function SandboxHelp()
{
	if(HelpedTier == 0)
	{
		HelpUpSandbox();
	}
	
}

simulated function HelpUpSandbox()
{
	switch (HelpedTier)
	{
		case 0:
		ClientMessage("The Sandbox command occurs if you open the console, and type 'SandboxSpawn' or 'Gimme' and input the class of the object");
		ClientMessage("Gimme will give you weapons. SandboxSpawn summons an object of your choice");
		ClientMessage("Before you do so, however, please turn on sandbox mode with vote system");
		break;

		case 1:
		ClientMessage("Normal Vehicle is spawned by following SandboxSpawn with 'Renx_Game.Rx_Vehicle_' and type the vehicle name");
		ClientMessage("List : Humvee, Buggy, APC_GDI. APC_Nod, MediumTank, LightTank, FlameTank, StealthTank, MammothTank, MRLS, Artillery");
		ClientMessage("List : Chinook_GDI, Chinook_Nod, Orca, Apache, Hovercraft_GDI, A10, C130");
		break;

		case 2:
		ClientMessage("TibSun Vehicle is spawned by following SandboxSpawn with 'Renx_Game.TS_Vehicle_' and type the vehicle name with no space");
		ClientMessage("List : HoverMRLS, Buggy, Wolverine, Titan, ReconBike, TickTank");
		break;

		case 3:
		ClientMessage("Tesla tank is spawned by following SandboxSpawn with 'Renx_Game.APB_Vehicle_TeslaTank'");
		break;

		case 4:
		ClientMessage("Weapon is given by following 'Gimme' with 'Renx_Game.Rx_Weapon_' and type the weapon name");
		ClientMessage("Example : RepairGunAdvanced, LaserGun, RamjetRifle, SniperRifle_GDI, AutoRifle_GDI, VoltAutoRifle_Nod, MarksmanRifle_Nod");
		break;

		case 5:
		ClientMessage("Beacon, C4 and other deployables can be placed by typing 'Renx_Game.Rx_Weapon_Deployable_' with the following");
		ClientMessage("List : ProxyC4, TimedC4, NukeBeacon, IonCannonBeacon");
		ClientMessage("Frag Grenades can also be spawned by typing 'Renx_Game.Rx_Projectile_Grenade'. Other types are available as well");
		break;

		case 6:
		ClientMessage("Example : To spawn A10, type 'sandboxspawn Renx_Game.Rx_vehicle_A10");
		break;

		case 7:
		ClientMessage("More info can be obtained from other player or Handepsilon himself. Thank you for using Sandbox Mod");
		break;
	}
	
	HelpedTier = HelpedTier + 1;
	if(HelpedTier <= 7)
	settimer(5,false,'HelpUpSandbox');
	else
	HelpedTier = 0;
}

exec function SandboxSpawn ( string ClassName )
{
/*	local int i;

	for(i = 0; i<SpawnedActors.length; i++)
	{
		if(SpawnedActors[i] == None)
		SpawnedActors.remove(i, 1);
	}
*/

	if (!Rx_Sandbox(WorldInfo.Game).bSandbox)
	{
		ClientMessage("Game is not currently in Sandbox mode. Please activate it with the voting system");
	}

	else if (bSpawnDisabled)
	{
		
		ClientMessage("You need to wait 2 seconds between spawning");
	}
	else
	{
		bSpawnDisabled = true;
		SetTimer(2.0, false, 'ReEnableSpawn');
		ServerSandboxSpawn(ClassName);	
	}
}

simulated function ReEnableSpawn()
{
	bSpawnDisabled = false;
}

exec function SandboxKillOwned(optional string ClassName)
{
	ServerSandboxKillOwned(ClassName);
}

reliable server function ServerSandboxKillOwned(optional string ClassName)
{
	local Actor A;

	foreach SpawnedActors(A)
	{
		if(ClassName == "")
		A.Destroy();
		else if(A.IsA(name(ClassName)))
		A.Destroy();
	}


}

reliable server function ServerSandboxSpawn (string ClassName)
{
	local class<actor> NewClass;
	local vector SpawnLoc;
	local Actor A;
	local bool bBeaconExist;
	local int i;

	NewClass = class<actor>( DynamicLoadObject( ClassName, class'Class' ) );
	if( NewClass!=None )
	{
		if(NewClass == class'Renx_Game.Rx_weapon_DeployedBeacon')
		{
			for(i = 0;i < SpawnedActors.Length;i++)
			{
				if(SpawnedActors[i].IsA('Rx_Weapon_DeployedBeacon'))
				bBeaconExist = true;
			}
			if(bBeaconExist)
			{
				ClientMessage("Spawning Beacon Failed! You already have a beacon spawned");
				return;
			}
			
		}
		if ( Pawn != None )
			SpawnLoc = Pawn.Location;
		else
			SpawnLoc = Location;
		A = Spawn( NewClass,self,,SpawnLoc + 72 * Vector(Rotation) + vect(0,0,1) * 15 );
		SpawnedActors.additem(A);
		if(A.IsA('Rx_Weapon_DeployedActor'))
		{
			Rx_Weapon_DeployedActor(A).InstigatorController = self;
			Rx_Weapon_DeployedActor(A).TeamNum = GetTeamNum();	
		}
		else if(A.IsA('UTVehicle'))
		{
			UTVehicle(A).SetTeamNum(GetTeamNum());
		}
	}
}
exec function Feign()
{
	UTPawn(Pawn).FeignDeath();
}

exec function Gimme(string Weapon)
{
	ServerGimme(Weapon);
}

reliable server function Weapon ServerGimme( String WeaponClassStr )
{
	local Weapon		Weap;
	local class<Weapon> WeaponClass;

	WeaponClass = class<Weapon>(DynamicLoadObject(WeaponClassStr, class'Class'));
	Weap		= Weapon(Pawn.FindInventoryType(WeaponClass));
	if( Weap != None )
	{
		return Weap;
	}
	return Weapon(Pawn.CreateInventory( WeaponClass ));
}

 

And that's it. That's all there is to it

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 weeks later...
  • Developer
13 hours ago, Ruud033 said:

@Handepsilon can you please bug-hunt this mutator? I can't find the issue on this. When ever I boot a server it will not connect to the bot.

Could you setup your own server running with this mutator and then make it appear on the server list?

I can't even update the game AND the SDK yet, let alone host a server

Are you sure this is my mutator and not the bot's problem? If it helps, I can use a sample of a custom game mode extended from original game mode that still allows the bot to connect to the game.

EDIT : Actually, since I'm not in access of my laptop atm, try copy pasting my script, and remove from the Rx_Sandbox.uc :

	config(RxSandbox);

var config int ActorSpawnLimit;

These lines currently does nothing. The Spawn command is in 2 seconds interval so it should be ok.

Link to comment
Share on other sites

  • 1 month later...

I've moved some of the code In the file Rx_Controller_Sandbox.
Now the server is listed in the RenX game launcher list, and the SandboxSpawn is working.

Files (Download section)

Code before :

Spoiler
	if (!RenX_Sandbox(WorldInfo.Game).bSandbox)
	{
		bSpawnDisabled = true;
		SetTimer(2.0, false, 'ReEnableSpawn');
		ServerSandboxSpawn(ClassName);	
	}
	else if (bSpawnDisabled)
	{
		ClientMessage("You need to wait 2 seconds between spawning");
	}
	else
	{
		ClientMessage("Game is not currently in Sandbox mode. Please activate it with the voting system");
	}
}

 

Code after :

Spoiler
	if (!RenX_Sandbox(WorldInfo.Game).bSandbox)
	{
		ClientMessage("Game is not currently in Sandbox mode. Please activate it with the voting system");
	}
	else if (bSpawnDisabled)
	{
		ClientMessage("You need to wait 2 seconds between spawning");
	}
	else
	{
		bSpawnDisabled = true;
		SetTimer(2.0, false, 'ReEnableSpawn');
		ServerSandboxSpawn(ClassName);	
	}
}

 

 

Edited by ukilleddanny
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...