Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: pawnstorm on April 24, 2014, 10:57:27 PM

Title: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: pawnstorm on April 24, 2014, 10:57:27 PM

Battle Formations
Now with lasers, banana bombs and exploding sheep!
(not really)
Description:
Allows you to save the positions of all your drafted colonists so you can make them all return to the exact same positions at a later time.
I also added the ability to manually order your colonists to eat or sleep, so while the raiders are staging you can make sure all your colonists are well fed and rested.

Download:
The download link is at the bottom of this post or here (http://ludeon.com/forums/index.php?action=dlattach;topic=3299.0;attach=2085).

How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in game.

Important:
You can't use this mod on an existing savegame. You have to start a new game with this mod enabled and you can't disable the mod for that savegame afterwards.
Savegames started with Battle Formations v0.1 also won't work with the new version. If you really want to use this mod in one of your existing savegames you can easily fix this using the awesome XML manipulation tool XmlStarlet (http://xmlstar.sourceforge.net/) which you can download here (http://sourceforge.net/projects/xmlstar/files/latest/download?source=files).

To fix your Battle Formations 0.1 savegame to work with Battle Formations 1.0:
xml ed -P -u "//thing[@Class='BattleFormations.XPawn'][def/text()='Human']/@Class" -v "BF.PawnX" -u "//thing[@Class='BattleFormations.XPawn'][def/text()!='Human']/@Class" -v "Pawn" input.rim >output.rim

To add Battle Formations 1.0 to your vanilla savegame:
xml ed -P -u "//thing[@Class='Pawn'][def/text()='Human']/@Class" -v "BF.PawnX" input.rim >output.rim

To remove Battle Formations 1.0 from your savegame:
xml ed -P -d "//thing[@Class='BF.PawnX']/savedpos" -u "//thing[@Class='BF.PawnX']/@Class" -v "Pawn" input.rim >output.rim

If all this command line stuff scares you, just download XmlStarlet, get this batch file (http://ludeon.com/forums/index.php?action=dlattach;topic=3299.0;attach=2086), make sure xml.exe and the batch file are in the same directory and drag and drop your savegame on the batch file. I do advise to keep the backup file, at least until some people have reported it all works as intended.

Notes:
- The easiest way to set up positions for your colonists is to just move them all into position once, select them all and click the "Save positions" button. The other new button in draft mode will make them all return to these positions.
- The options to manually order your colonists to eat or sleep become available when either food or rest drops below 50%. The way I intended it to work is when raiders are staging you can select all your colonists and click the eat or sleep button to make all colonists with food or rest levels below 50% fulfill their needs.

Credits:
Clker.com (http://www.clker.com/) is where I got the images I used for the buttons
Haplo (http://ludeon.com/forums/index.php?action=profile;u=161) for his awesome PowerSwitch mod which I used as a template

Changelog:
0.1- Released
1.0- Changed it so it only affects human pawns, the eat and sleep buttons will be disabled if pawns are already eating or sleeping and tidied up the code a bit.

P.S. There won't be anymore updates for Battle Formations. If you're still using this, consider getting Vanilla+ (http://ludeon.com/forums/index.php?topic=3571.0) instead.

[attachment deleted by admin: too old]
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: JanBlair on April 24, 2014, 11:37:06 PM
This sounds awesome man! Will try
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 24, 2014, 11:55:05 PM
Thanks! Let me know if you run into any bugs or if you have any suggestions on how to improve it. I'd love to get some feedback on this, especially how people use it.
The way I intended it to work is when raiders are staging you can select all your colonists and click the eat or sleep button to make all colonists with food or rest levels below 50% fulfill their needs.
Saving positions and ordering your colonists to move to their respective positions should also work with all your colonists selected.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Kirid on April 25, 2014, 01:12:35 AM
Oh my gosh this is awesome ;D just what I was wishing for. I thought it was too good to be true at first. I started a new game and played around with it in godmode for a bit, no errors and works as intended so far. I'm going to start testing out mods with it, then play a full colony.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Celthric Aysen on April 25, 2014, 01:53:02 AM
This would definitely be very very very useful!
THANK YOU!
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 25, 2014, 02:00:35 AM
Glad you're enjoying it :). On a sidenote, if you really want to use this mod in one of your existing savegames you could in theory open up the savegame in notepad and replace every instance of 'Class="Pawn"' with 'Class="BattleFormations.XPawn"' (remove the single quotes). You could probably also do the opposite to disable the mod, but you'd still have some saved positions in your savegame (which is probably harmless, but I haven't tested that).
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Celthric Aysen on April 25, 2014, 02:10:04 AM
Quote from: pawnstorm on April 25, 2014, 02:00:35 AM
Glad you're enjoying it :). On a sidenote, if you really want to use this mod in one of your existing savegames you could in theory open up the savegame in notepad and replace every instance of 'Class="Pawn"' with 'Class="BattleFormations.XPawn"' (remove the single quotes). You could probably also do the opposite to disable the mod, but you'd still have some saved positions in your savegame (which is probably harmless, but I haven't tested that).
Awesome!
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Kirid on April 25, 2014, 02:28:28 AM
I plopped it into a rimworld folder with 30 other mods, no problems so far. No conflicts with the AlphaMuffalo mod, my only pawn-adding mod. Since your xml just changes the <thingClass> of "BasePawn", I think anything loaded before may automatically get written over as a BattleFormations.XPawn?
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 25, 2014, 02:44:26 AM
I expect that's how it works, yes. I considered only changing the class of human pawns, but I figured someone might add tamable pets some day and I want my mod to be ready for it :P. Like dogs that can haul and melee attack or something.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Killaim on April 25, 2014, 03:56:18 AM
thank you for this mod
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Celthric Aysen on April 25, 2014, 04:01:01 AM
BTW pawnstorm if you want me to make icons for your mod, tell me.
a good mod requires good textures ;)
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 25, 2014, 04:13:02 AM
Quote from: Blackjack1000K on April 25, 2014, 04:01:01 AM
BTW pawnstorm if you want me to make icons for your mod, tell me.
i good mod requires good textures ;)

Thanks for the offer! I think the icons I used look nice enough, but if you have any ideas how to make something that looks better I'd definitely appreciate it!
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Celthric Aysen on April 25, 2014, 04:20:55 AM
Quote from: pawnstorm on April 25, 2014, 04:13:02 AM
Quote from: Blackjack1000K on April 25, 2014, 04:01:01 AM
BTW pawnstorm if you want me to make icons for your mod, tell me.
i good mod requires good textures ;)

Thanks for the offer! I think the icons I used look nice enough, but if you have any ideas how to make something that looks better I'd definitely appreciate it!
Alright'y then il give it to you tomorrow
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Architect on April 25, 2014, 06:09:58 AM
Awesome man :D I'm so glad someone decided to make this. :)
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: keyes on April 25, 2014, 12:26:55 PM
This is a great mod.  The next thing that would be cool to go with it is to have speakers, or flashing red lights that you can activate. Anyone near the lights or speakers go to their positions. 
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: daft73 on April 25, 2014, 12:30:13 PM
Quote from: Kirid on April 25, 2014, 02:28:28 AM
I plopped it into a rimworld folder with 30 other mods, no problems so far. No conflicts with the AlphaMuffalo mod, my only pawn-adding mod. Since your xml just changes the <thingClass> of "BasePawn", I think anything loaded before may automatically get written over as a BattleFormations.XPawn?
Bestest news ever ;D :D

Will report problems, bugs, anomalies, blackholes...
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Architect on April 25, 2014, 12:36:24 PM
I only just realised, you've completely over written the defs for pawns to make them use an entirely custom thingDef for their behaviour... I didn't even realise you could do that! XD
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 25, 2014, 01:26:22 PM
Quote from: Architect on April 25, 2014, 12:36:24 PM
I only just realised, you've completely over written the defs for pawns to make them use an entirely custom thingDef for their behaviour... I didn't even realise you could do that! XD
I didn't know I could do that either! :P
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Architect on April 25, 2014, 01:42:51 PM
Pawnstorm, I've sent you a PM requesting your assistance?
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 25, 2014, 02:09:45 PM
Quote from: Architect on April 25, 2014, 01:42:51 PM
Pawnstorm, I've sent you a PM requesting your assistance?
I sent you a reply :). I'm also in #rimworld on quakenet if you need further assistance
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: Haplo on April 25, 2014, 02:12:28 PM
Your mod is really good. I've just tested it and it does work perfectly on my side.
The only thing I would change is that right now you overwrite every pawn in your Races.xml.
As your mod right now is only for colonists, you should maybe delete everything not human out of the file, so that you only have to watch out for changes in the human definitions and not if someone changes the animal definitions.
But else it really works good!
Also I'm glad that my mod could provide some help for you to create this. :)
Good work.. ;D
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 25, 2014, 02:25:47 PM
Quote from: Haplo on April 25, 2014, 02:12:28 PM
Your mod is really good. I've just tested it and it does work perfectly on my side.
The only thing I would change is that right now you overwrite every pawn in your Races.xml.
As your mod right now is only for colonists, you should maybe delete everything not human out of the file, so that you only have to watch out for changes in the human definitions and not if someone changes the animal definitions.
But else it really works good!
Also I'm glad that my mod could provide some help for you to create this. :)
Good work.. ;D
Thanks for the feedback! Yeah, I'll change it in the next release. It does seem more sensible that way.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 25, 2014, 02:54:40 PM
By the way, if anybody does a "Lets play Rimworld" vid on youtube featuring my mod, please do let me know! I'd love to watch people actually use it. Bonus points if you also use my favourite mod setup, which is Haplo's PowerSwitch, Psyckosama's Cremation Chamber and Silvermane's Clothes mod.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: rakarna on April 26, 2014, 06:02:32 PM
are i blind, or is it only me who cant found the download link?
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 26, 2014, 06:10:33 PM
It's at the bottom of the first post. I updated the first post yesterday by the way, also added a section about plans for the next release which I could use some feedback on. Mainly what the threat response structure should look like.

Edit: I'll go add a download section I guess
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 26, 2014, 10:54:17 PM
I'm still waiting for the new textures before I release version 0.2, but if anyone would like to try the new version with the old textures in the meantime, here it is (http://ludeon.com/forums/index.php?action=dlattach;topic=3299.0;attach=2047).
Your old savegames won't work with the new version, but it's easy to fix this using the awesome XML manipulation tool XmlStarlet (http://xmlstar.sourceforge.net/) which you can download here (http://sourceforge.net/projects/xmlstar/files/latest/download?source=files).

To fix your Battle Formations 0.1 savegame to work with Battle Formations 0.2:
xml ed -P -u "//thing[@Class='BattleFormations.XPawn'][def/text()='Human']/@Class" -v "BF.PawnX" -u "//thing[@Class='BattleFormations.XPawn'][def/text()!='Human']/@Class" -v "Pawn" input.rim >output.rim

To add Battle Formations 0.2 to your vanilla savegame:
xml ed -P -u "//thing[@Class='Pawn'][def/text()='Human']/@Class" -v "BF.PawnX" input.rim >output.rim

To remove Battle Formations 0.2 from your savegame:
xml ed -P -d "//thing[@Class='BF.PawnX']/savedpos" -u "//thing[@Class='BF.PawnX']/@Class" -v "Pawn" input.rim >output.rim

If all this command line stuff scares you, just download XmlStarlet, get this batch file (http://ludeon.com/forums/index.php?action=dlattach;topic=3299.0;attach=2048), make sure xml.exe and the batch file are in the same directory and drag and drop your savegame on the batch file. I do advise to keep the backup file, at least until some people have reported it all works as intended.

[attachment deleted by admin: too old]
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: WolfgangPolska on April 27, 2014, 01:56:33 AM
Can anyone make video how it work please???
Title: Re: [MOD] (Alpha 3F) Battle Formations (v0.1)
Post by: pawnstorm on April 27, 2014, 03:28:12 AM
Quote from: WolfgangPolska on April 27, 2014, 01:56:33 AM
Can anyone make video how it work please???
How what works exactly? If you just want to play a game with this mod, install it like you would any other mod. The complicated xml stuff only applies if you want to enable this mod on a savegame you started without this mod or if you want to continue your savegame from the old version with the new version.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: pawnstorm on April 28, 2014, 11:18:29 PM
First post updated with new version. I went straight to v1.0 since it seems to work pretty well and I don't think I'll be making many changes to it. I do plan to do a mod based on this, but that'll be a separate mod.

Blackjack1000K: Are you still working on better textures or busy with other things?
Title: Re: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: Celthric Aysen on April 28, 2014, 11:41:51 PM
Quote from: pawnstorm on April 28, 2014, 11:18:29 PM
Blackjack1000K: Are you still working on better textures or busy with other things?
Yeah im still working on it!
Title: Re: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: PunisheR007 on June 04, 2014, 10:30:09 AM
Has anyone tried this mod for alpha 4? i would love to keep using this mod, has helped so much.
Im gonna give it a go in my next colony.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: pawnstorm on June 05, 2014, 08:22:48 AM
Quote from: PunisheR007 on June 04, 2014, 10:30:09 AM
Has anyone tried this mod for alpha 4? i would love to keep using this mod, has helped so much.
Im gonna give it a go in my next colony.
This mod won't be updated for alpha 4, but Vanilla+ (http://ludeon.com/forums/index.php?topic=3571.0) has the same functionality and will be updated eventually when I get back from my holidays.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: PunisheR007 on June 29, 2014, 04:26:19 AM
What about the people who don't wish to use vanilla+ and want to use the battle formations?, isn't that forcing them to use your other mod/s to get the battle formations mod they wished to use in the first place?. I Hope you change your mind, cause battle formations is an awesome mod, but thats the only part of vanilla+ that i would be wanting to use, and then i would get a whole lot of stuff i don't wish to have.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: pawnstorm on June 29, 2014, 09:33:56 AM
Quote from: PunisheR007 on June 29, 2014, 04:26:19 AM
What about the people who don't wish to use vanilla+ and want to use the battle formations?, isn't that forcing them to use your other mod/s to get the battle formations mod they wished to use in the first place?. I Hope you change your mind, cause battle formations is an awesome mod, but thats the only part of vanilla+ that i would be wanting to use, and then i would get a whole lot of stuff i don't wish to have.
If there's more interest in seeing Battle Formations updated to A4, I'll consider it after I update Vanilla+ if it's not too much work. Right now, Vanilla+ has priority though.
Title: Re: [MOD] (Alpha 3F) Battle Formations (v1.0)
Post by: PunisheR007 on June 29, 2014, 10:19:20 AM
Quote from: pawnstorm on June 29, 2014, 09:33:56 AM
If there's more interest in seeing Battle Formations updated to A4, I'll consider it after I update Vanilla+ if it's not too much work. Right now, Vanilla+ has priority though.

I understand vanilla+ has priority, cause im sure it's a ton of coding. I got my fingers xsed that you get the time to do it :).
Cheers pawnstorm.