Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the 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.
Post Reply
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: 24
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: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

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

Post Reply