FOnline Development > Questions and Answers

Create a turn based map?

<< < (2/2)

KingR:
I found this :

You can collect all town Locations inside start() function and set turn based mode for every Map inside. Assuming that every town exists only in one copy:
Code:
array<uint> tbTowns = { LOCATION_Den, LOCATION_Klamath, LOCATION_Whatever };
for( uint t=0, tLen=tbTowns.length(); t<tLen; t++ )
{
    Location@ location = GetLocationByPid( tbTowns[t], 0 );
    if( valid(location) )
    {
        for( uint m=0, mLen=location.GetMapCount(); m<mLen; m++ )
        {
            Map@ map = location.GetMapByIndex(m);
            if( valid(map) )
            {
                map.SetTurnBasedAvailability( true );
            }
        }
    }
}

But I don't know where I can use this code, in main.fos for example?

Thanks for your patience x)

Navigation

[0] Message Index

[*] Previous page

Go to full version