Write Beyond Allowed Access Area???

Non-platform specific questions.

Write Beyond Allowed Access Area???

Postby EvanBlack » Tue Oct 11, 2011 6:53 pm

What this is suppose to do is get the tile actor that is under all the other actors above it. But I keep getting a write error.

Code: Select all
void MoveFloorRight(int playerNode, int VIEW_MH, int VIEW_MW)
{
    Actor *MyActor;
    Actor *NotTile[100];
    int notTileCount = -1;
    int Stop_Loop;
    int tID;
    int i;
    char tAnim[20];
 
    for(i = (-VIEW_MH/2); i < VIEW_MH/2 +1; ++i)
    {
        tID = playerNode + (g_MapWidth * i) - VIEW_MW/2;
 
        MyActor=getactor(g_NodeWorldX[tID], g_NodeWorldY[tID]);
 
        Stop_Loop = 0;
        while((MyActor->name != "ISO_FloorTile" || MyActor->name != "SQ_FloorTile") && Stop_Loop < 10)
        {
            notTileCount = notTileCount + 1;   // This should equal 0 after first addition.
            NotTile[notTileCount] = MyActor;   //ERROR HERE
            ChangeZDepth(MyActor->clonename, 0);
            ChangeParent(MyActor->clonename, "none");
            MyActor=getactor(g_NodeWorldX[tID], g_NodeWorldY[tID]);
            ++Stop_Loop;
        }
 
 
 
        tID = tID + VIEW_MW;
        MyActor->x = g_NodeWorldX[tID];
        MyActor->y = g_NodeWorldY[tID];
        sprintf(tAnim, "tile%i", g_Map[g_NodeY[tID]][g_NodeX[tID]]);
        ChangeAnimation(MyActor->clonename,tAnim,NO_CHANGE);
    }
    for(notTileCount; notTileCount > -1; --notTileCount)
    {
        ChangeParent(NotTile[notTileCount]->clonename, "view");
    }
}
(\__/) ( 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: Write Beyond Allowed Access Area???

Postby jimmynewguy » Tue Oct 11, 2011 7:28 pm

Since I can't see your code in game without making some stuff making testing it hard, and this doesn't seem to be broken to me, I'll take a shot in the dark and say try just declaring notTileCount without setting it equal to anything (aka 0), and then in the while loop try doing notTileCount++; after NotTile[notTileCount] = MyActor; and seeing if it's just some sort of weird fluke or maybe the NotTile array isn't large enough....? Otherwise hopefully some smarter guy will figure it out if you can't on your own. Good luck with all this iso stuff you're doing!
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Write Beyond Allowed Access Area???

Postby EvanBlack » Tue Oct 11, 2011 9:20 pm

Edit: Nevermind, I figured out a new way to do it. instead of putting each individual actor on the bottom, I just move the view to the bottom and shift my tiles then bring the view back up. This same process would work for all actors.



The problem with doing it that way, which I did originally, is that I would then have to do a --notTileCount after the while loop. Its not exactly a problem but its just redundant..

basically the count has to increase before array, so that when the loop ends I don't have this

++notTileCount;
--notTileCount;

As I said its just redundant, and this loop will be happening for around 50+ times so then I have 100 redundant addition subtractions, that don't need to be there.

All the code in the function is all the code really, that function will work replacing the nodeworldX and nodeworldY with the current actors x,y positions, and view_mh ect.. with the size of the array that holds the actors.

If it makes it easier... here is the ged.
(\__/) ( 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


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest