Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

RPG in a Box

Bring your stories and ideas to life! · By Justin Arnold

[0.3.5.7] Navigation scripting issue

A topic by lectronice created Nov 05, 2016 Views: 75 Replies: 3
Viewing posts 1 to 4

Hi :)

I'm currently scripting various objects in my map, including a large curtain set up in three different parts. When you interact with any of the three parts, the central part plays an empty frame, and the two side parts play frames with folded versions of the curtain, so it gives the illusion of a double curtain which opens in the middle. The script also changes the navigation paths under the central part to allow the player's passage. It works fine, I can open and close the curtain and go through when it's open, but some adjacent tiles behave strangely. For some reason, while the player can follow a straight line through the central curtain part, he can't go on several adjacent tiles, but nothing in the script is supposed to change their navigation path.

Here's the script:

if global.property["curtain_1_open"] == false then
  play_animation(entity["curtain_1c"], "empty");
  play_animation(entity["curtain_1l"], "open");
  play_animation(entity["curtain_1r"], "open");
  modify_navigation("g_curtain_1s", "g_curtain_1c", 0);
  modify_navigation("g_curtain_1c", "g_curtain_1n", 0);
  set_global_property("curtain_1_open", true)
else
  play_animation(entity["curtain_1c"], "closed");
  play_animation(entity["curtain_1l"], "closed");
  play_animation(entity["curtain_1r"], "closed");
  modify_navigation("g_curtain_1s", "g_curtain_1c", 2);
  modify_navigation("g_curtain_1c", "g_curtain_1n", 2);
  set_global_property("curtain_1_open", false)
end

I'll post an animated a bit later so it should make more sense. But basically, the problem is some tiles become non-walkable for no apparent reason (but they get walkable again if the curtain is closed).

That is interesting, I'll have to see what I can figure out. If you're able to create a small example map to demonstrate that would be helpful as well.

Well, it was in fact a false alert, apparently unrelated to the script :) After a bit of investigation I removed every tile in the perimeter and discovered there were some hidden navigation paths overlapping the normal paths, but without being linked to any tile. My guess is these are some forgotten remnants of an old update you made months ago to fix some paths which were invisible or linked oddly, if I remember well. So back then, your update made visible most of these paths, but apparently I still have a few hidden things to fix here and there.

I managed to removed these floating paths by adding tiles at their level then removing all interaction between then. The strange thing is these paths were all "walk & interact", so they shouldn't have been a problem. But it doesn't matter, eveything works fine now :)

Okay, good to hear! :) I think I ran across a few of those in one of my older maps as well. Let me know if any invalid paths like that do happen to re-appear at any point.