User Tag List

Results 1 to 10 of 11

Thread: Arrays of Arrays

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Keese Just registered
    Join Date
    Jan 2018
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    315
    Level
    6
    vBActivity - Bars
    Lv. Percent
    49.52%
    Sorry for my arrogance about saying I was right about what I wrote. It was just an example that I knew was fake so I wrote it up like array[][]=Set whatever on accident. In the meanwhile I was busy halfway through a script that actually works.
    I realized the mistake I made and meant this:
    //A variable int that is an array of several other arrays.
    int ComboData[128][176];
    //initialize all variables
    for(int screen=0;screen<=127;screen++)
    {
    for(int comboposition=0;comboposition<=175;comboposition++ )
    {
    ComboData[screen][comboposition];
    }
    }
    void SaveMapComboData()
    for(int screen=0;screen<=127;screen++)
    {
    for(int comboposition=0;comboposition<=175;comboposition++ )
    {
    for(int x=0;x<=256;x+=16)//skips every 16 pixels
    {
    for(int y=0;y<=176;y+=16)//skips every 16 pixels
    {
    ComboData[screen][comboposition]=Game->GetComboData(Game->GetCurMap(),screen,comboposition);
    }
    }
    }
    }
    //then afterwards
    void WriteMapComboData()
    for(int screen=0;screen<=127;screen++)
    {
    for(int comboposition=0;comboposition<=175;comboposition++ )
    {
    for(int x=0;x<=256;x+=16)//skips every 16 pixels
    {
    for(int y=0;y<=176;y+=16)//skips every 16 pixels
    {
    Game->SetComboData(Game->GetCurMap(),screen,comboposition,ComboData[screen][comboposition]);
    }
    }
    }
    }

    Anyway, I wrote a series of arrays for every screen on the map of size 176 integers a piece to achieve saving the state of the map and reloading it..

    Here is an example video of what it would be used for, aside from a player option of Save/Load live in ZC, it would replenish combos that were used in my scrolling scripts, because essentially the code erases them off of the given map when picked up/sword slashed, and then the array calls put them back upon entering a different section of the map.
    https://youtu.be/ulIZeH9ZxX0

  2. #2
    Keese Just registered
    Join Date
    Jan 2018
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    315
    Level
    6
    vBActivity - Bars
    Lv. Percent
    49.52%
    Also, I'm still looking for that edit button and it just isn't there..
    Another thing, I wrote the staff here at AGN about password recovery and my loss of access to my old email address that I no longer have.. Is there any way I could get my old account activated again and reset the password. Old screen name "Zim."

  3. #3
    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,765
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.74%
    Quote Originally Posted by Downloader View Post
    Also, I'm still looking for that edit button and it just isn't there..
    Another thing, I wrote the staff here at AGN about password recovery and my loss of access to my old email address that I no longer have.. Is there any way I could get my old account activated again and reset the password. Old screen name "Zim."
    You might not be able to edit posts until your post count is > n, or you have been a member for n-days. @Chris Miller might know about this one. I'm not sure.

    The maximum size for a single array is 214748. The ZC system limits are often defined in std_constants.zh, particularly in 2.53.0b+.

  4. #4
    Octorok Asuna Yuuki Nagato's Avatar
    Join Date
    Jan 2024
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    34
    Level
    2
    vBActivity - Bars
    Lv. Percent
    24%
    Quote Originally Posted by ZoriaRPG View Post
    The maximum size for a single array is 214748.
    Where did this magic number come from?

  5. #5
    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,961
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.44%
    Quote Originally Posted by jeffythedragonslayer View Post
    Where did this magic number come from?
    It's 100% magical like pixies and unicorns.

    Step 1: take the number (2^31) -1
    Step 2: ???
    Step 3: profit.




    *Note profit = dividing by 10,000. (it's a psuedo-fixed number hack that may or may not of been the best idea at the time (2006?).)
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

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