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 / Why doesn't this loop work?

Author
Message
Robot Booger
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location:
Posted: 15th Aug 2005 02:53
I made a loop to make,texture, and scale 100 cube, but it doesn't. Please help.


Thank you in advance.
Underworld 1020
20
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 15th Aug 2005 03:01 Edited at: 15th Aug 2005 03:03
Well, its a little much with the 100 load images, but it should still work, what kind of error does it return? and it will only work if you actually have all of those 100 pics on your computer, if your trying to texture the cubes with the same pic then you could do it an easier way. If you tell me what the code is for, I could be more useful.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Aug 2005 04:00 Edited at: 15th Aug 2005 04:02
Here's what your code should look like:



I've shown a way to load all those images without all the lines of code...

Your problem however is down to your use of the Scale Object command.

The last three values are scale factors for X, Y and Z, where 100 means no change (not 0). So 100,100,200 would make the object double the size along the Z axis.

And 100,100,50 will halve the size along the Z axis.

You used 0,0,1, and I don't even know what that should do - other than cause an error.

TDK_Man

Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 15th Aug 2005 04:11
You might have a goofy scale command there. I'm still a noob - but that's where I'd look.

BTW, couldn't you do something like this:



instead of that massive hundred entry cut and paste for the load image command?

DBP + VC Ent.Studio | Maya, MAX, Soft3D, MilkShape, Character FX | 3.0Ghz P4, IC7G, GF 6800GT (primary) / 3200XP, A7N8x, GF 6600GT (secondary) / 6x dual 2.8Ghz Xeon SuperMicro (renderfarm)
Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 15th Aug 2005 04:12
Ahh, crud. Sorry, TDK. Whilst I was off testing both scale and my load image snippit, you beat me in there.

DBP + VC Ent.Studio | Maya, MAX, Soft3D, MilkShape, Character FX | 3.0Ghz P4, IC7G, GF 6800GT (primary) / 3200XP, A7N8x, GF 6600GT (secondary) / 6x dual 2.8Ghz Xeon SuperMicro (renderfarm)
Underworld 1020
20
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 15th Aug 2005 04:29
Nice one TDK , that one got passed me .

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Aug 2005 05:13
Kim Possible:

No problem - you just backed up my theory!

Underworld 1020:

We can't be expected to catch them all can we?

TDK_Man

Robot Booger
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location:
Posted: 16th Aug 2005 01:17
Underworld 1020:
The code is for a 3D spaceship game where you have to collect the number answer to a math problem.

TDK and Kim Possible:
Neither of your codes worked. It said "Could not load picture." The same error occured with my code. I don't know why your codes didn't work, I guess you can't use variable in the name of file.

Anyways, Thank you so much for trying everyone.I hope someone figures out how to do this or I'll have to do it the long way.
Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 16th Aug 2005 01:25
I either left-off a backslash, or the forum stripped it (yeah, sure, uh-huh. I typo'd and trying to dodge it...)



That said: This is really sub-optimal. You should collect all your media into your project directory and then reference it from there. I can't even promise that it's not going to munge the spaces in the directory names.

Personally, I use something like:

m:\src\current\project-name

'Course, I'm a unix-type and I like /src and filenames/dirs without spaces...

DBP + VC Ent.Studio | Maya, MAX, Soft3D, MilkShape, Character FX | 3.0Ghz P4, IC7G, GF 6800GT (primary) / 3200XP, A7N8x, GF 6600GT (secondary) / 6x dual 2.8Ghz Xeon SuperMicro (renderfarm)
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Aug 2005 03:09 Edited at: 16th Aug 2005 03:18
Not to be a critical to TDK and Kim but the code didn't work because of little bugs.

TDKs string for the directory had all the backslashes removed (the fault of this forum when editing a message).

Kims didn't work because it used the wrong variable for the string and load image (she had bmpcnt when it should of been bmpnum) and the first backslash in the string was gone (which she mentioned).

A splice of TDKs functions and Kims do loop (untested):



Of course Kims right it's best to move all those files into a directory inside the directory your code is at... makes life SO much easier.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th Aug 2005 03:19
Oh yes!

I'd not noticed that before!!

I know my code did work before I pasted it onto the forum. I wasn't aware that the forum stripped all backslashes out and obviously you don't bother checking the code button afterwards.

That's bad!

And thanks for correcting it Grog!

TDK_Man

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Aug 2005 03:41
np
Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 16th Aug 2005 05:08
Doh! [blush]

DBP + VC Ent.Studio | Maya, MAX, Soft3D, MilkShape, Character FX | 3.0Ghz P4, IC7G, GF 6800GT (primary) / 3200XP, A7N8x, GF 6600GT (secondary) / 6x dual 2.8Ghz Xeon SuperMicro (renderfarm)
Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 16th Aug 2005 05:11
I'm just distracted 'cause I'm ticked off that Amazon managed to put five copies of DBP in a box and ship 'em half way across the country in one day charging me for three day - so my programmers have all gotten their copies. Oh - and did I mention that *I* ordered it for download and TGC still hasn't managed to approve the download?

Amazon can get off their butt and box and send five copies across country and put it in my hands, but TGC can't approve a download. A download that millions of other providers approve on-the-fly billions of times a day.

So I blame TGC.

DBP + VC Ent.Studio | Maya, MAX, Soft3D, MilkShape, Character FX | 3.0Ghz P4, IC7G, GF 6800GT (primary) / 3200XP, A7N8x, GF 6600GT (secondary) / 6x dual 2.8Ghz Xeon SuperMicro (renderfarm)
Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 16th Aug 2005 19:46
Sorry - I tried to self-moderate and remove my thread hijack but I'm still a noob and it won't let me edit my posts. . .

DBP + VC Ent.Studio | Maya, MAX, Soft3D, MilkShape, Character FX | 3.0Ghz P4, IC7G, GF 6800GT (primary) / 3200XP, A7N8x, GF 6600GT (secondary) / 6x dual 2.8Ghz Xeon SuperMicro (renderfarm)
Robot Booger
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location:
Posted: 17th Aug 2005 00:33
OH MY GOSH IT WORKS. Thank you so much everyone

Login to post a reply

Server time is: 2024-09-24 01:35:55
Your offset time is: 2024-09-24 01:35:55