Page 1 of 1

SetMapPart index issue

Posted: Sat Jul 11, 2020 6:57 pm
by Shock
When you use SetMapPart trigger and set the index for campaign, sometimes it may confuse you because it starts not from 0, but from 1 and in the trigger it still shows 0 index, which still may be used and if you set second map part and use first index, it may just move you to the second index map part instead of the first

Re: SetMapPart index issue

Posted: Sun Jul 12, 2020 2:05 pm
by Gurt
SetMapPartTrigger works as intended.
Index 0 just means the first map part (as visualized by the text "1: [PARTNAME]" in the tabs in the editor)
Index 1 means the second map part (as visualized by the text "2: [PARTNAME]" in the tabs in the editor)

While this may be quirky for a non-programmer it works as intended as you can from scripts also call Game.SetCampaignMapPart(int index) which is the same index as you specify in your SetMapPartTriggers.

The visualization could just as well start displaying "0: [PARTNAME]", "1: [PARTNAME]", ... and so on but it starts with "1" now.

Moving this to the suggestion topic if the visualization/display in tabs should start from 0 instead of 1.