Author Topic: Questions about "type" and "scope" when editing enemy AI.  (Read 3056 times)

quantumpencil

  • *
  • Posts: 72
    • View Profile
Since the original version of this post, I've gotten much better at handling types using this assembly style programming language (Too used to text editors and loosely typed languages, so most of my hojo script worked fine after I fixed typing problems.)

There are a few outstanding things that annoy me. I was trying to implement a Swallow/Regurgitate mechanic for the Land worm enemy last night using the imprisoned status. I had it counter with an attack that causes imprison and deactivate the target masks script. Then I copied the target mask into self.4300 for later use (I also tried storing in it in a local variable.) Later on, after a counter in main had incremented to five, I instructed it to re-target self.4300 , remove imprison, and re-enable its script.

It just didn't work at all. Despite literally using the same code Carry Armor uses, the land worm constantly seemed to get confused and end up targeting the wrong enemy with regurgitate, as though the script wasn't able to modify the value at self.4300. I understand what a 0x value is, and I've been operating under the assumption that 1x value is an address that stores a 0x value -- but I read through the wiki and there was a mention of scope, so I'm wondering if that may have been my issue.

Can some explain in detail the "scope" of address types 10, 11, 12, and 13? Which ones can be modified during what parts of a script?

Best,

QP
« Last Edit: 2014-12-12 03:02:51 by quantumpencil »

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: Anyone want to help me debug my new AI script for H0512?
« Reply #1 on: 2014-12-01 17:19:48 »
If you wish to share state between multiple actors in a battle, you should use the battle variable block. This is what the Manholes use to copy their stats across to one another.

I can't remember if there are any restrictions on pushing and pulling from the global vars. Possibly writes to the globals are not synchronous and are only performed at the end of battle. Someone else will know better.
« Last Edit: 2014-12-02 23:41:25 by Bosola »

quantumpencil

  • *
  • Posts: 72
    • View Profile
Re: Anyone want to help me debug my new AI script for H0512?
« Reply #2 on: 2014-12-06 05:04:17 »
Forgive me, but what is the battle block? Is that a special set of addresses for storing variables accessible to all actors in a battle?

Which addresses are included in the battle block? A look through the Manhole scripts seems to suggest 21A0 is one such address. Are there others?

Best,

QP