Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / do for next loops work correctly? and why cant i use.....

Author
Message
crighton
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 26th Dec 2005 16:22
hi again, I really hope this doesnt sound like a silly question.

I seem to have a wierd problem with this project i'm working on.
http://forum.thegamecreators.com/?m=forum_view&t=65855&b=8

in my populous remake, i use a for next loop to control all ai and placement data ect(as u do), and everything was fine until i added the enemy.
Now all the code was working fine and the only difference between good and evil, is the name of the variables.
Now i find most my models not loading(well appearing) and the game doesnt act as its meant too.
I'm just wondering if the for next loop(will sound wierd) can only handle so much data within it.
If I rem out the good ai and just use evil all is good, and vice versa, But not both at the same time. I have been going over this for a week or more now, and its just annoying.
I tryed to use while end, repeat until, but that wont work either, with the second 2 options its like its not making the variable for char as global. I make it global and it still loses its data/value.

I could really use some help on this matter, becuase im starting to loose faith in it, its very daunting.

anyway, looking to hear from those experienced guys out there that might know whats happening.

cheers
crighton


aye!
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 26th Dec 2005 17:10
You're not the only one having this problem. Same here. And when I when I debugged using object exist(id) the whole thing crashed.
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 26th Dec 2005 17:31
i havent had any problems with the for next loop at all and i have over a hundred lines in a single loop its probably just some bug in the new code you put in. what version are you using?

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 26th Dec 2005 21:54
Just like Jerok I haven't had any problems with for/next. Can you post the code?


MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 26th Dec 2005 23:23
no probs with the for/next loop here.

santah my god, theyre real! *santa faints*
red m&m:oh my god, hes real!*m&m faints*
crighton
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 27th Dec 2005 02:48
thanks guys,

Grog Grueslayer
Um no not really, theres like 500 lines of code per alignment(good and evil), covering their ai and restrictions and placement data.

Its wierd, and judging from the first reply i am not the only one thats had this problem. I know its one of the stupidest questions asked, But as i said, use either code alone and each works fine, but together it creates wierd results.

Anyway, I'll spend prolly another week debuggin, and re-writing i guess, then...... who knows


thanks everyone


aye!
crighton
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 27th Dec 2005 06:06
OK!!!!!!

Man this is gunna hurt

It....would appear that......ummm.... im an idiot.
Slap me gently please.

Anyway the problem isnt the for next loop(derrrr), its actually the collision i was running.

Individually the collision work fine. But I tryed to incorperate both evil and good into the 1 collision cycle, saving on cpu time ect....And again, individually all is good. but together they just make their accomidation and then die.

So, here is the collision code, please browse and offer suggestions(if you would like to) on how to make a fast 2 fold collision test.



thanks for all the help on the silly little brain spasm i have had for over a week now.



aye!
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Dec 2005 09:09
My problem still isn't solved... I mean, howcome the command object exist(id) crashes?

I'll just rewrite it...
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 28th Dec 2005 18:08
Sven B: we cant help unless we know ur code but my guess is that at some point the variable id is equal to 0 and it can't check for a 0 object number so the program crashes

master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 28th Dec 2005 21:06
It's either what Jerok said, or maybe you have "if object exist(ID) and object visible(ID)=1" or something that is added as and "AND" that doesn't exist. Your problem sometimes happens with me, I think it might be a bug. Because I use if object exist(1)=1 then delete object 1 and it says "OBJECT DOES NOT EXIST."

Login to post a reply

Server time is: 2024-09-24 11:28:50
Your offset time is: 2024-09-24 11:28:50