Page 1 of 1

Setting Default Map

Posted: Fri Nov 09, 2012 6:01 pm
by Kureyn
When anyone connects to our server, it switches them to one of our dungeon maps, called "Quarry". We have a specific map called "Titlescreen" that we'd like the players to start on, but I am not seeing any sort of option for it. Any ideas?

Re: Setting Default Map

Posted: Fri Nov 09, 2012 7:19 pm
by wolph42
If you use my bag of tricks (link in sig) you can set the start up map in the settings. There are other tools that do this as well. Alternatively you program it yourself.

Re: Setting Default Map

Posted: Sat Nov 10, 2012 11:30 am
by Azhrei
When the campaign is saved (to the .cmpgn file) the current map ID is saved and that map ID should cause the map to be made current when the campaign is reloaded. When a client connects, they are sent the "Campaign" object over the network so they should receive the same ID and should switch to that starting map as well. If they're not, it's a bug. Please copy&paste the output from the Help > Gather Debug Information... option to a post and I'll look into it.

The macros that wolph mentions were necessary in older releases and many people still use them, but it's supposed to work now. :|

Re: Setting Default Map

Posted: Sat Nov 10, 2012 11:45 am
by Kureyn
Azhrei wrote:Please copy&paste the output from the Help > Gather Debug Information... option to a post and I'll look into it.
No such option. We're all running on build 1.3.b84, if that helps.

Re: Setting Default Map

Posted: Sat Nov 10, 2012 5:38 pm
by wolph42
Azhrei wrote:When the campaign is saved (to the .cmpgn file) the current map ID is saved and that map ID should cause the map to be made current when the campaign is reloaded. When a client connects, they are sent the "Campaign" object over the network so they should receive the same ID and should switch to that starting map as well. If they're not, it's a bug. Please copy&paste the output from the Help > Gather Debug Information... option to a post and I'll look into it.

The macros that wolph mentions were necessary in older releases and many people still use them, but it's supposed to work now. :|
IRC when you load a campaign you go to the last saved map, however (although not sure) if players log in, then you sometimes swap to another map. When (if) I encounter it again I'll post it.

Re: Setting Default Map

Posted: Sat Nov 10, 2012 7:53 pm
by patoace
It's really simple

1. Create a library token (any token with a name starting with "Lib:")
2. On that token, add a new macro.
3. Rename that macro from "(new)" to "onCampaignLoad"
4. In the command section, write [setCurrentMap("Titlescreen")]
5. Click OK.

Now every time the campaign loads, the player will start on "Titlescreen"

Re: Setting Default Map

Posted: Sat Nov 10, 2012 10:05 pm
by Kureyn
patoace wrote:It's really simple

1. Create a library token (any token with a name starting with "Lib:")
2. On that token, add a new macro.
3. Rename that macro from "(new)" to "onCampaignLoad"
4. In the command section, write [setCurrentMap("Titlescreen")]
5. Click OK.

Now every time the campaign loads, the player will start on "Titlescreen"
That did it! Thanks much! :3

Re: Setting Default Map

Posted: Sun Nov 11, 2012 3:01 pm
by Sol Invictus
Is it not possible just to toggle off "Player Visible" for all maps but one to force the Players all on that one map when they log in?

Re: Setting Default Map

Posted: Sun Nov 11, 2012 5:04 pm
by Kureyn
You probably could, but then you'd have to go in and turn them all back on every time, too.

Setting up the macro is a better solution.

Re: Setting Default Map

Posted: Tue Nov 13, 2012 11:09 am
by Azhrei
Except that switching maps in macros can get tricky. There are many internal variables that reference the "current" map and if a complicated macro tries to switch maps in the middle, the current variable will be updated behind the scenes and that can cause some headache trying to debug the results. (This is the reason why modifying tokens in onCampaignLoad can produce duplicate tokens.)

If you need to switch maps I suggest making it the last thing in the macro, and then if there is more code that has to be executed use Wiki: macroLink() or similar to run it.