transport files

Discuss the future of Warzone 2100 with us.
Post Reply
User avatar
sttn_ern
Rookie
Rookie
Posts: 16
Joined: 23 May 2019, 18:46
Location: U.S.

transport files

Post by sttn_ern » 05 Apr 2020, 22:47

Hi.
Can someone tell me were the transporter (stats,data,info) files are at?
And the file were the startup power bar amount is at. And is there a way to add a weapon & sensor to the same unit.(like a mortar/sensor together.

Thanks
Attachments
TheMecha.png
TheMecha.png (17.48 KiB) Viewed 874 times
Last edited by sttn_ern on 07 Apr 2020, 03:54, edited 1 time in total.

User avatar
Black Project
Regular
Regular
Posts: 745
Joined: 04 Apr 2008, 20:53

Re: transport files

Post by Black Project » 06 Apr 2020, 20:07

For multiplayer/skirmish component:

- The transporter's templates are located at "stats/templates.json"

At line 2315:

Code: Select all

    "SuperTransport": {
        "available": true,
        "body": "SuperTransportBody",
        "id": "SuperTransport",
        "name": "Super Transport",
        "propulsion": "V-Tol",
        "type": "SUPERTRANSPORTER"
    },
At line 2373:

Code: Select all

    "Transporter": {
        "available": true,
        "body": "TransporterBody",
        "id": "Transporter",
        "name": "Cyborg Transport",
        "propulsion": "V-Tol",
        "type": "TRANSPORTER"
    },
available: Defines availability of the template on manufacture screen. It also relies on components made available to the player via-research.
body: Defines the body used on the template
id: The "id" of the template. It must match the template's first line
propulsion: Defines the propulsion used on the template
name: Name of the template
repair: Defines the repair system used on the template
sensor: Defines the sensor used on the template
type: Defines the template's type.

The components used on the transporter's templates are located at:

- stats/body.json
- stats/propulsion.json

Super Transporter's body at line 799 (body.json):

Code: Select all

    "SuperTransportBody": {
        "armourHeat": 20,
        "armourKinetic": 34,
        "buildPoints": 625,
        "buildPower": 500,
        "class": "Transports",
        "droidType": "TRANSPORTER",
        "hitpoints": 500,
        "id": "SuperTransportBody",
        "model": "drtrans.pie",
        "name": "Super Transport Body",
        "powerOutput": 7525,
        "size": "SUPER HEAVY",
        "weaponSlots": 1,
        "weight": 1850
    },
Cyborg Transporter's body at line 815 (body.json):

Code: Select all

    "TransporterBody": {
        "armourHeat": 9,
        "armourKinetic": 20,
        "buildPoints": 637,
        "buildPower": 325,
        "class": "Transports",
        "droidType": "TRANSPORTER",
        "hitpoints": 200,
        "id": "TransporterBody",
        "model": "drcytran.pie",
        "name": "Transport Body",
        "powerOutput": 2000,
        "size": "MEDIUM",
        "weaponSlots": 1,
        "weight": 250
    },
armourHeat: Amount of damage points absorbed from thermal weapons (lasers, flame-throwers, etc).
armourKinetic: Amount of damage points absorbed from kinetic weapons (cannons, anti-tank rockets/missiles, etc).
buildPoints: Build time. It's multiplied when coupled with a propulsion.
buildPower: Power price. It's multiplied when coupled with a propulsion.
class: ?
droidType: ?
hitpoints: Body's hitpoint. It's multiplied by propulsion.
id: Body's "id". It must match the body's first line.
model: The model that will show up on the unit.
name: Body's name. It must not conflict with the name of other body's name.
powerOutput: Engine's power output.
size: Factory size required to be manufactured. "MEDIUM" requires Medium Factory. "SUPER HEAVY" requires heavy factory.
weaponSlots: How many weapons this body can mount.
weight: Body's weight. It's multiplied by propulsion.

VTOL Propulsion at line 77 (propulsion.json):

Code: Select all

    "V-Tol": {
        "acceleration": 200,
        "buildPoints": 125,
        "buildPower": 150,
        "deceleration": 200,
        "designable": 1,
        "hitpointPctOfBody": 100,
        "id": "V-Tol",
        "model": "DPVTOL.PIE",
        "name": "VTOL",
        "speed": 700,
        "spinSpeed": 200,
        "turnSpeed": 100,
        "type": "Lift",
        "weight": 50
    },
acceleration: How fast the propulsion will increase the unit's speed.
buildPoints: Build time multiplier when coupled with a body. The value of 125 sets the body's build time multiplier to 2.25x.
buildPower: Power price multiplier when coupled with a body. The value of 150 sets the body's power price multiplier to 2.50x.
deceleration: How fast the propulsion will decrease the unit's speed.
designable: Defines availability of the propulsion on design screen.
hitpointPctOfBody: Hitpoint multiplier when coupled with a body. The value of 100 sets the body's hitpoint multiplier to 2.00x.
id: Propulsion's "id". It must match the propulsion's first line.
model: The model that will show up on the design screen (lower middle).
name: Propulsion's name. It must not conflict with the name of other propulsion's name.
speed: The max speed allowed by the propulsion.
spinSpeed: How fast the propulsion will spin the unit.
turnSpeed: How fast the propulsion will turn the unit.
type: Type of propulsion: Lift defines it as a VTOL propulsion.
weight: Weight multiplier when coupled with a body. The value of 50 sets the body's weight multiplier to 1.50x.

You can change the starting power by editing the "rules.json" file at "multiplay\skirmish\", then look for the lines 330, 350 and 369 (setPower(xxxx, playnum)).

Code: Select all

	for (var playnum = 0; playnum < maxPlayers; playnum++)
	{
		enableResearch("R-Sys-Sensor-Turret01", playnum);
		enableResearch("R-Wpn-MG1Mk1", playnum);
		enableResearch("R-Sys-Engineering01", playnum);

		// enable cyborgs components that can't be enabled with research
		makeComponentAvailable("CyborgSpade", playnum);

		if (baseType == CAMP_CLEAN)
		{
			setPower(1300, playnum);
			for (var count = 0; count < numCleanTech; count++)
			{
				completeResearch(techlist[count], playnum);
			}
			// Keep only some structures for insane AI
			var structs = enumStruct(playnum);
			for (var i = 0; i < structs.length; i++)
			{
				var s = structs[i];
				if (playerData[playnum].difficulty != INSANE
				    || (s.stattype != WALL && s.stattype != DEFENSE && s.stattype != GATE
				        && s.stattype != RESOURCE_EXTRACTOR))
				{
					removeObject(s, false);
				}
			}
		}
		else if (baseType == CAMP_BASE)
		{
			setPower(2500, playnum);
			for (var count = 0; count < numBaseTech; count++)
			{
				completeResearch(techlist[count], playnum);
			}
			// Keep only some structures
			var structs = enumStruct(playnum);
			for (var i = 0; i < structs.length; i++)
			{
				var s = structs[i];
				if ((playerData[playnum].difficulty != INSANE && (s.stattype == WALL || s.stattype == DEFENSE))
				    || s.stattype == GATE || s.stattype == CYBORG_FACTORY || s.stattype == COMMAND_CONTROL)
				{
					removeObject(s, false);
				}
			}
		}
		else // CAMP_WALLS
		{
			setPower(2500, playnum);
			for (var count = 0; count < techlist.length; count++)
			{
				completeResearch(techlist[count], playnum);
			}
		}
	}
You can create a template with a long range sensor by adding a new one in the "templates.json" file. Here's an example:

Code: Select all

    "CobraMortarHalfTrackLongRange": {
        "body": "Body5REC",
        "id": "CobraMortarHalfTrackLongRange",
        "name": "Mortar Cobra Half-tracks",
        "propulsion": "HalfTrack",
        "sensor": "NavGunSensor",
        "type": "DROID",
        "weapons": [
            "Mortar1Mk1"
        ]
    },
Note that "NavGunSensor" is the internal sensor used by NEXUS' units in the third campaign.

User avatar
Black Project
Regular
Regular
Posts: 745
Joined: 04 Apr 2008, 20:53

Re: transport files

Post by Black Project » 07 Apr 2020, 00:09

For singleplayer/campaign component:

To adjust the power given to the player for each campaign start, edit the following files:
  • script\campaign\cam1a.js
  • script\campaign\cam2-a.js
  • script\campaign\cam3-a.js
At lines 130, 141, 145 and 149 (cam1a.js):

Code: Select all

	const PLAYER_POWER = 1300; // value for starting power given to player
	var startpos = getObject("startPosition");
	var lz = getObject("landingZone");

	camSetStandardWinLossConditions(CAM_VICTORY_STANDARD, "CAM_1B");

	centreView(startpos.x, startpos.y);
	setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);

	if (difficulty === HARD) // sets the starting power on hard difficulty
	{
		setPower(600, CAM_HUMAN_PLAYER);
	}
	else if (difficulty === INSANE) // sets the starting power on insane difficulty
	{
		setPower(300, CAM_HUMAN_PLAYER); 
	}
	 else// sets the starting power on easy/medium difficulty
	{
		setPower(PLAYER_POWER, CAM_HUMAN_PLAYER);
	}
At lines 296 and 319 (cam2-a.js):

Code: Select all

	const PLAYER_POWER = 5000; // value for starting power given to player
	var startpos = getObject("startPosition");
	var lz = getObject("landingZone"); //player lz
	var enemyLz = getObject("COLandingZone");
	var tent = getObject("transporterEntry");
	var text = getObject("transporterExit");

	camSetStandardWinLossConditions(CAM_VICTORY_STANDARD, "SUB_2_1S");
	setReinforcementTime(LZ_COMPROMISED_TIME);

	centreView(startpos.x, startpos.y);
	setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
	setNoGoArea(enemyLz.x, enemyLz.y, enemyLz.x2, enemyLz.y2, THE_COLLECTIVE);
	startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
	setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);

	camSetArtifacts({
		"COCommandCenter": { tech: "R-Sys-Engineering02" },
		"COArtiPillbox": { tech: "R-Wpn-MG-ROF02" },
		"COArtiCBTower": { tech: "R-Sys-Sensor-Upgrade01" },
	});

	setMissionTime(camChangeOnDiff(camHoursToSeconds(1)));
	setPower(PLAYER_POWER, CAM_HUMAN_PLAYER); // sets the starting power on any difficulty
	cam2Setup();
At lines 210 and 232 (cam3-a.js):

Code: Select all

	const PLAYER_POWER = 16000; // value for starting power given to player
	var startpos = getObject("startPosition");
	var lz = getObject("landingZone");
	var tent = getObject("transporterEntry");
	var text = getObject("transporterExit");

	camSetStandardWinLossConditions(CAM_VICTORY_STANDARD, "SUB_3_1S");
	setMissionTime(camChangeOnDiff(camHoursToSeconds(2)));

	centreView(startpos.x, startpos.y);
	setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
	startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
	setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);

	var enemyLz = getObject("NXlandingZone");
	setNoGoArea(enemyLz.x, enemyLz.y, enemyLz.x2, enemyLz.y2, NEXUS);

	camSetArtifacts({
		"NXPowerGenArti": { tech: "R-Struc-Power-Upgrade02" },
		"NXResearchLabArti": { tech: "R-Sys-Engineering03" },
	});

	setPower(PLAYER_POWER, CAM_HUMAN_PLAYER); // sets the starting power on any difficulty
	cam3Setup();
You can make the game stop from compromising your landing zone (LZ) every time the enemy gets close by editing the "victory.js" file. It's located at "script/campaign/libcampaign_includes".

At line 367:

Code: Select all

	if (enumArea(lz, ENEMIES, false).length > 0) // Change the value to any number higher than 0 to stop the LZ from getting compromised
	{
		const REMIND_COMPROMISED = 30; // every X seconds
		if (__camLZCompromisedTicker === 0)
		{
			camTrace("LZ compromised");
		}
		if (__camLZCompromisedTicker % REMIND_COMPROMISED === 1)
		{
			var pos = camMakePos(lz);
			playSound("pcv445.ogg", pos.x, pos.y, 0);
			setReinforcementTime(LZ_COMPROMISED_TIME);
		}
		++__camLZCompromisedTicker;
		if (__camRTLZTicker === 0)
		{
			camMarkTiles(lz);
		}
	}

Post Reply