Setting Default Map

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Kureyn
Kobold
Posts: 9
Joined: Sun Jul 22, 2012 1:30 am

Setting Default Map

Post 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?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Setting Default Map

Post 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.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Setting Default Map

Post 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. :|

Kureyn
Kobold
Posts: 9
Joined: Sun Jul 22, 2012 1:30 am

Re: Setting Default Map

Post 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.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Setting Default Map

Post 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.

User avatar
patoace
Dragon
Posts: 313
Joined: Mon Sep 24, 2007 6:10 pm
Location: Rancagua - Chile

Re: Setting Default Map

Post 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"

Kureyn
Kobold
Posts: 9
Joined: Sun Jul 22, 2012 1:30 am

Re: Setting Default Map

Post 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

User avatar
Sol Invictus
Cave Troll
Posts: 95
Joined: Fri Oct 21, 2011 12:48 pm
Location: Jena/Thuringia/Germany

Re: Setting Default Map

Post 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?

Kureyn
Kobold
Posts: 9
Joined: Sun Jul 22, 2012 1:30 am

Re: Setting Default Map

Post 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.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Setting Default Map

Post 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.

Post Reply

Return to “MapTool”