Posted By
|
Message
|
The_Antisony At least I'm not Circy
Registered 01/07/2002
Points 1341
|
13th November, 2013 at 13/11/2013 22:43:18 -
Yeah, it's slow because you're not supposed to let String Tokenizer parse the entire GMchart. The INI object can do most of the work. The only time you'll need to use String Tokenizer or String Parser 2 is when you need to seperate values from a single INI item that has multiple data elements on the same line.
Urban is right, though. String Parser 2 can seperate elements by delimiter just like String Tokenizer can. I only recommended String Tokenizer because it's a little less convoluted and doesn't have a gazillion advanced features that require a learning curve.
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
Maltar Draco
Registered 22/08/2013 19:25:19
Points 215
|
14th November, 2013 at 14/11/2013 16:20:39 -
Sorry guys but you are not to understanding me.
1) Items in the [Song] group are the only ones that should be INI'ed because all of the items from all the other groups are points in time and some of those are the same points in time, so it is best gotten with a list and then read. Ok, that I admit is a little hard to understand, so here is an example!
[ExpertSingle]
{
0 = N 4 768
0 = N 2 768
768 = N 2 384
768 = N 0 384
1152 = N 3 384
1152 = N 1 384
}
2) I can not just simply strip out most of the data because I still need that data from the actual file, I am just not using it now. What I asked was to only read certain groups of it.
In such example the data that I want to fetch from this group and only this group and put into a list object is this!
0 = N 4 768
0 = N 2 768
768 = N 2 384
768 = N 0 384
1152 = N 3 384
1152 = N 1 384
And from this point, I can easily tokenise the data from each entry and easily put into the game.
3) The file format is .chart and there loads of places to get those files! Just do a ruddy Google search for guitar hero custom songs. These files are usually edited with Feedback Chart Editor.
I'm sorry if that's too difficult for you because it's a bit too hard for me, certainly! That's why I'm asking.
Maltar Draco, I do PC gaming.
|
The_Antisony At least I'm not Circy
Registered 01/07/2002
Points 1341
|
14th November, 2013 at 14/11/2013 20:06:17 -
Well, stinky dung. I think you might be right back to using INI++ then.
I created an example for you using the INI++ object and StringParser2. It's commented, but I didn't spend a whole lot of time on the UI so it's not super-intuitive. Basically, all you need to do is toss a chart file into the app directory and rename it to "whatislove.chart". Running the app will load the chart file, turn it into an INI, save the INI to the apppath, then pull and seperate the values you requested. Double-click any entry in the list object, and the seperated elements appear in EditBox2.
You can change INI values by replacing elements in StringParser2 so long as you keep in mind that the first element is the item name. Instead of appending each of the elements together into an EditBox, you could pop 'em in seperate edit boxes so you can change values if that's your aim.
Anyway, you'll want to download the GHchartExample.mfa.
http://sdrv.ms/175qlRG
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
Maltar Draco
Registered 22/08/2013 19:25:19
Points 215
|
14th November, 2013 at 14/11/2013 20:27:59 -
FAIL!
Original:
[ExpertSingle]
(
0 = S 0 1728
192 = N 0 1472
1728 = S 1 1600
1792 = N 0 1408
3328 = S 0 832
3392 = N 2 0
3392 = S 2 1536
3456 = N 0 0
3520 = N 2 0
3584 = N 0 0
3648 = N 2 0
3712 = N 0 0
3776 = N 3 0
3840 = N 2 0
3904 = N 0 0
3968 = N 3 0
4032 = N 2 0
4096 = N 0 0
4160 = N 2 0
4160 = S 1 768
4224 = N 0 0
4288 = N 2 0
4352 = N 0 0
4416 = N 2 0
4480 = N 0 0
4544 = N 3 0
4608 = N 2 0
4672 = N 0 0
4736 = N 3 0
4800 = N 2 0
4864 = N 0 0
4928 = S 0 832
4992 = N 1 0
4992 = N 2 0
}
What your code butchers it into:
0=S 0 17280
192=N 0 14720
1728=S 1 16000
1792=N 0 14080
3328=S 0 8320
3392=S 2 15360
3456=N 0 00
3520=N 2 00
3584=N 0 00
3648=N 2 00
3712=N 0 00
3776=N 3 00
3840=N 2 00
3904=N 0 00
3968=N 3 00
4032=N 2 00
4096=N 0 00
4160=S 1 7680
4224=N 0 00
4288=N 2 00
4352=N 0 00
4416=N 2 00
4480=N 0 00
4544=N 3 00
4608=N 2 00
4672=N 0 00
4736=N 3 00
4800=N 2 00
4864=N 0 00
4928=S 0 8320
4992=N 2 00
I told you so but you just didn't want to hear it!
Maltar Draco, I do PC gaming.
|
The_Antisony At least I'm not Circy
Registered 01/07/2002
Points 1341
|
14th November, 2013 at 14/11/2013 21:05:26 -
Butchered? There's an extra "0" appended to every list result. If you took a second to read through the event scripting, it's pretty obvious where the error is.
Group: Display
On Loop: "PullExpertSingle".
Add Line to List Object:
NthItemG$( "Ini++ v1.5 Object", ItemInINI( "ListExpertSingle" ))+"="+NthItemStringG$( "Ini++ v1.5 Object", ItemInINI( "ListExpertSingle" ))+Str$(NthItemValueG( "Ini++ v1.5 Object", ItemInINI( "ListExpertSingle" )))
>>>>Should be changed to:<<<<
Add Line to List Object:
NthItemG$( "Ini++ v1.5 Object", ItemInINI( "ListExpertSingle" ))+"="+NthItemStringG$( "Ini++ v1.5 Object", ItemInINI( "ListExpertSingle" ))
I somehow doubt this is the same error you've been experiencing, so there is no "I told you so!". There's no need for the ridicule over such a negligable problem, but I apologize for not catching it before upload; I should have. Maybe Sketchy or Urban can embellish; they've both answered a few of my questions relating to string manipulation in the past.
Edited by The_Antisony
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
Maltar Draco
Registered 22/08/2013 19:25:19
Points 215
|
14th November, 2013 at 14/11/2013 22:27:17 -
Originally Posted by GrimFusion Butchered? There's an extra "0" appended to every list result. If you took a second to read through the event scripting, it's pretty obvious where the error is.
You can't even see the error that I was referring to. I didn't even notice the extra 0s.
I said many times that data can't be INI'ed and I have said a few times in this thread exactly why. If you carefully examine the data, ignoring the extra 0s, you might see it.
Maltar Draco, I do PC gaming.
|
lembi2001
Registered 01/04/2005
Points 608
|
15th November, 2013 at 15/11/2013 01:29:05 -
WOAH!!
I can see the error but before I reveal it I have a few things to say.
Maltar, this attitude you have is ridiculous. The people on this site offer FREE help and advice. You do not have to like it or take it but it is FREE so show a little decorum. Instead of being an dillweed and being so negative actually explain what the problem with the output from the code is. At first glance it is not that easy to see the issue but upon further inspection I have found the problem with the output. I have not looked at the source code yet so I'm not sure if I can fix it, nor am I sure I want to look at it after the way you have treated 2 of this community's more well known members.
For Grimfusion, Sketchy and UrbanMonk, if you are interested, the problem with the output is that it is stripping out duplicate lines based on the first value.
Example:
Original File
1728 = S 1 1600
1792 = N 0 1408
3328 = S 0 832
3392 = N 2 0
3392 = S 2 1536
3456 = N 0 0
3520 = N 2 0
3584 = N 0 0
Output from code
1728=S 1 16000
1792=N 0 14080
3328=S 0 8320
3392=S 2 15360
3456=N 0 00
3520=N 2 00
3584=N 0 00
Hope that helps, and remember Maltar a little bit of respect goes a LOOONG way
Edited by lembi2001
n/a
|
The_Antisony At least I'm not Circy
Registered 01/07/2002
Points 1341
|
15th November, 2013 at 15/11/2013 02:15:34 -
Yups. I see the problem now. Groups that have duplicate items still save correctly to the INI, but when they're read from the INI, only the last duplicate in a group appears. I think I already have an idea for a work-around that doesn't use INIs at all. I'll try to have a second example put together by tomorrow.
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
Sketchy Cornwall UK
Registered 06/11/2004
Points 1970
|
15th November, 2013 at 15/11/2013 02:58:16 -
The way I'd do it would be by loading the file into a list object, and then running fastloops to check each line (you might be able to use the search function to jump straight to strings like "[ExpertSingle]").
It all depends on *exactly* which bits of data you want to read, and what you want to do with them - are they going into arrays, or lists, or global values, or what?
It would be helpful if you could post an example file, and a *very detailed* explanation of what you want to do with it (eg. "I would like the song and artist names stored in global values, and the contents of [expertsingle] copied into an array").
n/a
|
The_Antisony At least I'm not Circy
Registered 01/07/2002
Points 1341
|
15th November, 2013 at 15/11/2013 07:29:39 -
^^ That.
It's the only other logical way to parse through the chart file and preserve each section. I'm working on a nested loop that tests the first few characters of each line against a string variable then dumps content into a text file until "}" is encountered... next string variable; repeat. That should result in each section being saved to an independent text file. If I can do that, I can parse each text file individually ensuring sections are preserved. I've gotten it to dump one section already and I've double-checked that all duplicate values are preserved. They are. I should have a working example by sometime tomorrow.
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
Sketchy Cornwall UK
Registered 06/11/2004
Points 1970
|
15th November, 2013 at 15/11/2013 13:23:30 -
Just be careful with things like whitespace and case-sensitiveness.
If Guitar Hero isn't strict about it, you may find some files contain "[easysingle]" and others "[EasySingle]", for example.
Similarly, if you're comparing the first n characters of a string, it's possible some of those will be spaces / tabs in some files.
n/a
|
Maltar Draco
Registered 22/08/2013 19:25:19
Points 215
|
15th November, 2013 at 15/11/2013 19:09:05 -
Originally Posted by lembi2001 Maltar, this attitude you have is ridiculous. The people on this site offer FREE help and advice. You do not have to like it or take it but it is FREE so show a little decorum. Instead of being an dillweed and being so negative actually explain what the problem with the output from the code is. At first glance it is not that easy to see the issue but upon further inspection I have found the problem with the output. I have not looked at the source code yet so I'm not sure if I can fix it, nor am I sure I want to look at it after the way you have treated 2 of this community's more well known members.
Hope that helps, and remember Maltar a little bit of respect goes a LOOONG way
I'm sorry!
Maltar Draco, I do PC gaming.
|
Maltar Draco
Registered 22/08/2013 19:25:19
Points 215
|
26th November, 2013 at 26/11/2013 23:09:24 -
At this stage it looks like I have to make my own editor but that's not necessarily a bad thing.
Firstly: I will be using all my own songs anyway, so I have to edit them in regardless of what editor I am using.
Secondly: I get to make my own rules.
I make my own file format and therefore I decide what goes in it and how it is read, I could make it actually readable using ini or even... have any note a hopo instead of just fast ones, or even better, have open notes which guitar hero does not have or even chords that can only be down-strummed and others only up-strummed.
I could completely re-invent this genre of rhythm game and make it harder than ever before!
Thirdly: Having an editor built into or bundled in with any game is always the way to go!
Fourthly: Timing would be easier to get right if the editor and game were made and work the exact same way.
I would just like to ask for all your advice before jumping into this new ambitious addition to the project. It's not only a new game any-more, it's now a new level editor with it's own unique file format.
Maltar Draco, I do PC gaming.
|
lembi2001
Registered 01/04/2005
Points 608
|
27th November, 2013 at 27/11/2013 12:12:38 -
One way I think you could do it would be to create yourself a "keylogger" style program
For example.
Have a button on your app that loads the song in using Directshow (or whatever extension you are using) once you click play the keylogger program starts.
You then type or hold the keys you want to use matching the rhythm of the game.
For the events you can add a line to a list box which features the timestamp of the song and the key you pressed.
Crude but simple way of doing it.
n/a
|
Maltar Draco
Registered 22/08/2013 19:25:19
Points 215
|
28th November, 2013 at 28/11/2013 00:35:31 -
If it's not too much trouble, is there an object that can play music but has a pitch-bend or vibrato effect, you know, for the whammy bar and also works on Java.
If it's not too much extra trouble, is there an object that can play the music but with specified delay in milliseconds, or failing that an object that can delay your visual display by a certain amount of milliseconds. Because having no A/V delay will wreak havoc on certain systems that are not 100% synchronised. And also, works on Java.
Oh... and is there an object that can detect the buttons of 2 different joysticks that works on Java.
I'm not asking for too much, am I?
Edited by Maltar Draco
Maltar Draco, I do PC gaming.
|
|
|