No more variables?
Displaying 1-11 of 11 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Time_Wizard

Okay, this is wierd.

I've reached a point where if I add just one more int declaration at the start of system.vc, things start happening in my game. Strange things. Things I don't like.

When I remove this variable and change nothing else (the code that uses it is commented out either way so the game will compile) the game runs fine and dandy.

Is there a maximum number of ints you're allowed to declare or something? If so how do I raise this number? Any idea what's going on?

Posted on 2006-02-28 01:10:25

Rysen

As far as I know, if there is a limit, it'd be really high and normally not something you would ever need to worry about. (I could be wrong here, though).

What would probably help is pasting your code, exactly as you have it when is starts doing the "strange stuff", as well as giving a bit of an explination as to what the "strange things" are. ^_^ Is it not compiling? Functions not working the way they're supposed to? Computer having a seizure? etc. etc.

It would certainly help narrow it down a bit. :)

Posted on 2006-02-28 03:40:29

Omni

I've run into similar problems before.

Here's the thing though: they seem to happen for no logical reason.

How large is your project? Try breaking it up into the component VC files, and running V3 with nothing but each individual VC file included. No need to play a game, just run at startup to make sure each file can compile.

Do this for each file to see if you can isolate the problem. Fix the individual file if so:

1. Search for any missing brackets.
2. Check the last lines of the file to make sure functions are closed, etc.

If you only seem to have the problem when you go back and include everything (but can't isolate the problem):

1. Try checking the #include flags. Yes, I know, obvious, but. At the point where the flag is, Verge parses the VC file (I believe).
2. So go the first lines of suspect VC files as well, and check for problems.

PARANOID solution (only do if manageable)
Wipe project clean (or create a duplicate) and slowly, one by one, re-import each individual function into a VC file, and compile to check if it works.


Most of the time, in your search to hunt the bug down, it will seemingly disappear. All I can say is, it's good when it does.



Also try to experiment. You say you can't insert another variable. But what if you create a new VC file with a declaration, and include that instead? Try to test the VC system to see what has broken and what is working.

Posted on 2006-02-28 10:41:25

Time_Wizard

Okay, when I tried making a new #included VC and declaring the variable in that, that made the problem go away.

I have no idea why, but it did. Thanks!

Posted on 2006-02-28 22:56:46

Rysen

Heh, strange indeed. I used to run into problems like that all the time with v2, but haven't had to deal with them in v3 yet. *shrugs*

Anyway, glad to hear you figured it out!

Posted on 2006-02-28 23:29:18

Time_Wizard

Just as a bit of a follow up, I think the problem is that Bad Things happen if you let system.vc get too big. When the problem arised again, I tried moving all functions besides autoexec to a different vc, and that fixed it.

Posted on 2006-03-10 22:25:26

jrhee

I just started having this problem too. I've only noticed it when I draw to the screen. I see a bunch of junk in certain sections of my screen that looks like TV static...

Now the stranger part is that I hit a button to run the function and it works as described above. Then I hit the button again to execute the exact same function, and it works perfectly fine the second time around. And it runs fine the third and fourth, etc times as well.

At no point in my function do I modify the values of any of my variables. I get the same exact behavior across differenty machines with different specs, every time I run the program.

I drop one int that does absolutely nothing, anywhere in my code, and I get this behavior. Then I remove it, and the bug is gone.

I've tried all the fixes proposed in this thread, but none of them seem to be working...

This thing is driving me nuts!

Posted on 2006-05-08 19:48:36 (last edited on 2006-05-08 19:53:10)

Overkill

Quote:Originally posted by jrhee

A few other things I've noticed:

1. When I declare the int locally, I don't get the same problem.

2. When I use #define rather than int, and call a function like so:

#define d 10;

void test(int x) {
// do stuff
}

void autoexec() {
test(d);
}


I get the error "Expecting ')' but got ';' instead." Now when I call test with a different, preexisting #define as the parameter, everything is fine.

3. When I add blank functions that do absolutely nothing to other vc files, the problem goes away. Then I add another int, and the problem comes back. Then I add another blank function, and the problem goes away...


Well, #defines aren't supposed to have semi-colons in them. That's your problem. So the compiler will put 10; inside of test(d); making it test(10;); See the problem? :D

Posted on 2006-05-08 20:56:41

Overkill

Quote:Originally posted by jrhee

A few other things I've noticed:

1. When I declare the int locally, I don't get the same problem.

2. When I use #define rather than int, and call a function like so:

#define d 10;

void test(int x) {
// do stuff
}

void autoexec() {
test(d);
}


I get the error "Expecting ')' but got ';' instead." Now when I call test with a different, preexisting #define as the parameter, everything is fine.

3. When I add blank functions that do absolutely nothing to other vc files, the problem goes away. Then I add another int, and the problem comes back. Then I add another blank function, and the problem goes away...


Well, #defines aren't supposed to have semi-colons in them. That's your problem. So the compiler will put 10; inside of test(d); making it test(10;); See the problem? :D

Posted on 2006-05-08 20:56:41

jrhee

Haha I'm an idiot... Been staring at this problem for way too long. . . . .

Posted on 2006-05-08 22:43:49

Interference22

Verge still has many quirks, despite being the stablest and most feature-packed it's ever been. Aside from the odd things-happening-fo-no-reason bug, my main woes are doing minor things stupidly wrong without realising and Verge not even noticing during compile time.

Take my last cock-up: I set a variable I was SUPPOSED to set to an image to 0 instead. I then tried to free it from memory, which Verge allowed (!?). Then, the next image I load magically vanishes into thin air and Verge exits with a "you must have free'd this image without realising" error. This is a result of me "freeing" what is technically nothing. It took me half an hour of rooting around to work out where I'd screwed up. Argh..

Posted on 2006-05-09 18:29:54


Displaying 1-11 of 11 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.