Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - P3k

Pages: [1]
1
Hey,
I didn't want to necro this post: https://forums.qhimm.com/index.php?topic=16079.msg226836#msg226836 so thought I'd make a new one.

I hope anyone can help me understand specifically what NFITC1 means about the bubble sort and field / battle condition.

If I do the bubble sort based on the field condition, I do not get the same results as the game.

Can someone please explain how NFITC1's answer would function? Do I check the condition once then BS from there or am i missing something?

Here's my code;

Code: [Select]
for (var i = player.inventory.items.Length; i > 0; i--)
{
  for (var j = player.inventory.items.Length - 1; j >= 0; j--)
  {
    if (j != 0)
    {
      var i1 = player.inventory.items[j];
      var i2 = player.inventory.items[j - 1];

      var swapID = ShouldSwap(i1, i2);

      if (swapID == 1)
      {
        player.inventory.items[j] = i2;
        player.inventory.items[j - 1] = i1;
      }
    }
  }
}

private static int ShouldSwap(
  Player.PlayerInventory.InventoryItem item1,
  Player.PlayerInventory.InventoryItem item2)
{
  if (item1.sortTag.Contains(SortingTag.Field))
  {
    return item2.sortTag.Contains(SortingTag.Field) ?0 : 1;
  }
  else
  {
    return item2.sortTag.Contains(SortingTag.Field) ?-1 : 0;
  }
}

Cheers

2
WIP / FF7 PSX HD Remake in Unity
« on: 2020-10-28 00:31:21 »
Hi peeps!,

I have been developing for funzies a remake of FF7. So far its only really consists of Materia and the Materia menu.
I'm using the mechanics guides written by Terence Fergusson.
I've used my own environment models and textures, where everything else is ripped from the PSX version.

Check out my first demo video: https://www.youtube.com/watch?v=-jXsGS_P7TM
Let me know what you guys think  8)

Pages: [1]