Tool to Save/Load SWC Base Layout

General topics, questions, suggestions, bugs, or anything Star Wars Commander related.

Poll: Usage statistics

I play on Windows server and I use Layout Manager
61
13%
I play on Windows server and I don't use it
44
9%
I play on iOS/Android server and I use Layout Manager
153
33%
I play on iOS/Android server and I don't use it
207
45%
Total votes: 465

User avatar
SFOne
Commodore
Posts: 111

Re: Tool to Save/Load SWC Base Layout

Post#31 » Mon Apr 03, 2017 8:01 am

Midge wrote:
SFOne wrote:Yes, I did click save on the layout, used it in a hd ;).

So It seems I wasn't giving it enough time. It is working fine now. I initially had this problem on my Surface Pro 4 so assumed it was a result of the device perhaps not being up to the task. But the same happened on my desktop which is no slouch. This is perhaps major overkill for this but perhaps something which can fetch the layout and render it in the tool to show the user what layout it will be saving, with the option to poll again if an old layout is returned? Something fairly simple. Or maybe just tell users to wait 5 mins ;)

I have a war coming up soon so I'll test it out on that too and report back with my results.

Great work Sigma :)

Wait ... are you making this work with your MorningMob account or is this just with a Windows account?

I wish Midge, this is my windows account. I can code, but I'm not that good :lol: :lol:
Rebel Level 10 80k+
Proud member of TheMidnightMob

SWC Tools For Android
  • Releases: https://github.com/DaveCMo/Android-SWC-Tools/releases
  • https://youtu.be/8rPACDDEWhg


User avatar
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#32 » Fri Apr 07, 2017 3:28 am

Sigma, you should probably /if you aren't already/ be checking if the client is running already and offer to kill it or smth

another issue might be people trying to log in too often :roll: I don't think Ive tried logging in like every second

btw, if I remember correctly "classic" Mono doesn't run on ios and/or android; guess youll be needing Xamarin which, I think, is free after Microsoft bought them

SFOne wrote: ...


User avatar
Pirate
Admiral
Posts: 507

Re: Tool to Save/Load SWC Base Layout

Post#33 » Fri Apr 07, 2017 7:31 pm

I just tested out the Layout Manager, it is awesome and very easy to use. I'm working on an HD specific base layout now and I'll probably have 5 or 6 layouts that I'll swap between. Thank you again for creating and sharing this great tool.
ⒹⒶⓇⓀⓈⒾⒹⒺ
Imperial Squad

Windows Survivor


User avatar
Sigma582
Admiral
Posts: 595

Re: Tool to Save/Load SWC Base Layout

Post#34 » Sat Apr 08, 2017 8:14 am

joshuatee wrote:Sigma, you should probably /if you aren't already/ be checking if the client is running already and offer to kill it or smth

another issue might be people trying to log in too often :roll: I don't think Ive tried logging in like every second

btw, if I remember correctly "classic" Mono doesn't run on ios and/or android; guess youll be needing Xamarin which, I think, is free after Microsoft bought them

Running client doesn't interfere. When you use LM it logs in only when necessary. Then you get logged off from the game with ¨Duplicate session¨message - just like if you open the game on desktop and mobile at the same time. When you are done you just click "Reload" in the game and play normally with the new layout.

Pirate wrote:I just tested out the Layout Manager, it is awesome and very easy to use. I'm working on an HD specific base layout now and I'll probably have 5 or 6 layouts that I'll swap between. Thank you again for creating and sharing this great tool.

Thanks Pirate! I'm very glad to get such feedback.

PS: added a poll to see how many people find it useful.
Image
New home of former Windows IMPERIALS® squad. PM me to join us on Android server.
-
Layout Manager
http://www.swcommander.com/viewtopic.php?f=31&t=19986
-
Defense Tracker
http://www.swcommander.com/viewtopic.php?f=31&t=20403


User avatar
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#35 » Sun Apr 09, 2017 7:53 am

Sigma582 wrote: Running client doesn't interfere. ...


yeah, ocourse -- I cloned your repo but didn't have a look at the code :oops:

forgot to mention one other option you have to make the tool available on android -- "Cordova". MS also have an android bridge, they used to be working on a ios one too but scraped the project

PS
Cordova is "web app" based, not C# tho ...I think


User avatar
Rerecros
Commander
Posts: 44

Re: Tool to Save/Load SWC Base Layout

Post#36 » Sun Apr 09, 2017 5:42 pm

This looks like a great tool, and though I'm late to the party, I'd like to commend you for creating it.


User avatar
Sigma582
Admiral
Posts: 595

Re: Tool to Save/Load SWC Base Layout

Post#37 » Tue Apr 11, 2017 8:20 pm

The new version is released: https://github.com/Sigma582/SWC.Tools/r ... ager.v.0.6

Sorry to all Android/iOS folks, I couldn't make FB sync work as supposed. Maybe I'm too dumb.
Instead the Android section needs your Player ID and Player Secret and you'll have to spend a few minutes to obtain them before you can log into your SWC account via LayoutManager.

Player ID and Player Secret are stored in Unity's settings called PlayerPrefs.

On Android PlayerPrefs are located in your device's internal memory in
/data/data/com.lucasarts.starts_goo/shared_prefs/com.lucasarts.starts_goo.xml.

On iOS devices the PlayerPrefs can be found in SWC's .plist file located at /Apps/SWC folder/Library/Preferences/.

Note that you will need root access to your device in order to read these files. If your device is not rooted and you don't feel like doing it, you can use an Android emulator (e.g. Andy):
  1. Install emulator.
  2. Install SWC on the virtual device.
  3. Log into your SWC account using Facebook/Google/Game Centre sync.
  4. Root the emulator. This rooting tool for Andy is super easy to use.
  5. Read PlayerPrefs file from SWC folder on the emulator.
  6. After you have written down Player ID and Player Secret you don't longer need the emulator and can uninstall it if you like.

When you get access to PlayerPrefs file you'll see something like this:

Image

Note to moderator:
    In this post I do share actual Player ID and Player Secret of a base that does exist on the server. This base was created for test/demonstration purposes and has no real value. I do understand that sharing this data may allow random people to tamper with this test base and I do not care if this test base is abused, corrupted or "stolen". Please do not remove this data as it is supposed to give people idea of what they are looking for.

Note to everyone:
    You can use the Player ID and Player Secret shared here to access the test base via LayoutManager and see how it works in general. You won't be able to see the base itself or change it (unless you manage to feed these Player ID and Player Secret to your SWC game client) but it will give you a feel of what the process looks like.


Pay attention to the highlighted lines. That gibberish between <string name="prefPlayerId"> and corresponding </string> is your Player ID (a3c29137-174c-11e7-a2d4-06af44004ed6 in this example). Another piece of gibberish between <string name="prefPlayerSecret"> and </string> is your Player Secret (5d84459f67cee3c58f5dc026aa301906 in this example).

Write down these two values in a safe place. Don't tell your Player Secret to anyone as it allows to log into your SWC account. Player ID is a bit less confidential but it's still not a good idea to share it with anyone except DI support.

Now you can start LayoutManager. Select Android in Server selector and paste your Player ID and Player Secret to corresponding fields, then click Login.
Image

The application will log into your SWC account, display your in-game name and now you can manipulate your base's layout.
Image

Layout Manager will remember your server choice (Windows or Android/iOS) and last used Player ID and Secret so that you don't have to dig them out of your notes every time you want to use the tool.
Image
New home of former Windows IMPERIALS® squad. PM me to join us on Android server.
-
Layout Manager
http://www.swcommander.com/viewtopic.php?f=31&t=19986
-
Defense Tracker
http://www.swcommander.com/viewtopic.php?f=31&t=20403


User avatar
Spock
Grand Admiral
Posts: 1091

Re: Tool to Save/Load SWC Base Layout

Post#38 » Tue Apr 11, 2017 8:36 pm

I'm curious, does this tool allow you to change your war base in the middle of a war?

And thanks for trying to get iOS and android working. :)
Image

Leader of the Imperial_Enclave.

Check out our YouTube channel with Over 2,000 no outpost replays being shared! The largest collection of commander replays out there. Soon to become a museum of our game.

https://m.youtube.com/channel/UCW4iVRbrSDJHTBZobNNy7LA


User avatar
Sigma582
Admiral
Posts: 595

Re: Tool to Save/Load SWC Base Layout

Post#39 » Tue Apr 11, 2017 8:38 pm

Rerecros wrote:This looks like a great tool, and though I'm late to the party, I'd like to commend you for creating it.

Thanks mate! Hope you'll find it useful.

There's more stuff to come:
  • Sort barracks/factories in the "screen order". Now SWC kinda messes up the order whenever you move the buildings but I have an idea how to make it so that switching left/right on troops training screen goes from the leftmost barrack/factory to the rightmost one in the same order as they appear on the map.
  • Make a preview of a layout you are about to load. Probably it will be very primitive, dumb and oversimplified preview but it must allow to change buildings' positions, 'cause it's a prerequisite for the next two features.
  • Support adding structures to saved layouts. Now if you save Layout 1, then add a structure to the base, shuffle the buildings and try to load Layout 1, the new structure(s) won't be moved. If they get in the way of other structures the layout won't load at all. Instead the tool should detect this new structure and allow you to select a new place for it when loading Layout 1.
  • This is my favorite. Support exchanging layouts across bases. Imagine that you can ask your buddy to send you his layout. You receive the file, load it via LM - voi la! - your base has the configuration you want. In prospect it would allow creating community libraries of good/fun/useful/interesting layouts for all occasions. Won't it be great?
Image
New home of former Windows IMPERIALS® squad. PM me to join us on Android server.
-
Layout Manager
http://www.swcommander.com/viewtopic.php?f=31&t=19986
-
Defense Tracker
http://www.swcommander.com/viewtopic.php?f=31&t=20403


User avatar
Sigma582
Admiral
Posts: 595

Re: Tool to Save/Load SWC Base Layout

Post#40 » Tue Apr 11, 2017 8:42 pm

Spock wrote:I'm curious, does this tool allow you to change your war base in the middle of a war?

And thanks for trying to get iOS and android working. :)

Probably not. If it does I'll report a bug to DI and demand a reward :lol:

PS: I wonder if I edit a poll option will it lose its votes? Will people be able to re-vote then?
Last edited by Sigma582 on Tue Apr 11, 2017 8:44 pm, edited 1 time in total.
Image
New home of former Windows IMPERIALS® squad. PM me to join us on Android server.
-
Layout Manager
http://www.swcommander.com/viewtopic.php?f=31&t=19986
-
Defense Tracker
http://www.swcommander.com/viewtopic.php?f=31&t=20403


Return to “General Discussions”

Who is online

Users browsing this forum: Ahrefs [Bot] and 43 guests