On Thu, Sep 29, 2011 at 12:32:20PM -0700, Adam Perry wrote:
> On Thu, Sep 29, 2011 at 11:55 AM, Adam Perry <[email protected]> wrote:
> > On Thu, Sep 29, 2011 at 11:26 AM, Adam Perry <[email protected]> wrote:
> >> I'd like to add in a few more plotscripting commands, but I'm not sure
> >> what files need to be changed. The obvious one is plotscr.hsd, and I'm
> >> sure I can figure out what to do there, but what other files are
> >> involved?
> >>
> >> I'm not looking to do anything complicated; just getters/setters for
> >> things like door position and enemy attacks.
> >>
> >
> > Actually, some research shows that enemy attacks are already exposed
> > (albeit via the arcane "read enemy data" command). So that's one down.
> >
> 
> And now I've hit another brick wall. James! Why did you split attack
> captions into two different files! And why isn't "read attack caption"
> already a thing! I don't understand the semantics of
> "readbadgenericname" and I'm not sure I want to. My guess is that
> readbadgenericname(index, game + ".dt6", 19, 37, 38, 1) would work if
> they were actually one file, but since they aren't, it won't. I
> suppose I could use "read enemy data" for this, too, if I were insane.
> 
> The door getters look a little more reasonable, so I guess I'll start there.


Attack data is split between two files because of poor planning and my 
own lack of data-format design skill.

DT6 was the origial data lump for attacks. I gave it an arbitrary record 
size. Later, when the records were all full, rather than trying to 
figure out a scheme for cleanly resizing records, I added a second 
parallel file, attacks.bin, also with an arbitrary record size. That 
madness is what inspired the later feature of the binsize.bin lump and 
the scheme for safely enlarging record sizes in binary lumps.

Fortunately, the loadattackdata() sub in loading.bas transparently 
combines the data records from dt6 and attack.bin so you don't need to 
care about the fact that the attack caption is split between the two 
files.

Also, take a look at convertattackdata() also found in loading.bas
It takes the attack data as an array and converts it into a user defined 
type, so it will be easy to see there how to read the description 
string.

---
James
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to