Author Topic: Question about enemy away materia  (Read 5196 times)

JBedford128

  • *
  • Posts: 113
    • View Profile
Question about enemy away materia
« on: 2012-09-13 23:26:46 »
I basically want to create a no encounters Materia. But after looking in the kernel I realise that both enemy away and enemy lure use the same code. There are only two differences: one uses one stat-change (enemy away gives Luck+1), while the other uses another (enemy away gives Luck+2); and there is the other obvious difference of the ID they use. I am not sure how the game knows what to do with the Materia.

So instead I decided to just take the enemy away Materia and improve its functionality. A Level1 enemy away Materia has a value of 7, while a Level2 enemy away Materia has a value of 14.

However I have tried increasing this value to 254, 15, and 16... and nothing seems to make it work noticeably any better.

So what I want to know is: Is there a way to remove enemy encounters without having to edit all the field files. If not, is there a way to make enemy away more effective to remove a larger number of encounters. Any help would be appreciated.

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Question about enemy away materia
« Reply #1 on: 2012-09-14 00:31:38 »
enemy away, like all materia, has a limit of how much it can affect a specific variable
you need to wait for NFITC1 or read the wallmarket thread to find out more
no encounters you can achieve with a trainer. if you dont want that, you need to edit all field files
thats not THAT time intensive btw
arrow down, ctrl+n, uncheck box, press okay, repeat

JBedford128

  • *
  • Posts: 113
    • View Profile
Re: Question about enemy away materia
« Reply #2 on: 2012-09-15 00:10:05 »
Eh, I'll just do that then. It somehow never came to mind that I can create new groups and don't have to add that kind of stuff into main.

For anyone interested, I've set it up so at the start of the game talking to a dead guard once sets V[15/32]'s 0bit to 1 (and you obtain Potion), talking to one again sets V[15/32]'s 1bit to 1 (and you obtain Potion), and talking to them again sets V[15/32]'s 0bit back to 0, and you obtain a new special No Encounters Materia, and at the same time this will allow access to the Materia option in the menu, and the menu will automatically open. Quitting then deactivates the option.

Then in a new script which will go into almost every field files checks that V[15/32]'s 0bit is 0 and that the 1bit is 1 (this tells the script whether the Materia was obtained or not); and then it checks the amount of NoEncounters Materia in the inventory and stores the number in V[1/71] (if equipped, it will be 0-- also if sold or trashed it will be 0 but I won't do that). If the result is 0 then encounters will be disabled.

I could have done the same with an accessory, and then it couldn't be sold or trashed, but since it's for personal use it doesn't matter.

Also I chose V[1/71] because I believe it's the last byte in a set of eight reserved for key items, but never gets used because there aren't that many key items. I would have preferred to use one of the unused bits in the byte relating to the Kalm Traveler but I do not believe it is possible to store a boolean value based on whether there is a specific Materia in the inventory or not so I needed to use an entire byte.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Question about enemy away materia
« Reply #3 on: 2012-09-15 00:15:19 »
The game knows the difference because they're keyed by index. Not the best of practices, but that's how it works. Also, the cap is 85% reduction in encounters. Even if you maxed it out and equipped 48 of them you wouldn't get any higher than that.

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Question about enemy away materia
« Reply #4 on: 2012-09-15 00:20:05 »
I don't see why you're using such a roundabout way of doing this.
A much easier way is to add
"If key pressed start, if var x-x == 0, else
   disable random encounter
   assignment var x-x ==1
Activate random encounter
assignment var x-x == 0

voila, every time you press start you switch between encounter modes
this can be put in any main script, towards the end and works fine. no need for any items or materia or all that complicated stuff you have

JBedford128

  • *
  • Posts: 113
    • View Profile
Re: Question about enemy away materia
« Reply #5 on: 2012-09-15 00:40:23 »
I don't see why you're using such a roundabout way of doing this.
A much easier way is to add
"If key pressed start, if var x-x == 0, else
   disable random encounter
   assignment var x-x ==1
Activate random encounter
assignment var x-x == 0

voila, every time you press start you switch between encounter modes
this can be put in any main script, towards the end and works fine. no need for any items or materia or all that complicated stuff you have
The overly complicated stuff is because I was originally trying to have the effect in a Materia, and then forgot that I would no longer need to have the effect in a Materia if I will be editing all the field files anyway.

A benefit to using Materia is that Materia and equipment are what I go to tweak when I want something in the game changed. Although the Start button idea would make more sense. I'm going to do that. Thanks for the suggestion.

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Question about enemy away materia
« Reply #6 on: 2012-09-15 01:12:48 »
if you make the script slightly different, for example, if you put an additional var x-x == 1, disable random battle in every init s0 part of every field, it will disable encounters automatically until you push start