Quote:
Originally Posted by scriptless
Sorry for the bump but I noticed when I try and save the gani nothing happens.
I can still set my gani online,restarting the client and it doesn't show anymore, but the file seems to be nowhere. Not online, nor on my computer. Both mac and windows. Any help would be awesome. I would love to be able to edit ganis online, or save them offline and upload them at least using my mac.
Edit:
I managed to change the line that saves the file to call a triggeraction and saved the lines serverside. This allowed me to save the gani online. Which accomplishes what I need. Would be cool if I could get it to save locally tho. But this definitely helps me alot. Thanks FP4.
Here is what I did,
PHP Code:
function onActionServerside() { // save to server maybe if ( params[0] == "savegani" ) { echo(params[2] SPC "uploaded or updated!"); temp.lines = params[1]; temp.lines.savelines(params[2], 0); } }
And editing:
PHP Code:
// Save File temp.lines.savelines(this.filename, 0);
to the following, using ASDFG so I could ctr+f to it since its on like line 3,700 something.
PHP Code:
// Save File // ASDFG triggerserver("gui", this.name, "savegani", temp.lines, this.filename); //temp.lines.savelines(this.filename, 0);
I also noticed the NPC Server needed rights to the file.
|
After posting in the wrong thread, I figured I'd share this in the right one!
I changed it so that when saving (and uploading the gani), it checks if the gani already exists on the server, and if it does, overwrites it. Otherwise, it defaults to the file path provided by the client.
Just replace the
onActionServerside block with this code:
PHP Code:
function onActionServerside() {
// save to server
if ( params[0] == "savegani" ) {
echo(params[2] SPC "updated!");
temp.lines = params[1];
temp.fileName = extractFileName(params[2]);
temp.fileList = findFiles(format("levels/%s", temp.fileName), true);
temp.filePath = temp.fileList.size() == 0 ? params[2] : temp.fileList[0];
temp.lines.savelines(temp.filePath, 0);
}
}