User Tag List

Results 1 to 10 of 22

Thread: NPCs fail to appear after writing new values to the packfile.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,962
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.52%
    The tables have nothing to do with corrupted data though.

    Have a look at some specs for the c language aggregate initialization rules: https://msdn.microsoft.com/en-us/library/81k8cwsz.aspx

    The scriptdefense array at the end will be zero initialized.


    [edit] Also, I have to ask it, (sorry if it seems obvious to you, just trying to help) not trying to sound like a ass or anything: Without properly reading the version correctly you'll never be able to read/write a quest file without it becoming corrupted. This is because without it you introduce a "chicken and egg" logic bug regardless. The only way around this is to compile two versions, one for saving and one for loading.
    Last edited by Gleeok; 12-19-2016 at 01:48 AM.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #2
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,766
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.9%
    Quote Originally Posted by Gleeok View Post
    The tables have nothing to do with corrupted data though.

    Have a look at some specs for the c language aggregate initialization rules: https://msdn.microsoft.com/en-us/library/81k8cwsz.aspx

    The scriptdefense array at the end will be zero initialized.

    I was lookin at comments like this, and I wasn't sure if that dat table needed me to reserve the space; as this is the case for many entries, even with zero'd fields.

    Code:
    bool reset_guys()
    {
        // The .dat file's guys definitions are always synchronised with defdata.cpp's - even the tile settings.
        init_guys(V_GUYS);
        return true;
    }
    Things like this tend to make me consider that proper synchronisation is mandatory at all times, and that the fields are explicitly prepared.

    [edit] Also, I have to ask it, (sorry if it seems obvious to you, just trying to help) not trying to sound like a ass or anything: Without properly reading the version correctly you'll never be able to read/write a quest file without it becoming corrupted. This is because without it you introduce a "chicken and egg" logic bug regardless. The only way around this is to compile two versions, one for saving and one for loading.
    No, that's something that I need to know. Could you expand on that, and specify: By version, do you mean the defined ZC version, V_GUYS, or something else? Have I done this somewhere, that you have observed?

    Tell me this though: Why is expanding the enum with defLAST alone enough to corrupt this, when everything that thie packfile and editor generation code does relies on s size read fro this entry's placement?

    If I add defs to the enum before edefLAST, and compile, with no other changes, the corruption still occurs. Is there anything with an explicit size that I missed? i simply fail to believe that the code can't resize itself around this, unless it's because it is shifting the values and the code isn't adaptive enough to comply. Even so, if it shifts the values, I'd expect it to mismatch when reading another quest, not the quest in memory, which is what led me to believe that the default values from defdata were involved.

    Also, you said that the latest guyversion is 24, but in zdefs, it was 24 without my intervention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social