Void error
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Chark

I keep running in to the error (something like) "void is not a string or identifier". It seems to happen once i add flags to a map. It doesn't make sense to me since void is a command to add functions to the map. Any suggestions?

Posted on 2014-07-27 16:20:44

Frozenskin

Are you using "void" as the name of the function triggered by an object in Map3d? If yes, remove that. It only needs the name of the function (and "void", "string" or "int" isn't).

Posted on 2014-07-27 18:03:08

mcgrue

Could you post the code in question to a pastebin and share it here?

Posted on 2014-07-27 18:34:21

Chark

Thanks for the reply. Here is code from one map.

 void MapInit()
{
        hookRetrace("tick");
        if(flag[Flag_Test] == 1)
        EntityMove(4,"L2 D2");
        if(flag[Flag_Test] == 1)
        EntityMove(3,"U4 R2");
        SetPlayer(player);
        onMapLoaded();
        }
 
void ZonetoTutorial()
{
        mapswitch("tutorial.map", 7, 6, "R", TRANS_BOX);
}
 
void ZoneToForestBuilding1()
{
        mapswitch("ForestMapBuildings.map", 11, 17, "U", TRANS_BOX);
}
void ZoneToForestBuilding2()
{
        mapswitch("ForestMapBuildings.map", 36, 19, "U", TRANS_BOX);
}
 
void ZoneToForestBuilding3()
{
        mapswitch("ForestMapBuildings.map", 17, 42, "U", TRANS_BOX);
}
void SignToDrobieVillage()
{
        TextBox("", "To Drobie Village","","");
}
void SignToMordicValley()
{
        TextBox("", "To Mordic Valley","","");
}
void SignToDarkweedForest()
{
        TextBox("", "To Darkweed Forest","","");
}
 
void TalkToSteve()
{
        TextBox("", "Darkweed Forest is full of snakes.","Don't say I didn't warn you.", "");
}
 
void ZoneToCharksPlace()
{
        mapswitch("CharksPlace(B).map", 33, 8, "L", TRANS_BOX);
}
void NorthZoneToDarkweedForest()
{
        mapswitch("DarkweedForest.map", 0, 16, "R", TRANS_BOX);
}
 
void SouthZoneToDarkweedForest()
{
        mapswitch("DarkweedForest.map", 0, 90, "R", TRANS_BOX);
}
void ZonetoDrobieVillage()
{
        mapswitch("DrobieVillage.map", 39, 49, "U", TRANS_BOX);
}
void TalktoHamilton1()
{
        if(flag[Flag_Hamilton1] == 0) {
                flag[Flag_Hamilton1] = 1;
        } else {
       
        if(flag[Flag_Test] == 0) {
        TextBox("", "Go away! I wont let you cross.", "", "");
 
        } else {
 
        if(flag[Flag_Test] == 1) {
        flag[Flag_Hamilton1] = 1;
        TextBox("", "You are a smelly rat!", "", "");
}
void test1()
{
        MessageBox("test..");// It wont let me add this or any additional void commands//
}

Posted on 2014-07-27 20:30:35

Chark

The exact error message is:
"ForestMap.vc(80): "void" is not a recognized keyword or identifier!

Posted on 2014-07-27 20:51:10

Chark

Disregard, problem solved. I had too many braces {.

Posted on 2014-08-10 19:15:39


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.