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.

DarkBASIC Discussion / Limb exist() code problem

Author
Message
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 2nd Oct 2003 19:26
I wrote a function to find the total amount of limbs of a given object, but when I run it, it gives me a runtime error, and states that the limb doesn't exist, but the line it points to is the line that checks if the limb exists or not! What's up wit dat?

Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 2nd Oct 2003 20:00
you need to change it to this i believe:



Hope I Helped...

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 2nd Oct 2003 21:25
No good. Actually, I had changed it around quite a few times, and that one happened to be one of them. I did try that one again, just in case, but it didn't work. It might be something wrong in a different function somewhere or something, you think?

Destroy you with my mind, I could!
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 01:04 Edited at: 3rd Oct 2003 01:05
Doesn't anyone know what's up with my code?



Destroy you with my mind, I could!
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 04:30
Aww... common you guys! Someone must know something!

Destroy you with my mind, I could!
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 05:40
Aaaargh! SOMEONE HELP!!! The snippet of code is EXTREMELY important for my project! I have to have this to work! If you have another way to check the number of limbs of a given object, I would LOVE to here it! I looked at the help file concerning limb exist(), and it was no help. I've done everything I could think of! I've even switched the n and x in the parenthesis in case I had those wrong, but it didn't help anything! HELP ME!!! IT'S DRIVING ME CRAZY!!!!


Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 06:59
Ok, try this...



and n should be your object number...

If that doesnt work, post all of the different ways you have tryed it and ill look at it...

Hope I Helped

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 07:20 Edited at: 3rd Oct 2003 07:21
Ho hum... it still doesn't work! Hmmm... has anyone else tried my code? It all looks good, no matter which way I put it (correctly, that is), but it always seems to point at the limb exist() command. The help file regarding that command kinda confuses me, but I think I have it right.
Original code:



Then I changed it little by little. I got rid of the then and added an endif. I set the x=0. I changed the total=total+1 to inc total. I set the limb exist(n,x) equal to a variable and checked if it =1. I added a code to make sure that the object n existed (even though it wouldn't have been called if the object didn't). I even tried to swicth the n and x. Currently, the code is thus:



But each time I run it and it gets called, it states that the object doesn't exist! But I know for a fact that it does because I can see it, and I pass the object number into the function (n)!

The only thing that I can think of is that somehow the object that I'm trying to check doens't have limbs according to DB, but that's crazy! Right? I mean because the object that I'm testing the function with is the alien-mutant.x file. That wouldn't have anything to do with it... would it? PLEASE tell me it wouldn't! That could ruin months of programming!!! I would be scarred for life!!!

Edit: in any case, thanks for your concern: I've been stuck on this all day...

Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 07:40 Edited at: 3rd Oct 2003 07:45
hmmm, object doesnt exist error eh? ok... try this...



and if that ends the program, then your doing something wrong when passing the object number into the function...

Hope I Helped...

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 07:47
I don't think that's it... but I'll try it tomorrow. It's getting late, and my roommates trying to sleep.

Again, thanks for your concern...

Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 09:10
hmm, i was just searching throught the help files and i came across PERFORM CHECKLIST FOR OBJECT LIMBS mabey that'll help... have a look at the example dba file and see if thats what you want...

Hope I Helped...

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 17:51
YES! The first code snippet was still wrong, but the second one seems to be right! Thank You and incredible lot!!!

Query: why wouldn't my custom made function work though? Strange, no?

Note: I will give you credit for your help! Thanks!

Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 19:23
um, so you used the PERFORM CHECKLIST FOR OBJECT LIMBS command then? or did you use one of the code snipets i suggested?

Thanks for giving credit, very generous...

Hope I Helped...

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 19:25 Edited at: 3rd Oct 2003 19:26
to get your function to work, ill need to see the code that you use to call the function in your main program and then the function code you want to work properly (which doesnt currently work) and ill have a quick look...

Hope I Helped...

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 19:29
Oh, yeah, I guess my last post wasn't very exact...

Here is the current function:



Notice all I did was remstart and end the original code. That's what's so strange about it... that seems like it should work just like the perform checklist thing... oh well...

And yes, the name JessTicular will be added to the credits under "special thanks for help with debugging"
You should be honored! Your name will be the only one other than mine in the credits (excluding my thanks to the makers of DB, of course... maybe a few more... i don't know)

Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 19:32
LoL, thats cool... so the function works alright and im gonna get praise in a program for helping... I Like... Thanks man...

Oh, and i'll help test if you like

I Did Help...

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 19:34
Oh wait! you posted at about the same time I did!

Basically I loaded an object, ( the number happened to be 11) then, I set n=the last loaded object #. If n>10, then it calls the function. Oh, and the error pointed at the "limb exist(n,x) line, and it gave me a "limb does not exist" not an "object doesn't exist" Sorry! I think that was my mistake!

Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 19:34
It's odd how no-one else posted in here... usually you get three or four people helping to solve the same problem... Oh well... THEY wont get special praise in your program, so it's their loss... hehe... I'm stoked now...

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 19:36
Again, another same time post!

Great! Testers are always welcome, so long as I don't get to many and I get 10000 e-mails each telling me that they found the same bug... know what I mean?

Destroy you with my mind, I could!
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 3rd Oct 2003 19:39
Man! We're bad at this! We keep posting at the same time!

Well, I guess as far as that problem goes, its solved, so I'll stop posting here. Glad you're stoked! So am I for having my problem solved and my first confirmed tester! I'm going to my other thread now. Post there if you wanna tell me something else...

Destroy you with my mind, I could!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Oct 2003 19:39
yeah, i get ya...

hey, if you can decode the binary in my profile, ill mention YOU in my game... sound good eh?

Just a thought (cos no-one else seems o care about decoding it, or havent looked in my profile)...

Ok, well, this is like a chat room, but i gotta go, so cya...

email me the beta test prog if u want at a later stage... [email protected]

If Quizz's Are Quizzical, Then What Are Test's?
Check my profile for a quick test of knowladge...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 9th Oct 2003 22:32
Alright, I know this post is kinda old, but I'm reviving it, because I still get an error with the command LIMB EXIST(obj#, limb#). It always gives me a runtime error and says that the limb does not exist, but THAT's what I what the program to figure out, IF the limb exists or not! What's wrong with it? It's not a bug is it? (I don't need this for the already posted problem, this is a new one, with the same command doing the same thing...)

Destroy you with my mind, I could!
. Cool, he is. Play his games, I do.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 10th Oct 2003 07:44
Me again...

i think it should be:



Hope I Helped...

Knowladge Belongs To The People...
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 10th Oct 2003 07:56
Yea, people seem to think that, but I use things all the time w/o the =1 and they all seem to work. But I have tried that before, and it didn't work. Either. Maybe a moderator could shed some light on the situation, hmmm?

Destroy you with my mind, I could!
. Cool, he is. Play his games, I do.

Login to post a reply

Server time is: 2025-05-20 20:17:21
Your offset time is: 2025-05-20 20:17:21