Replace Tiles

Everything related to modding

Replace Tiles

Postby freecan » Sun Jan 14, 2018 4:23 pm

background:
for the sailable ship mod, we cannot update an id multiple times per run; i.e.

update to:
Code: Select all
{
  targetId: *tl-river
  data:
  {
    moveCost: 1
  }
}

then update back to original:
Code: Select all
{
  targetId: *tl-river
  data:
  {
    moveCost: -1
  }
}


so instead I thought to extend the river tile, change the move cost, and replace the tiles on the map with the fake river tiles; and when I want to stop sailing, I replace all the fake river tiles with the original river tiles again.

Replacing every tile on the map damages performance a little. Is there instead a way to replace the tiles without scanning in a radius like below?
Code: Select all
{
  id: evt-mount-ship
  actionText: txt-evt-mount-ship
  replaceTiles:
  [
    {
      radius: 9001, old: tl-river, new: tl-river-fake
    }
  ]
}
freecan
 
Posts: 6
Joined: Tue Jan 09, 2018 10:39 pm

Re: Replace Tiles

Postby Johannes.K » Sun Jan 14, 2018 6:47 pm

I don't know of another way to do what you want to do without using the replaceTiles with a big radius as you suggest in your post. However, I've been wanting to change values of tiles on the fly myself as well. Maybe we can imlement this instead of findig a more performance friendly hack...
User avatar
Johannes.K
Curious Dev
Curious Dev
 
Posts: 94
Joined: Tue Nov 25, 2014 5:03 pm
Location: Berlin


Return to Modding

Who is online

Users browsing this forum: No registered users and 2 guests
cron