|
Post by Power Supersport on Apr 30, 2015 17:44:22 GMT
Can someone make a demo with this function, please? Or simply explain how to use it? I checked the reference and I did everything fine, but I get error...
When I use it, 3D Rad kicks me out... I think that there is something specific cut I can't find it...
|
|
|
Post by F1Andre on Apr 30, 2015 18:26:19 GMT
I'll quickly check it out.
|
|
|
Post by F1Andre on Apr 30, 2015 18:32:06 GMT
I am not sure what you did or what your code looks like, but I have tried a single line code with the ifileopendialog() and it worked just fine. Do you mind posting your code.
|
|
|
Post by NicusorN5 on Apr 30, 2015 18:36:52 GMT
Your sintax of the script may be wrong, like F1Andre said Do you forgot posting your code?
|
|
|
Post by Power Supersport on Apr 30, 2015 18:38:41 GMT
Thanks for testing... You may not want my code because it's a mess in there... just you will not understand what is in it and it's purpose...
In short... it's a part of the X-craft launcher... I am making a restoration process of backup data... anyway...
What I scripted is a button (sprite). When I click on it, the dialog appears... when I chose a file, 3D Rad kicks me out...
I don't know... what's the problem in the conversion of the string...
|
|
|
Post by Power Supersport on Apr 30, 2015 18:39:44 GMT
Ok, here is it... Don't get lost... (This is part of the script, it's not the complete) /// Restore
if (IN_111 > 0) {
buttonRestore = iFloatTendTo(buttonRestore,buttonRestore,1,0.3,0);
if (iMouseButtonClick(0)) {
// dialog = true;
selected = iFileDialogOpen(select,"db","Open Backup File");
restore = true;
selected = true;
}
}
else buttonRestore = iFloatTendTo(buttonRestore,buttonRestore,0.6,0.3,0);
OUT_110 = buttonRestore;
if (dialog) {
selected = iFileOpenDialog(select,"db","Open backup file");
restore = true;
}
/// Restore part
if ((restore) and (done2 == false)) {
int Timer;
int sRestore;
Timer += 1;
if (Timer == 1) {
Process += 1;
if (Process == 1) {
if (selected) {
sRestore = iFileReadOpen(select);
iFileStringRead(sRestore,check);
if (check == "BACKUP DATA") {
valid = true;
selected = false;
}
else {
status = "NOT A BACKUP DATA FILE!";
restore = false;
iFileClose(sRestore);
valid = false;
}
iFileClose(sRestore);
}
if (valid) {
status = "RESTORING YOUR FILES... PLEASE WAIT!";
sRestore = iFileReadOpen(select);
iFileStringRead(sRestore,check);
iFileStringRead(sRestore,version);
Version = iFileValueRead(sRestore);
TotalProcess = iFileValueRead(sRestore);
}
}
for (int i=0;i<TotalProcess;i++) {
if (i == Process-1) {
iFileStringRead(sRestore,path);
iFileDelete(LocalFolder+path);
iFileCopy(".\\backup/"+version+"/file["+i+"].backup",LocalFolder+path);
}
}
if (Process > TotalProcess) {
status = "SUCCESSFULLY RESTORED TO "+version;
int sVersion = iFileWriteOpen(".\\Version.db");
iFileStringWrite(sVersion,version,true);
iFileValueWrite(sVersion,Version,true);
iFileClose(sVersion);
done2 = true;
iFileClose(sRestore);
Process = 0;
}
}
if (Timer > 2) Timer = 0;
}
|
|
|
Post by NicusorN5 on Apr 30, 2015 18:42:40 GMT
WOW,sooo long script cannot help u .Sorry.
|
|
|
Post by Power Supersport on Apr 30, 2015 18:45:22 GMT
Told ya...
|
|
|
Post by NicusorN5 on Apr 30, 2015 18:47:24 GMT
lol For making game launchers is use PSB(Pika Software Bulider)
|
|
|
Post by Power Supersport on Apr 30, 2015 18:50:04 GMT
My launcher's job is to update the game if available...that's something new...
But since I don't know pretty much DOS, I can'd create bat-s for now...
|
|
|
Post by F1Andre on Apr 30, 2015 18:50:38 GMT
I see one mistake. In your code you said ".\\backup/v1.0.0/data.db"; try ".\\backup\\v1.0.0\\data.db";, so just reverse those slashes (\) and there must be 2.
|
|
|
Post by Power Supersport on Apr 30, 2015 18:54:58 GMT
|
|
|
Post by F1Andre on Apr 30, 2015 19:00:36 GMT
Lol, I just assumed you have declared those variables like select. I like the concept, and I thank you for asking a scripting question. I have done no work on my game so far foe the last 2 weeks, sometimes you just need to clear your head and see where you are going.
|
|
|
Post by Power Supersport on Apr 30, 2015 19:04:52 GMT
Completely true... Getting up early for school, then going to bed late... Getting a little bit tired... It's normal that I can mess up something... Anyway... these days I have some holidays... I'm gonna clear my head little bit...
|
|
|
Post by F1Andre on Apr 30, 2015 19:08:06 GMT
It is so true.
|
|
|
Post by mikehense on May 5, 2015 14:07:26 GMT
i have constant issues with iFileOpenDialog() in Win 8.1 and Vista...
sometimes the dialog box opens... sometimes it doesn't... usually when i use an explicit path string as the first arg it works... but then how am i supposed to use the filename the user selected...
if i remember correctly (it's been a while)... i wrote a small dll to get a file open dialog that worked reliably...
--Mike
|
|
|
Post by Power Supersport on May 5, 2015 14:12:35 GMT
And I am not very sure about this... I am on windows 7 and I have this problem sometimes... (constantly)
Actually I locked the topic before, because it happened for a moment... but later I came up with the problem again... I can open the dialog once, the next time I open it again 3D Rad kicks me out...
|
|
|
Post by NicusorN5 on May 5, 2015 14:15:29 GMT
LOL u tried in Win XP xxD ??
|
|
|
Post by mikehense on May 5, 2015 14:46:26 GMT
yeah... back in the 2001 --Mike
|
|
|
Post by mikehense on May 7, 2015 2:33:57 GMT
this topic got me looking into this... i thought i had made a dll that operated like iFileOpenDialog() but i can't find it, so i'll try to create a dll which does this more reliably... while researching this topic i ran into something interesting that i remembered noting a while back... it has to do with strings and arrays... and how the ascii value for each character in a string can be accessed like you'd access a single array element... for example... say i declared a string variable and wanted to find the ascii value of the first character... it might look something like this... string myString; int asciiVal;
void Main(){
myString="Hello World"; asciiVal=myString[1]; OUT_0=asciiVal;
}
this makes passing strings to DLLs in 3DRad pretty straight forward, as you would loop around and read each letter of a string and assgn the ascii val to the corresponding DLL Array element... cool... eh i wonder if Fernando, in his infinite wisdom, planned it this way --Mike
|
|