Author Topic: Issues with Mount Points  (Read 250 times)

D.D.Q.

  • Guest
Issues with Mount Points
« on: May 24, 2021, 04:52:45 PM »
I want to use mount points to create forests and cities on the map. In viewport mode, the usage of mount points seemed to be the best fitting for that task. I would like to place those mount points with attributes like "wood: 20", "stone: 50" and dynamically place different icons on the map, which change appearance according to the decreasing value of their attribute.

1. After creating a mount point in the editor, a flag icon appeared on the map. After saving changes, going to play mode, and coming back, the flag icon is gone. I still find all the mount points in the list at the bottom, but I don't see a way to let the mount points reappear again as flag icons, for visual assurance of their actual position. They should appear, right?

2. How can I quickly delete mount points? Best would be something like CTRL + left click on the flag icon. I tested a little bit and even after reverting to backup, I still have hundreds of mount points in the list at the bottom. How can I get rid of them? 

3. When creating a mount point with the editor, I have the option to apply a type, which - as I understand it - must be an integer. After the creation of the mount point, I can additionally assign an attribute, which consists of string ID and int value, which is nice for my use case as described. Why can't I assign this attribute when creating the mount point, though? If I place 50 trees, this can get a little tedious.

4. I am unable to place 2D sprites on the mount points. Here is my code:

Code
    public WMSK WMSK;

    public GameObject MountPrefab_Tree;

    void Start()
    {
        StartCoroutine(Populate_MountPoints());
    }

    IEnumerator Populate_MountPoints()
    {
        List<MountPoint> MountPoints = WMSK.mountPoints;

        foreach (MountPoint point in MountPoints)
        {
            //if (point.attrib.keys.Contains("Wood"))
            //{
                Debug.Log("Place Tree");
                WMSK.AddMarker2DSprite(MountPrefab_Tree, point.unity2DLocation, 0.001f, false, false);
            //}

            yield return null;
        }
    }

Result:
No matter how many mount points I place, one tree object is generated under the parent "MountPoints" at location 0,0,0. Debug Log shows 136 times "Place Tree" (Do to all the testing mount points). No error. Tree object consists only of a sprite renderer and the single misplaced one appears correctly.

What am I missing? Thanks for the support!

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #1 on: May 25, 2021, 10:30:00 AM »
Hi,

1. Yes, they should re-appear. I've tested this in case of some regression happened and couldn't reproduce. I used demo scene "001 Standalone", open Map Editor and added some mount points over Brazil. Saving, playing, reloading scene, adding new mount points, etc. They are kept and visible. Note that they're only visible in Editor time. When you enter Play Mode, they're not visible.

2. Currently the only way to remove them is to go through the Reshape -> Delete -> click Delete button below Mount Point. I get that Control + Left click will be a time saver when using lot of mount points.

3. When you click on the map to place a new Mount Point, the mount point is added to the list of Mount Points and the last one added is automatically selected so you can just enter your attributes there, just after clicking/adding the new mount point.

4. You're passing the same gameobject instance to AddMarker2DSprite in each iteration. Instead you should pass a new instance on each AddMarker2DSprite, otherwise it's just relocating the same object through all mount points positions.

Regards



Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #2 on: May 25, 2021, 10:37:22 AM »
Removing mount points with control + left button click is now implemented in latest beta.

D.D.Q.

  • Guest
Re: Issues with Mount Points
« Reply #3 on: May 25, 2021, 09:18:50 PM »
Damn, you`re fast!! Thanks!



D.D.Q.

  • Guest
Re: Issues with Mount Points
« Reply #4 on: May 25, 2021, 11:11:37 PM »
One really quick question:
You can't change the camera angle when using the terrain mode, right? Whenever I change the camera angle in the demo scene, the camera controller breaks.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #5 on: May 27, 2021, 09:11:18 AM »
You can use map.enableFreeCamera property to allow free camera rotation.

Pollyfun

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Issues with Mount Points
« Reply #6 on: September 05, 2021, 05:07:31 PM »
Quote
1. After creating a mount point in the editor, a flag icon appeared on the map. After saving changes, going to play mode, and coming back, the flag icon is gone. I still find all the mount points in the list at the bottom, but I don't see a way to let the mount points reappear again as flag icons, for visual assurance of their actual position. They should appear, right?

I also got this error. I found out that the json-parsing creates the problem. Using this mountPoints.json:

Code
[
{
"Name":"0",
"Province":0,
"Country":0,
"Type":0,
"X":-0,390357,
"Y":-0,4150302,
"Id":660873661,
"Attrib":null
},
{
"Name":"1",
"Province":0,
"Country":0,
"Type":0,
"X":-0,452886,
"Y":-0,3538132,
"Id":2090121872,
"Attrib":null
}
]

The X and Y positions are split into two. When saving to mountPoints.json all positions are saved as zero (lost).



« Last Edit: September 05, 2021, 05:09:03 PM by Pollyfun »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #7 on: September 05, 2021, 05:40:54 PM »
Looks like a regional encoding issue which uses the "," decimal separator instead of "." - I'll confirm this asap.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #8 on: September 05, 2021, 06:15:28 PM »
This should be fixed in latest beta. Please register and send me your invoice number to get access.

Pollyfun

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Issues with Mount Points
« Reply #9 on: September 05, 2021, 06:58:09 PM »
Sounds good, I already have access since before. But is it up-to-date? It's edited in August.

Download link (Unity 2018.4+):  (Updated: 3-AUG-2021 19:08h CET)
Last Edit: August 30, 2021, 02:35:09 PM by Kronnect

I installed it anyway, but now the CountryAddProvinces, CountrySetProvinces andCountryRemoveProvinces APIs are missing.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #10 on: September 05, 2021, 07:07:46 PM »
Its a patch over the latest public version here:
https://kronnect.com/support/index.php/topic,5340.0.html
(Still not released to the UAS until confirmed).

Pollyfun

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Issues with Mount Points
« Reply #11 on: September 05, 2021, 08:28:25 PM »
Now mountPoints.json contains dot-separator instead of commas. But the parsing still fails. Now X and Y becomes null.




Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #12 on: September 06, 2021, 08:21:55 AM »
Please download and try again.

Pollyfun

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Issues with Mount Points
« Reply #13 on: September 06, 2021, 08:44:05 AM »
Now the mountpoints are loaded correctly! Thanks

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: Issues with Mount Points
« Reply #14 on: September 06, 2021, 09:00:20 AM »
Thanks for confirming it.