by rld » Wed Apr 15, 2009 11:30 am
Chris H wrote:MAPTAKE would be the preferred method for removing a creature. MAPSET will replace the top object in the stack (which can destroy a creature) and MAPADD will put something on top of it. Note you can use MAPTAKE and MAPADD together to manually move a creature, that's how I did the before-and-after Julia and Shamino in U4PART2. (Treat it as object #255 and preserve the D value with MAPCHKD, MAPSETD) I'm not sure if this is a practical way to manually control the pathing of NPCs -- probably not -- but it's a handy way to make them disappear or appear (by moving them from somewhere inaccessible) as required.
4. Yes, creatures will appear as object 255, so a MAPCHK would return 255. And MAPCHKD would return the creature instance number.
ALL RIGHT!!! That is amazingly useful - I didn't know creatures showed up as objects on the stack at all! I assume the instance number points into a table of some sort (like with portals?) where each region has one table. I am also guessing that having more than one creature with the same instance number would be a Very Bad Thing and should be avoided.
So, that means a macro can tell if a creature exists in a certain space and move a creature from one spot to another. It can't create creatures, but the wandering life feature can be used to generate new creatures as needed, so this isn't too much of a problem. We can also destroy a creature, or at least send it to 'limbo' indefinitely.
The only thing the macro can't do at this point is tell what type of creature is on a given space, or alter the creature's HP. But if we have the instance number for a creature, maybe a future patch could add in a couple of arrays to let these values be accessed from macros? (hint, hint)
Something like
CRHP[x] - read/write creature instance X's hit point value
CRTYP[x] - read-only; return the creature number (type) for creature instance x.
That way, you could have things like a spell that only affects certain types of creatures.
[quote="Chris H"]MAPTAKE would be the preferred method for removing a creature. MAPSET will replace the top object in the stack (which can destroy a creature) and MAPADD will put something on top of it. Note you can use MAPTAKE and MAPADD together to manually move a creature, that's how I did the before-and-after Julia and Shamino in U4PART2. (Treat it as object #255 and preserve the D value with MAPCHKD, MAPSETD) I'm not sure if this is a practical way to manually control the pathing of NPCs -- probably not -- but it's a handy way to make them disappear or appear (by moving them from somewhere inaccessible) as required.
4. Yes, creatures will appear as object 255, so a MAPCHK would return 255. And MAPCHKD would return the creature instance number.[/quote]
ALL RIGHT!!! That is amazingly useful - I didn't know creatures showed up as objects on the stack at all! I assume the instance number points into a table of some sort (like with portals?) where each region has one table. I am also guessing that having more than one creature with the same instance number would be a Very Bad Thing and should be avoided.
So, that means a macro can tell if a creature exists in a certain space and move a creature from one spot to another. It can't create creatures, but the wandering life feature can be used to generate new creatures as needed, so this isn't too much of a problem. We can also destroy a creature, or at least send it to 'limbo' indefinitely.
The only thing the macro can't do at this point is tell what type of creature is on a given space, or alter the creature's HP. But if we have the instance number for a creature, maybe a future patch could add in a couple of arrays to let these values be accessed from macros? (hint, hint)
Something like
CRHP[x] - read/write creature instance X's hit point value
CRTYP[x] - read-only; return the creature number (type) for creature instance x.
That way, you could have things like a spell that only affects certain types of creatures.