Setting Campaign map's size via mod

Discuss the future of Warzone 2100 with us.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Setting Campaign map's size via mod

Post by DylanDog »

The way the Alpha campaign works (the only one I have played) is that they show only pieces of the main map in the various missions.

I am working on a campaign mod and I have not been able to find out where this is set on the script files.I think this is something pre-configured in warzone code.

IF I am right (if not please advise where these values are set), would it be possible to add mod support which allow to set the size of the map on the slo-vlo files?

Example on 128x128 tiles map

Mission one to be played on 0,0 - 64,64
Mssion 2 on 0,0 128,128
Mission 3 on 64,64 128,128
Mission 4 on the whole map.

This is just an example, ideally the mod support should allow to set the necessary variables to make this happen, an example for the above mentioned Mission 3 could be:

any.VLO file:

Code: Select all

setMapStartX int 64
setMapStartY int 64
setMapEndX int 128
setMapEndY int 128
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
Mysteryem
Global Moderator
Global Moderator
Posts: 728
Joined: 22 Sep 2008, 19:44
Location: UK

Re: Setting Campaign map's size via mod

Post by Mysteryem »

I always thought it was done by using scroll limits, but I've never really had a look into how it's done. If so, I'm guessing the scroll limits are changed for each map segment.
"...If pure awesomeness were bricks, this would be the Great Wall of China...
The glory of this has collapsed on its self so far, that even the neutrons have collapsed."
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Setting Campaign map's size via mod

Post by Rman Virgil »

.

It definitely is done by Scroll Limits

I never modified the original campaign but I did create a handful of brand New Missions a long time past that I designed to run out of MP Mode and I did use scroll limits to only expose a part of the map and I did it in the .SLO

Here a snippet of my working .slo script:

Code: Select all

public	STRUCTURESTAT	factory, research, oilDerrick, powerGen,LasSat,SatLink,command,sybFact;
public		TEMPLATE		tmpl;

event startEvnt(CALL_GAMEINIT)
{
	setScrollMinX(185);
	setScrollMinY(185);
	setScrollMaxX(249);
	setScrollMaxY(249);

	//player units
	addDroid(tmpl, (198*128), (192*128), 0);
	addDroid(tmpl, (198*128), (193*128), 0);
	addDroid(tmpl, (198*128), (194*128), 0);
	addDroid(tmpl, (199*128), (192*128), 0);
	addDroid(tmpl, (200*128), (192*128), 0);
	addDroid(tmpl, (200*128), (193*128), 0);
	addDroid(tmpl, (200*128), (194*128), 0);
	addDroid(tmpl, (199*128), (194*128), 0);

	addStructure(command, 0, (203*128), (195*128) );

	//enemy bases
	addStructure(sybFact, 1, (187*128), (237*128) );
	addStructure(sybFact, 1, (229*128), (219*128) );

	addStructure(oilDerrick, 1, (186*128), (235*128) );
	addStructure(oilDerrick, 1, (225*128), (218*128) );

	addStructure(factory, 1, (190*128), (235*128) );
	addStructure(powerGen, 1, (226*128), (221*128) );

	addStructure(research, 1, (185*128), (239*128) );

	addStructure(command, 1, (166*128), (184*128) ); //third location
	setEventTrigger(startEvnt, inactive);
}

event revealSection2(every,40)
{
	if(not structInArea(1, (185*128), (185*128), (249*128), (249*128)))
	{
		setScrollMinX(127);
		setScrollMinY(150);
		setScrollMaxX(249);
		setScrollMaxY(249);
		addStructure(factory, 1, (162*128), (187*128) );
		addStructure(powerGen, 1, (170*128), (183*128) );
		addStructure(oilDerrick, 1, (166*128), (187*128) );
		addStructure(oilDerrick, 1, (168*128), (187*128) );
		addStructure(research, 1, (162*128), (183*128) );
		addStructure(sybFact, 1, (166*128), (190*128) );
		setEventTrigger(revealSection2, inactive);
	}
}

event revealSection3(every,50)
{
	if(not structInArea(1, (147*128), (166*128), (173*128), (192*128)))
	{
		setScrollMinX(30);
		setScrollMinY(115);
		setScrollMaxX(249);
		setScrollMaxY(249);
		addStructure(factory, 1, (213*128), (118*128) );
		addStructure(factory, 1, (123*128), (163*128) );
		addStructure(factory, 1, (52*128), (230*128) );
		setEventTrigger(revealSection3, inactive);
	}
}

event revealSection4(every,60)
{
	if(not structInArea(1, (50*128), (50*128), (249*128), (249*128)))
	{
		setScrollMinX(3);
		setScrollMinY(3);
		setScrollMaxX(249);
		setScrollMaxY(249);
		gameOver(TRUE);
		setEventTrigger(revealSection4, inactive);
	}
}
And a snip of the modified cam1a.slo

Code: Select all

{
	//setEventTrigger(placetransport, placetransportTrig);	//Test Transporter
	//landingZone = 0;
	comDead = FALSE;
	notFirstTime = FALSE;
	allDerricks = FALSE;
	allStruct = FALSE;
	MangTranspDestroyed = FALSE;
	atr5Lost = FALSE;
	powerbool = FALSE;

	//setDefaultSensor(UplinkS, 1);
	setNoGoArea(42, 80, 42, 80, 1);
	setNoGoArea(76, 86, 78, 88, 1); //base
	setLandingZone(42, 80, 42, 80);
	setLandingZone(76, 86, 78, 88); //base
	//PLACE MANG.SYB.FACTORY
	addStructure(sybFact, 1, (40*128), (55*128) );
	setPowerLevel(3000,0);			//set starting power
	setPowerLevel(1000,1);
	numArt=0;				//should be set to 0!
	art1ID=addFeature(crate, (62*128), (49*128));
	setEventTrigger(art1TakeEvnt, art1TakeTrig);
	setScrollMinX(35);
	setScrollMinY(44);
	setScrollMaxX(96);
	setScrollMaxY(128);
	setRadarZoom(1);

	makeComponentAvailable(Phover, 0);
	makeComponentAvailable(Pwheels, 0);
	makeComponentAvailable(Ptrack, 0);
	makeComponentAvailable(Phtrack, 0);

	flyTransporterIn(0, 75, 78, true);
	setTransporterExit(0, 77, 87);
	//transportDroid = addDroidToMissionList(transporter, 0);
	setMissionTime(-1);
//PLACE LASSAT 4 MANGODAI
	MangLasSat = addStructure( LasSat, 1, (38*128), (44*128) );
	structure = addStructure( SatLink, 1, (100*128), (55*128) );
	addMessage(MissionBrief, MISS_MSG, 0, true);
	setEventTrigger(startEvnt, inactive);
}
Trust this is of some use.

Regards, RV :hmm:
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: Setting Campaign map's size via mod

Post by DylanDog »

well, this is great. Thanks for the support.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: Setting Campaign map's size via mod

Post by DylanDog »

I need to come back again with this.

1- In the actualoriginal cam1a.slo file the scroll settings are not used anymore.
2- If I use them with setScrollParams(0, 0, 80, 80), to make the map bigger for example, I have the issue that even if the droids can move in the bigger side of the map, the fog does not desappear, in the picture below you can see my tanks being on a zone which is hidden on he original map, but the map is not revealed by the tanks. Also using setBackgroundFog(false) the result is the same:
You do not have the required permissions to view the files attached to this post.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Setting Campaign map's size via mod

Post by Rman Virgil »

.

I'm not sure what's happening here.

Could it be related to the day/night ,slo script ?

.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: Setting Campaign map's size via mod

Post by DylanDog »

I`ll have a look but I do not think so.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Setting Campaign map's size via mod

Post by Rman Virgil »

.

I know it sounds like a wild long-shot, but the reason why I thought maybe a relationship was because along with the modified cam1a .slo used there was also used the sep daynight.slo (from cam3 !) with this (in other words both .slo used & player droids moving into expanded map areas dispelled FoW like they normally should):

Code: Select all

//daytime colour
public		int	Rstart, Gstart, Bstart;
public		int	Rend, Gend, Bend;
public		int	Steps;
private		int	count, Rdiff, Gdiff, Bdiff, Rnow, Gnow, Bnow;

trigger	delayTrig(every, 10);	//change fog every 1 second
//weather stuff
/* Triggers */
trigger startTrig(every, 1500);
trigger stopTrig(every, 2000);

/* Events */
event weatherStop;

event startup(CALL_GAMEINIT)
{
	setBackgroundFog(TRUE);			//set fog on
	setDepthFog(TRUE);
	setFogColour(Rstart, Gstart, Bstart);		//set fog to start colour
	Rdiff = Rstart - Rend;
	Gdiff = Gstart - Gend;
	Bdiff = Bstart - Bend;
.
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Setting Campaign map's size via mod

Post by lav_coyote25 »

makes me wonder if the old AI construction tool would work? it does output files like what rman just posted... ??? :hmm:
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Setting Campaign map's size via mod

Post by Rman Virgil »

lav_coyote25 wrote:makes me wonder if the old AI construction tool would work? it does output files like what rman just posted... ??? :hmm:
Dylan's abilities are well beyond the Ski A.I. Editor ... but he may find the Campaign Mission Editor of interest, though the Missions you can create with it are fairly simple - still they can be challenging fun to play and for novice modders, with little or no A.I. experience, could be a useful learning tool.

- RV :hmm:

.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: Setting Campaign map's size via mod

Post by DylanDog »

Rman Virgil wrote:... but he may find the Campaign Mission Editor of interest.
never heard about this tool? where can I find it? Actually I have managed to work on the first 6 alpha missions, adding scav bases, droids, artifacts and much more BUT keeping the same maps. I am quite satisfied with the understanding how a campaign works, it is much easier modding a campaign than working on DyDo-AI.

When I am ready with this first mod, I would like to make new campaign on new maps, I will possibly open a thread asking if someone would like to collaborate, mainly on the maps creation, but I have to fix this night/day issue first and to be honest I am quite lost...a developer could really help here because I see nowhere on the actual scripts a command which works on reducing scrolling/map view.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Setting Campaign map's size via mod

Post by Zarel »

I believe its name was "WorldEdit". No idea where to find it, though.
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Setting Campaign map's size via mod

Post by Rman Virgil »

DylanDog wrote:never heard about this tool? where can I find it?
Zarel wrote:I believe its name was "WorldEdit". No idea where to find it, though.
Yes. That is what Pumpkin used to create the original campaign and "Edit World" is a crippled version of it.

The source for "WorldEdit" is within the original source distro of the game. It is also not novice friendly, very unstable & generally a mess to work with and the reason why Pumpkin was so incredibly resistant to ever releasing the Map Editor. It took months of a persuasive conversation to get them to see the value of doing so.

However, that is not what we are referring to here. With "WorldEdit" you still have to write your scripts "by hand".

The "Campaign Mission Editor" I'm referring to is more like the original "Star Craft" Mission editor. Very novice friendly - you pick your conditions and parameters from check lists, plug-in your Map Coordinates and it will generate-output your scripts within a campaign structure for you.

I'll upload to a server if your interested.
DylanDog wrote:Actually I have managed to work on the first 6 alpha missions, adding scav bases, droids, artifacts and much more BUT keeping the same maps. I am quite satisfied with the understanding how a campaign works,
That's great. :)
DylanDog wrote:it is much easier modding a campaign than working on DyDo-AI.
Yup, I'm sure.

The original WZ Campaign scripting is pretty straight forward because the mission constructs are purely linear & not at all "tricky" like, say, if you were scripting dynamic "branching" missions.

DylanDog wrote:When I am ready with this first mod, I would like to make new campaign on new maps, I will possibly open a thread asking if someone would like to collaborate, mainly on the maps creation....
That is the single most wished for WZ creation for over a decade now - a New Campaign, and if you can do that as well as having created DyDo, you will have scaled the equivalent of Mount Everest - and all that implies. :D

There are some excellent map makers around who would love to work on a new campaign - I'm pretty sure. The scripting challenges have really dissuaded many from going forward with such an effort.

Have you an over-arching story-scenario in mind already ?

Have you drafted any pre-scripted mission-sequence constructs ?

DylanDog wrote:but I have to fix this night/day issue first and to be honest I am quite lost...a developer could really help here because I see nowhere on the actual scripts a command which works on reducing scrolling/map view.
I wish I could be of more help. The source-binary you are working with is much changed from what I worked with in making my missions. I can't even begin to understand how those source changes could have led to this issue you are facing and perhaps only a developer can help sort it out like you said.

I will say that another way of preventing the Player from entering into map areas BEFORE they have fulfilled the victory conditions of the particular Mission at hand (and seeing only the lay of the land ahead - which is what the map scrolling limits are intended to do, natch) is to instead write Triggers that make the A.I. go POSTAL under those conditions of player "transgression" of the Fog of War. Personally, I find this technique more interesting to play against than the obvious, artificial, hard bounding of map scrolling limits. But that's just me. Very subjective, no doubt. (This going "POSTAL" technique is also, IMHO, a better approach to the simplistic "Mission Failed" way of currently making the player re-play the mission if they have not fulfilled the Victory Conditions to advance to the next mission.)

The map scrolling limits technique is a very old hold over from what they use to call the "single-railer" game design were you were crudely restricted from exploring the game world you knew was there by being forced to stay on a single "path".

One game I remember that had one of the first 3D game worlds with absolutely drop dead gorgeous graphics that did this, and which I grew to hate after 15 minutes of playing, was the first fully 3D "Turok" game. I actually took the CD out and threw it against the wall - the map bounding, scroll-limiting, was that frustrating to me. 'Course WZ's use of the technique was not anywhere that off-putting, but when I got to Cam 3 Rockies the first time, it was starting to get on my nerves. But in all fairness one of my favorite games of all time was a "Single-Railer" - "Panzer Dragoon 2", man what a work of highly original game artistry and so many escalating, fun, challenges too. :D

- RV 8)

.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: Setting Campaign map's size via mod

Post by DylanDog »

DylanDog wrote: I'll upload to a server if your interested.
No, thanks anyway !
Rman Virgil wrote: There are some excellent map makers around who would love to work on a new campaign - I'm pretty sure. The scripting challenges have really dissuaded many from going forward with such an effort.
This is good news.
Rman Virgil wrote: Have you an over-arching story-scenario in mind already ?
Have you drafted any pre-scripted mission-sequence constructs ?
No and No. I am working now only on this first mod using the existing maps. This to become more confident with the campaign scripts. When this first mod will be ready I will start working on the new one and will be more then happy if someone else would like to support. what about yourself? :)
Rman Virgil wrote: write Triggers that make the A.I. go POSTAL
...I am not sure I fully understand this?

:?
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Setting Campaign map's size via mod

Post by stiv »

make the A.I. go POSTAL
To "go postal" is an American expression meaning to go on a killing rampage. The origin is stressed out workers at the US Postal Service shooting their managers and co-workers.