Code: Select all
include("multiplay/maps/"+maxPlayers+"c-"+mapName.slice(0, -3)+"/rules.js");
Unfortunately, throws a LOG_ERROR message if the map doesn't provide any script.
Code: Select all
include("multiplay/maps/"+maxPlayers+"c-"+mapName.slice(0, -3)+"/rules.js");
Some questions:NoQ wrote:Put this into rules.js:This will allow making scripted maps without involving map-mods (and including them into the game too!). Works on 3.1.Code: Select all
include("multiplay/maps/"+maxPlayers+"c-"+mapName.slice(0, -3)+"/rules.js");
It's easy to target an existing map in the .addon fileaubergine wrote:Currently it's possible to create a challenge for any existing map, and that functionality is useful IMHO. If we force challenges and maps to be bundled together, it will be harder for people who don't make maps to create challenges. There should be some ability for a non-mapmaker to create a challenge (or mini campaign) and a non-scripter to make maps.
I proposed to modify the base game's rules.js. There's not much sense in having this as a mod.Duha wrote:To change rules.js you need create new mod ?
I that think if you mention an event twice, just both functions are called.Duha wrote:Can you add some event handler in map js with out overriding rules.js. handlers?
addon.lev etc., i think, some really weird logic we're trying to get away from by introducing map.ini (?)aubergine wrote:.addon file? What are those?
I prefer bind unbind functions styleaubergine wrote:If you create two event listeners of same name, the second overwrites the first, unless you do some clever stuff with getter/setter properties.