Hey Guys, I've just started modding today and my mission is to make a game option for players to only be defeated when all of his army is destroyed. I've been looking around in the media directory to find the code ending the game which immediately led me to the \server-script\states\playing.js and down to line 381 and made this changed: var alive = true;//_.some(army.commanders, function (commander) { return !commander.dead; }); as after that line theres a if function that kicks off _.forEach(allies, defeatArmy); But no luck. I presume someone else has tried this, any advice? Thanks, Fenlig
I hate to be the bearer of bad news... First, server script doesn't really work with the game's mod system. (All the code is loaded before mods are applied.) To make it work you have to use modified core files, which means either local server, or running your own server for internet play. Second, the server only knows about units that it directly spawned (which is usually just the commanders). Something about thread synchronization slowing things down. (As I understand it this is server-script (server being the part that communicates with the client) not sim-script (sim being the part that has current unit states and determines outcomes)) So your blanket "never defeated" could work, but you won't actually know when the last unit dies, unless you create a cooperating server UI mod to feed back game stats.
Damn, I was wondering why no one has already done this, its kinda kill my modding buzz. But thank you for saving me time
Okay so i made this change on my server side so it works, but the game will never end which isn't a big problem. Going to see if I can make it so when the Player is destroyed he gets to relaunch his command back onto the planet.
I have a thought on this.... If the game is hard wired to commanders, maybe a commander modification would achieve what you want? For example: make commanders static, and invulnerable to damage, but allow them to be reclaimed for the win. That way you have to totally defeat the start base before you can move in with vulnerable fabbers to finish the game.