Posted By
|
Message
|
Spiriax
Registered 25/05/2005
Points 277
|
8th December, 2010 at 17:01:56 -
I really appreciate your help, Sketchy!
That gave me a bit more insight, but I am already aware of one problem that would arise if we were to use that method. The images are actually named so it is always the same amount
of numbers:
"1_000001.jpeg"
"1_000010.jpeg"
"1_000100.jpeg"
etc..
But with that expression, MMF would want to load the file "1_000000100.jpeg", and not "1_000100.jpeg". I think we would need to place some more conditions to check
how many frames has already been loaded into the animation.
If this would work, it would indeed be a really nice solution. But shouldn't I be able to just do this?
Start of Frame
> Load Frame: Apppath$+"1. J6/1_000000.jpeg" into Frame 0
> Load Frame: Apppath$+"1. J6/1_000001.jpeg" into Frame 1
> Load Frame: Apppath$+"1. J6/1_000002.jpeg" into Frame 2
> Load Frame: Apppath$+"1. J6/1_000003.jpeg" into Frame 3
etc..
Surely it's a little more hassle (still WAY better than I was doing before) but as long as it works?
n/a
|
Jon Lambert Administrator
Vaporware Master
Registered 19/12/2004
Points 8235
|
8th December, 2010 at 18:39:44 -
At first glance you might think he messed up, but you'll notice that he actually called for the 6 rightmost characters of that string (which is made up of 6 zeroes and then the value) so that instead of getting "1_0000001.jpg" you get "1_000001.jpg" (6 rightmost characters of 7-character string "0000001" are "000001").
Sandwich Time!Whoo!
JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364
|
Sketchy Cornwall UK
Registered 06/11/2004
Points 1971
|
8th December, 2010 at 18:44:43 -
Actually, I made sure the problem you mentioned would NOT arise.
Allow me to explain further...
The first part of the filename ("1_000") never changes, because there are less than 1000 images.
The next part is always 3 digits long, even if the value of the loopindex is only 1 or 2 digits long.
So what we do first is add a couple of zeroes on the front, in case the loopindex is only one digit long.
"00" + str$( LoopIndex )
As you suggested, that could give us the following strings of different lengths: "001" or "0010" or "00100".
However, we then use "right()" to remove all except the last 3 characters.
right$( "00" + str$( LoopIndex ), 3 )
That would give us the following strings of equal length: "001" or "010" or "100".
Putting it all together:
"1_000" + right$( "00" + str$( LoopIndex ), 3 ) + ".jpg"
That gives us: "1_000001.jpeg" or "1_000010.jpeg" or "1_000100.jpeg".
Adding a line of code for each image would be insane.
EDIT: Nevermind, Jon just explained it already - thanks Jon
Edited by Sketchy
n/a
|
Spiriax
Registered 25/05/2005
Points 277
|
13th December, 2010 at 20:39:10 -
Thanks Sketchy (and Jon ^^)!! It all makes sense now.
Sorry for my late reply, but from the beginning I couldn't make it work (I think it was because I put ".jpg" when it was indeed jpeg, or vice versa!),
but now it works just swell.
Now I can easily make a good throw break trainer! Thanks guys!
n/a
|
|
|