No Linked Lists in gE?

Non-platform specific questions.

Re: No Linked Lists in gE?

Postby EvanBlack » Sat Oct 15, 2011 7:14 pm

lol thanks. I thought of a better way to link them anyway, using Actor's clonename. This way you can make a linked list of actor clones which you could make functions to access their variables. I put the newest version in the Useful Functions thread.
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby skydereign » Sat Oct 15, 2011 9:47 pm

I think the problems are caused from the same problem in gE, but require different fixes. The comment problem is due to gE's parser, but won't fix the problems with the global Actor*s. So, I believe that using the getclone is the only fix.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: No Linked Lists in gE?

Postby EvanBlack » Sat Oct 15, 2011 10:33 pm

So the pointer to the Actor Structure doesn't work... but what if I was pointing to the individual variables of the actor's structure.

Not saying this would be useful as using getclone would be just as good I suppose..

But if I created another structure to act exactly like a Reference to an Actor for all the variables such as

Code: Select all
typedef struct RefActor{
    double * x;
    double * y;
    char * name;
    char * clonename;

    //ect..
    } RefActor;

RefActor * CurrentActor;

CurrentActor->x = &myActor->x;
CurrentActor->y = &myActor->y;
CurrentActor->name = &myActor->name;
CurrentActor->clonename = &myActor->clonename;
//ect..


ofcourse allocated the space for the stucture first...

Do you think that would allow updating of the variable?
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby skydereign » Sat Oct 15, 2011 10:38 pm

At that point I think you'll run into the other of gE's parse problems. So you'll need to add a comment with the actor's name, which is rather unfortunate since it limits how dynamic functions can be.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: No Linked Lists in gE?

Postby EvanBlack » Sat Oct 15, 2011 11:04 pm

So is the problem directly related to the actor structure? I mean it seems that way.. But the question is, does this problem effect global structures as well? If I use getclone() for updating actor variables will that eliminate the actor issue?

I am trying to figure out how to redesign my map editor to use structures and linked lists to allow for faster access of the map and shifting of the tiles. This will also allow for multi-layering of actors to allow z-depth calculating and movement, storage, and removal of used actors. I am trying to avoid all the known bugs but create something universal and powerful that shows off the best of gE. Its proving a fun and rewarding adventure.
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby skydereign » Sun Oct 16, 2011 12:37 am

The problem is with how gE deals with updating actors. It parses the event scripts (nothing global) and finds actor names. Any actor name found from parsing the script can be updated. Apparently this is to overcome some speed issues that gE has with the actor variables. The first ticket on sourceforge allows for a fix for this, but won't be implemented in 1.5, since it requires a pretty massive change. That being said, it turns out that using getclone fixes the first problem (similarly to how commenting the actor's name works). Only problem is that you need to be clone specific using Actor*s if there are clones.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: No Linked Lists in gE?

Postby EvanBlack » Sun Oct 16, 2011 8:17 am

im getting another Error trying to link my structs. This time.. this one makes NO sense...

Warning: Trying to convert from " *struct " to " *struct "

Code: Select all

//Structures
typedef struct WorldNode{
    double wn_GameX;
    double wn_GameY;
    int wn_NodeX;
    int wn_NodeY;
    int wn_NodeID;
    struct Tile *wn_pTile;
    struct FloatingTile *wn_pFTile;
    struct Creature *wn_pCreature;
    struct Object *wn_pObject;
    struct WorldNode *wn_pPrevYNode;
    struct WorldNode *wn_pNextYNode;
    struct WorldNode *wn_pPrevXNode;
    struct WorldNode *wn_pNextXNode;
}WorldNode;

typedef struct Tile{
    int t_Anim;
    int t_Unique;
    char t_CloneName[32];
    char t_Name[27];
    WorldNode* t_pWorldNode;
}Tile;


g_WorldNodeList[mh][mw]->wn_pTile = g_TileList[mh][mw]; // Doesn't work...

g_TileList[mh][mw]->t_pWorldNode = g_WorldNodeList[mh][mw]; // WORKS, same thing as above.



Appears to be I cannot use the pointer because the struct isn't defined until after... I guess I can work around it...
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby skydereign » Sun Oct 16, 2011 9:12 am

From the error, I'd say it was that problem about readding a script (same problem happens for me occasionally with getCloneIdx). Though I can't be sure as that isn't enough code to test.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: No Linked Lists in gE?

Postby EvanBlack » Sun Oct 16, 2011 5:26 pm

Well, I tested in my program by swapping the structs around. It seems that I can't point "Down" from another structure.

Basically, I can't go from WorldNode to TIle, or Tile to Creature.

I can only go from Tile to WorldNode, Creature to Tile. Which is going to make it difficult.


The code right now is sitting in my project code on my computer and I'm still phasing out the old method for this one. Its going to take me a while until I have presentable code, then I can work on trying to do this again, or just forgetting it if its not possible.
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby skydereign » Sun Oct 16, 2011 8:54 pm

I was creating a similar kind of system for a loz type game that I'm making. It used several structures to hold all of the game information, and I had no problem moving through the structs.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: No Linked Lists in gE?

Postby EvanBlack » Sun Oct 16, 2011 9:02 pm

huh... well once my code is cleaned up and I remove unnecessary code maybe we can find the problem. I am sure it has something to do with the way I coded it but I am not sure.

Its strange how some things work in one ged but don't work in another.
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby EvanBlack » Mon Oct 17, 2011 12:51 am

EvanBlack wrote:huh... well once my code is cleaned up and I remove unnecessary code maybe we can find the problem. I am sure it has something to do with the way I coded it but I am not sure.

Its strange how some things work in one ged but don't work in another.


Here is a clean copy of the code. I will separate it at the error so you don't have to sort through it all.
Code: Select all
//Structures
typedef struct WorldNode{
    double wn_GameX;
    double wn_GameY;
    int wn_NodeX;
    int wn_NodeY;
    int wn_NodeID;
    struct Tile *wn_pTile;
    struct FloatingTile *wn_pFTile;
    struct Creature *wn_pCreature;
    struct Object *wn_pObject;
    struct WorldNode *wn_pPrevYNode;
    struct WorldNode *wn_pNextYNode;
    struct WorldNode *wn_pPrevXNode;
    struct WorldNode *wn_pNextXNode;
}WorldNode;

typedef struct Tile{
    int t_Anim;
    int t_Unique;
    char t_CloneName[32];
    char t_Name[27];
    struct WorldNode* t_pWorldNode;
    struct Tile *t_pPrevY;
    struct Tile *t_pNextY;
    struct Tile *t_pPrevX;
    struct Tile *t_pNextX;
}Tile;


typedef struct FloatingTile{
    int ft_Unique;
    int ft_Anim;
    char ft_CloneName[32];
    char ft_Name[27];
    WorldNode* ft_pWorldNode;
}FloatingTile;
 
typedef struct Object{
    int o_Anim;
    char o_CloneName[32];
    char o_Name[27];
    WorldNode* o_pWorldNode;
    } Object;

typedef struct Creature{
    int cr_Anim;
    char cr_CloneName[32];
    char cr_Name[27];
    WorldNode* cr_pWorldNode;
    } Creature;



//IF YOU CHANGE MAPSIZE[] THEN YOU HAVE TO CHANGE cMAPSIZE TO EQUAL THAT AMOUNT IN TILES
//ALSO YOU HAVE TO EDIT YOUR MAP!!
const int g_SQVIEWMAPWIDTH = 5;
const int g_SQVIEWMAPHEIGHT = 5;
const int g_ISOVIEWMAPWIDTH = 35;
const int g_ISOVIEWMAPHEIGHT = 35;
const int g_SQTILESIZE[2] = {100, 100};
const int g_ISOTILESIZE[2] = {64, 32}; //size of each tile. W x H
const int g_UNREACHABLETILE = 255; //The start of the unwalkable tile animation

int g_MapHeight = 0;
int g_MapWidth = 0;
int g_MapSize = 0; //Amount of tiles to be created

int g_Move[4];


//2D Pointer Arrays for Structures
WorldNode *** g_WorldNodeList;
Tile *** g_TileList;


//2D array
int ** g_Map;

Tile *g_FirstTile, *g_LastTile;



//MISC variables
int g_TileClicked;
int g_Saved = 0;
int g_TextCloneCount = 0;
int g_ToggleGUI = 1;
int g_ToggleTP = 0;
int g_ToggleOP = 0;
int g_CurrentSelectedTile = 0;
int g_CurrentSelectedObject = 0;
int g_setTile = 0;



//Function Declarations
//MOVE VIEW
void MoveFloorRight(int playerNode, int VIEW_MH, int VIEW_MW);
void MoveFloorLeft(int playerNode, int VIEW_MH, int VIEW_MW);
void MoveFloorDown(int playerNode, int VIEW_MH, int VIEW_MW);
void MoveFloorUp(int playerNode, int VIEW_MH, int VIEW_MW);

//MAP CREATION
void CreateMap();
void CreateMapIso();
int GenerateMap();
void initalizeTile(Tile *pTile);
void initalizeWorldNode(WorldNode *pWorldNode);




//MISC
int GetNodeIDFromXY(int x, int y);
int GetAIIDFromNode(int tID);
int GetAIIDFromXY(int x, int y);
void UpdateText(char string[40], int i);
void UpdateTileActor(Actor* pActor, Tile* pTile);
void FreeMemory();
void PlaceTile(Actor* pTile, int nID);
Actor* getTileByNode(int node);
void MoveTileToArray(Actor* myActor);




//This is all the game data variables.



///////////////////////////////////////////////////////////////////////////////////////////////
//ALL FUNCTIONS BELOW

///////////////////////////////////////////////////////////////////////////////////////////////

void CreateMapIso()
{
 int mh=0;
 int mw=0;
 int tX = 0;
 int tY = 0;
 int tNum = 0;
 int tH = g_ISOTILESIZE[1];
 int tW = g_ISOTILESIZE[0];
 char tAnim[10];
 Actor* myActor = 0;
 
 g_FirstTile = g_TileList[0][0];
 


for(mh = 0; mh < g_MapHeight; ++mh)
 {
    for(mw = 0; mw < g_MapWidth; ++mw)
    {
 
        tX = (tW/2 * mw)+ tW + (tW/2 * mh);
        tY = (tH/2 * mh)-(tH/2 * mw);
 
        g_WorldNodeList[mh][mw]->wn_GameX = tX;
        g_WorldNodeList[mh][mw]->wn_GameY = tY;
        g_WorldNodeList[mh][mw]->wn_NodeX = mw;
        g_WorldNodeList[mh][mw]->wn_NodeY = mh;
        g_WorldNodeList[mh][mw]->wn_NodeID = tNum;
        //g_WorldNodeList[mh][mw]->wn_pTile = g_TileList[mh][mw];  //This is the erroring line

        tNum = tNum +1;
 
    }
 }
Code: Select all
 for(mh = 0; mh < g_ISOVIEWMAPHEIGHT; ++mh)
 {
     for(mw = 0; mw < g_ISOVIEWMAPWIDTH; ++mw)
     {
 
         tX = (tW/2 * mw)+ tW + (tW/2 * mh);
         tY = (tH/2 * mh)-(tH/2 * mw);
 
 
         sprintf(tAnim, "tile%i", g_Map[mh][mw]);
         myActor = CreateActor("ISO_FloorTile", tAnim, "no parent", "no path", tX, tY, true);
         MoveTileToArray(myActor);
         strcpy(g_TileList[mh][mw]->t_Name, myActor->name);
         strcpy(g_TileList[mh][mw]->t_CloneName, myActor->clonename);
         g_TileList[mh][mw]->t_Anim = g_Map[mh][mw];
         g_TileList[mh][mw]->t_pWorldNode = g_WorldNodeList[mh][mw];
 
 
 

         myActor->a_nX = g_TileList[mh][mw]->t_pWorldNode->wn_NodeX;
         myActor->a_nY = g_TileList[mh][mw]->t_pWorldNode->wn_NodeY;
         myActor->a_nID = g_TileList[mh][mw]->t_pWorldNode->wn_NodeID;
 
 
 
     }
 }
 g_LastTile = g_TileList[mh-1][mw-1];

  CreateActor("MiddlePoint", "Pointer", "no parent", "no path", 0, 0, true);
  //ChangeParent("view", "MiddlePoint");
}


////////////////////////////////////////////////////////////////////////////////////////////////////

void MoveFloorRight(int playerNode, int VIEW_MH, int VIEW_MW)
{
    Actor *MyActor;
    Actor *Doodad;
    int tID;
    int i;
    int o;
    char tAnim[20];
 
    for(i = (-VIEW_MH/2); i < VIEW_MH/2 +1; ++i)
    {
        tID = playerNode + (g_MapWidth * i) - VIEW_MW/2;
 
 
 
        MyActor=getclone(getTileByNode(tID)->clonename);
 
        tID = tID + VIEW_MW;
        //UpdateTileActor();
 
        //sprintf(tAnim, "tile%i", g_Map[g_NodeY[tID]][g_NodeX[tID]]);
        //ChangeAnimation(MyActor->clonename,tAnim,NO_CHANGE);

    }
 
}


void MoveFloorLeft(int playerNode, int VIEW_MH, int VIEW_MW)
{
    Actor *MyActor;
    Actor * Doodad;
    int tID;
    int i;
    int o;
    char tAnim[20];
 
    for(i = (-VIEW_MH/2); i < VIEW_MH/2 +1; ++i)
    {
        tID = playerNode + (g_MapWidth * i) + VIEW_MW/2;
 
 
 

    }
}


void MoveFloorDown(int playerNode, int VIEW_MH, int VIEW_MW)
{
    Actor *MyActor;
    Actor * Doodad;
    int tID;
    int i;
    int o;
    char tAnim[20];
 
    for(i = (-VIEW_MW/2); i < VIEW_MW/2 +1; ++i)
    {
        tID = playerNode + (g_MapWidth*(-VIEW_MH/2)) + i;
 
    }
 
}


void MoveFloorUp(int playerNode, int VIEW_MH, int VIEW_MW)
{
    Actor *MyActor;
    Actor * Doodad;
    int tID;
    int i;
    int o;
    char tAnim[20];
    for(i = (-VIEW_MW/2); i < VIEW_MW/2 +1; ++i)
    {
        tID = playerNode - (g_MapWidth*(-VIEW_MH/2)) + i;

 
 
    }

}
////////////////////////////////////////////////////////////////////////////////////////////////////
int GenerateMap()
{
    int i;
    int a;
 
    if(!g_MapHeight || !g_MapWidth || g_MapSize)
    {
        return 1;
    }
    g_MapSize = g_MapHeight * g_MapWidth;
 
 
    //Allocate memory for 2D array g_Map
    g_Map = malloc(g_MapHeight * sizeof(int *));
      if(g_Map == NULL)
        {
       UpdateText("ERROR: OUT OF MEMORY", 0);
       g_MapSize = 0;
           return 1;
      }
      for(i = 0; i < g_MapHeight; i++)
        {
            g_Map[i] = malloc(g_MapWidth * sizeof(int));
            if(g_Map[i] == NULL)
              {
            UpdateText("ERROR: OUT OF MEMORY", 0);
            g_MapSize = 0;
            return 1;
              }
        }


    //Allocate memory for 2D array g_WorldNodeList
    g_WorldNodeList = malloc(g_MapHeight * sizeof(WorldNode **));
      if(g_WorldNodeList == NULL)
        {
       UpdateText("ERROR: OUT OF MEMORY", 0);
           return 1;
      }
      for(i = 0; i < g_MapHeight; i++)
        {
            g_WorldNodeList[i] = malloc(g_MapWidth * sizeof(WorldNode*));
            if(g_WorldNodeList[i] == NULL)
              {
            UpdateText("ERROR: OUT OF MEMORY", 0);
            return 1;
              }
 
        }
    for(i = 0; i < g_MapHeight; i++)
        {
        for(a = 0; a < g_MapWidth; a++)
            {
                g_WorldNodeList[i][a] = (WorldNode *)malloc(sizeof(WorldNode));
                if(g_WorldNodeList[i][a] == NULL)
                  {
                UpdateText("ERROR: OUT OF MEMORY", 0);
                return 1;
                  }
            initalizeWorldNode(g_WorldNodeList[i][a]);
            }
    }


    //Allocate memory for 2D array g_TileList
    g_TileList = malloc(g_MapHeight * sizeof(Tile **));
      if(g_TileList == NULL)
        {
       UpdateText("ERROR: OUT OF MEMORY", 0);
           return 1;
      }
      for(i = 0; i < g_MapHeight; i++)
        {
            g_TileList[i] = malloc(g_MapWidth * sizeof(Tile*));
            if(g_TileList[i] == NULL)
              {
            UpdateText("ERROR: OUT OF MEMORY", 0);
            return 1;
              }
        }
    for(i = 0; i < g_MapHeight; i++)
        {
        for(a = 0; a < g_MapWidth; a++)
            {
                g_TileList[i][a] = (Tile *)malloc(sizeof(Tile));
                if(g_TileList[i][a] == NULL)
                  {
                UpdateText("ERROR: OUT OF MEMORY", 0);
                return 1;
                  }
            initalizeTile(g_TileList[i][a]);
            }
    }



 
 
    UpdateText("GENERATED MAP, NUMBER OF TILES:", g_MapSize);
 
    return 0; //If failed return 1; If completed return 0;
}


void FreeMemory()
{
    int i;
    int a;
    for(i = 0; i < g_MapHeight; i++)
    {
        free(g_Map[i]);
    }
 
    for(i = 0; i < g_MapHeight; i++)
    {
        for(a = 0; a < g_MapWidth; a++)
        {
            free(g_WorldNodeList[i][a]);
        }
        free(g_WorldNodeList[i]);
    }
 
    for(i = 0; i < g_MapHeight; i++)
    {
        for(a = 0; a < g_MapWidth; a++)
        {
            free(g_TileList[i][a]);
        }
        free(g_TileList[i]);
    }
    free(g_TileList);
    free(g_WorldNodeList);
    free(g_Map);
    UpdateText("Memory Freed", 0);
 
}
////////////////////////////////////////////////////////////////////////////////////////////////////

void UpdateText(char string[40], int i)
{
    Actor* NewText;
    Actor* OldText;
    char buffer[20];
    sprintf(buffer, "UPDATESTATUSTEXT.%i", g_TextCloneCount);
    OldText = getclone(buffer);
    ++g_TextCloneCount;
    NewText = CreateActor("UPDATESTATUSTEXT", "", "view", "no path", OldText->x, OldText->y+15, false);
 
    if(!i)
    {
        strcpy(NewText->text, string);
    }
    else
    {
        sprintf(NewText->text, "%s %i", string, i);
    }
 
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/*
void PlaceTile(Actor* pTile, int nID)
{
    char tAnim[20];
    sprintf(tAnim, "tile%i", g_CurrentSelectedTile );
    ChangeAnimation(pTile->clonename,tAnim,NO_CHANGE);
    if(nID != -1){ g_Map[g_NodeY[nID]][g_NodeX[nID]] = g_CurrentSelectedTile; }
}
*/
////////////////////////////////////////////////////////////////////////////////////////////////////
void initalizeTile(Tile *pTile)
{
    pTile->t_Anim = 0;
    pTile->t_Unique = 0;
    strcpy(pTile->t_CloneName,"\0");
    strcpy(pTile->t_Name, "\0");
    pTile->t_pWorldNode = NULL;
    pTile->t_pPrevY = NULL;
    pTile->t_pNextY = NULL;
    pTile->t_pPrevX = NULL;
    pTile->t_pNextX = NULL;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
void initalizeWorldNode(WorldNode *pWorldNode)
{
    pWorldNode->wn_GameX = 0;
    pWorldNode->wn_GameY = 0;
    pWorldNode->wn_NodeX = 0;
    pWorldNode->wn_NodeY = 0;
    pWorldNode->wn_NodeID = 0;
    pWorldNode->wn_pTile = NULL;
    pWorldNode->wn_pFTile = NULL;
    pWorldNode->wn_pCreature = NULL;
    pWorldNode->wn_pObject = NULL;
    pWorldNode->wn_pPrevYNode = NULL;
    pWorldNode->wn_pNextYNode = NULL;
    pWorldNode->wn_pPrevXNode = NULL;
    pWorldNode->wn_pNextXNode = NULL;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
void UpdateTileActor(Actor* pActor, Tile* pTile)
{
    pActor->x = pTile->t_pWorldNode->wn_GameX;
    pActor->y = pTile->t_pWorldNode->wn_GameY;
    pActor->a_nX = pTile->t_pWorldNode->wn_NodeX;
    pActor->a_nY = pTile->t_pWorldNode->wn_NodeY;
    pActor->a_nID = pTile->t_pWorldNode->wn_NodeID;
}


////////////////////////////////////////////////////////////////////////////////////////////////////

void InitGame()
{
 
}

////////////////////////////////////////////////////////////////////////////////////////////////////



//CREATED BY EVAN BLACK, 2011
// www.game-editor.com/forum  USERNAME: EVANBLACK
Last edited by EvanBlack on Mon Oct 17, 2011 1:19 am, edited 1 time in total.
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby skydereign » Mon Oct 17, 2011 1:04 am

The only problem gE had with that code is that I didn't have actor variables for a_nX, a_nY, and a_nID. When I added that, there were no errors. Did you already fix the error?
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: No Linked Lists in gE?

Postby EvanBlack » Mon Oct 17, 2011 1:19 am

No I commented out the erroring code.

Code: Select all
        g_WorldNodeList[mh][mw]->wn_NodeID = tNum;
        //g_WorldNodeList[mh][mw]->wn_pTile = g_TileList[mh][mw];   //This is the erroring line.

        tNum = tNum +1;
(\__/) ( Soon... The world)
(O.o )< will be mine!____)
(> < )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bunny Overlord 2012!
EvanBlack
 
Posts: 202
Joined: Fri Sep 30, 2011 10:17 am
Score: 19 Give a positive score

Re: No Linked Lists in gE?

Postby skydereign » Mon Oct 17, 2011 1:49 am

Ok, the problem is that you need to declare your structs will exist, since they both reference the other. Just make the top like this, and it will work.
Code: Select all
//Structures
struct WorldNode;
struct Tile;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest