This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

SetMapPart index issue

Give us your input on how we may improve the game in future versions.
Forum rules
By using the forum you agree to the following rules. For this forum you also need to follow these additional rules.
Locked
User avatar
Shock
Superfighter
Superfighter
Posts: 312
Joined: Sun Mar 20, 2016 7:17 am
Title: Content-maker
SFD Account: Shock
Started SFD: Pre-Alpha 1.2.0.
Location: Belarus
Gender:
Age: 23
Contact:

SetMapPart index issue

Post by Shock » Sat Jul 11, 2020 6:57 pm

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
0 x
-Content-maker.

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1887
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 36

Post by Gurt » Sun Jul 12, 2020 2:05 pm

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.
0 x
Gurt

Locked