Page 1 of 2

Enhanced SitRep Mod

Posted: 14 May 2012, 04:52
by Shadow Wolf TJC
Just a little side-project of mine that was created during development of my Contingency mod, the Expanded SitRep Mod was designed to provide players with a modified rules.js that would actually inform players of a wide variety of situations, such as:

- When an enemy unit or structure is detected, and whether the enemy is a Scavenger or an enemy player. (In 3.2, it would also tell if the enemy is an artillery unit/structure, a VTOL, or even an enemy transport.)
- When an Oil Derrick or Power Generator is under attack.
- When a unit or structure is destroyed. If it's an Oil Derrick, Power Generator, or LasSat Command Post, it'll play a special message.
- When the player is low on power, or doesn't have enough Power Generators to run all the Oil Derricks.
Enhanced_SitRep_Mod.wz
(45.14 KiB) Downloaded 828 times
Edit: At least 7 downloads already? What do you guys think about this? :3

If anyone's interested in incorporating this to the main game, or for any of their mods, here's the license that I'll be using for now:
Image
So feel free to incorporate this, though credit would be nice. :3

Re: Enhanced SitRep Mod

Posted: 20 May 2012, 05:18
by aubergine
I've been playing around with this mod - love it!

What are the audio.wrf and audio.cfg files about? I really want to document them as I'm having a binge on all things audio at the moment... (:

Re: Enhanced SitRep Mod

Posted: 20 May 2012, 21:52
by iap
I like it very much! I think it should be included in the game.

Re: Enhanced SitRep Mod

Posted: 21 May 2012, 06:05
by Shadow Wolf TJC
aubergine wrote:What are the audio.wrf and audio.cfg files about? I really want to document them as I'm having a binge on all things audio at the moment... (:
Some of the sounds that were used for this mod were included into base.wz, but were not loaded by the audio.cfg and audio.wrf files in base.wz, so I had to modify them, by adding in the missing sounds, to make them work.

Oh, and by the way, I couldn't have done it without all that JavaScript documentation that you did, so thanks. :D

Re: Enhanced SitRep Mod

Posted: 21 May 2012, 17:28
by aubergine
Thanks for the info, I'll update the docs regarding the cfg and wrf files :)

Inspired by your mod, I'm developing a complete new version of rules.js (re-written from scratch) - will upload to this thread once complete.

Re: Enhanced SitRep Mod

Posted: 22 May 2012, 06:23
by Shadow Wolf TJC
Oh? What kind of rules.js are we talking about exactly?

Re: Enhanced SitRep Mod

Posted: 22 May 2012, 13:40
by aubergine
Well, so far I've done the following:

* Rewritten player initialisation code and split out in to separate rules.init.js
* Rewritten victory conditions code
* Created a throttled alternative to playSound() to make code cleaner
* Added about a dozen additional audio messages (eg. I can now detect when unit was recycled or structure demolished)
* Split out situation reporting in to separate rules.report.js

Example code from the new rules.js:

Code: Select all

function eventGameInit() {
	hackNetOff();

	// initialise all players:
	var player = maxPlayers;
	while (-1<--player) {
		// These functions and associated settings are defined in rules.init.js
		init.enableStructuresFor(player);
		init.enableComponentsFor(player);
		init.enableTechnologiesFor(player);
		init.setLimitsFor(player);
		init.applyBaseTypeFor(player);
	}
	applyLimitSet();
	
	// Set minimap and desgin based on presence of a HQ
	var state = (!!enumStruct(me, HQ).length);
	setMiniMap(state);
	setDesign(state);

	// This is the only template that should be enabled before design is allowed
	enableTemplate("ConstructionDroid");

	hackNetOn();
}
I'm just playtesting to make sure I've not missed any bugs - will upload later today.

Re: Enhanced SitRep Mod

Posted: 22 May 2012, 14:21
by Reg312
may be you can implement my idea with game rounds? :)
viewtopic.php?f=30&t=9402#p102920
1) save start locations and start droids/buildings/feautes
2) when team wins - clear all and recreate objects from step1

Re: Enhanced SitRep Mod

Posted: 22 May 2012, 16:05
by aubergine
@Reg312 - that won't be possible until Warzone 3.2 (some needed JS API functions not available in 3.1 branch).

Re: Enhanced SitRep Mod

Posted: 22 May 2012, 16:42
by aubergine
Here's version 0.8:
Enhanced_SitRep_Mod-v0.8.wz
Enhanced Situation Reporting v0.8
(20.13 KiB) Downloaded 459 times
Tested on Warzone 3.1 Beta 10, should work from Warzone 3.1 Beta 5 and above.

Known bugs:

* pcv634.ogg file not correctly defined (fixed in v0.9)
* design and minimap enabled before HQ is built (fixed in v0.9)


Reporting features:

* Players entering/exiting game
* Power status (low power, derrick required)
* Sensor reports (units/structures detected)
* Building construction
* Attacks (more descriptive reporting than usual)
* Recycling / Demolition
* Units/buildings destroyed
* Object transfers (including nexus link assimilation)

Refactored rules.js:

* rules.js is now a lot easier to read and understand
* rules.init.js contains all the settings/code for player initialisation at start of game
* rules.report.js contains all the situation reporting code

Current gripes:

* Several audio messages are hard-coded in to Warzone causing occasional message duplication
* Unable to determine scavenger player existence/defeat due to bugs in enumStuct() and enumDroid()

Future plans:

* Improve reporting based on turret types - eg. sensors, missiles, etc.
* When hard-coded messages removed from Warzone, implement better reports for production/research/etc.
* When enumStruct()/enumDroid() bugs fixed, require scavengers to be killed before winning game
* Update to allow player revival when alliancesType == ALLIANCES ?
* Split out victory conditions in to separate file (eg. to allow Reg312's request or custom victory conditions)

Re: Enhanced SitRep Mod

Posted: 22 May 2012, 21:12
by aubergine
Version 0.9 fixes two bugs that were found in v0.8:

* Designer and minimap now require HQ to be built
* pcv634.ogg ("incoming air strike") now correctly defined in audio.wrf and audio.cfg
Enhanced_SitRep_Mod-v0.9.zip
Enhanced Situation Reporting v0.9
(20.17 KiB) Downloaded 457 times
Get it while it's hot :)

Known bugs:

* http://developer.wz2100.net/ticket/3506 (will add Shadow Wolf's workaround to v0.10)

Re: Enhanced SitRep Mod

Posted: 22 May 2012, 22:28
by aubergine
@Shadow Wolf: What do you think of the revised format of rules.js and associated scripts?

Re: Enhanced SitRep Mod

Posted: 24 May 2012, 06:19
by aubergine
v0.10 is here!
Enhanced_SitRep_Mod-v0.10.zip
Enhanced Situation Reporting v0.10
(80.81 KiB) Downloaded 556 times
This is a massive update!

* About 20 new report events
* Droid commanders now have a voice!
* Randomising of audio messages (where applicable)
* All known bugs fixed
* rules.report.js completely re-written
* New rules.report.msg.js defines all messages
* Several completely new audio files

This update also includes new object classification code and message searching - it's now easy to add lots of new messages with defaults, etc.

Re: Enhanced SitRep Mod

Posted: 27 May 2012, 03:40
by KEN+J
Can you make versions 0.9 and 0.10 of this mod the same as you did for version 0.8?

Re: Enhanced SitRep Mod

Posted: 27 May 2012, 05:33
by Goth Zagog-Thou
Great work, Aubergine. :) Will test this immediately. Love this mod and everything it stands for.