Copy/Paste Within Game

Started by Mandle, Thu 02/10/2014 16:09:00

Previous topic - Next topic

Mandle

Sorry if this has been asked a bazillion times before...

But I'm looking for a way for the player to copy/paste a block of text while still within the game or have that block of text automatically exported to their clipboard as if they had copied it...

This is for a MAGS project so sorry again for not searching properly, but I just couldn't find it in time for my first proof-of-concept build that I need to know if I'm going to do this project or not...

Cheers!

Crimson Wizard

#1
I never heard if anything like this was supported in AGS... I mean, I am 99.9999% sure it isn't.

E: Maybe you could use a file for whatever you are trying to achieve?

Billbis

There is this Bloc-Notes module made by Kitai that is supporting copy/paste.
The topic is in French, but hopefully the embeded documentation will be in English. If not, you can try to contact him. May be not the ideal solution for a MAGS project. :-X
I dont think it is supproting pasting outside the game, though.
Good luck!

Slasher

Hi,

It may depend on what exactly you want copied and how you want to paste it and if its more than one block of text.




Mandle

Quote from: slasher on Thu 02/10/2014 16:37:41
Hi,

It may depend on what exactly you want copied and how you want to paste it and if its more than one block of text.

I feel like I'm looking for a simple solution in a complicated way...

And I'm probably wasting the time of everyone here but this is what I'm trying to do:

I'm trying to allow the player to take a line of text characters out of the game and into their clipboard (as if they has copied the text normally from say...here) so that they can paste the text back into the game in the near future...

What I'm trying to achieve is that the text equals their saved game data and that pasting it back into the game equals their restore game data...

I know I'm circumventing the usual SAVE/LOAD function built into AGS but it is for a reason...

Cheers!

Crimson Wizard

#5
Quote from: Mandle on Thu 02/10/2014 17:24:53
I feel like I'm looking for a simple solution in a complicated way...

And I'm probably wasting the time of everyone here but this is what I'm trying to do:

I'm trying to allow the player to take a line of text characters out of the game and into their clipboard (as if they has copied the text normally from say...here) so that they can paste the text back into the game in the near future...

What I'm trying to achieve is that the text equals their saved game data and that pasting it back into the game equals their restore game data...

Do you mean some kind of game password?
Well, unless you want to force player to write it down and type back manually, just save it to text file, and then let player to optionally load it back on game start.
Code: ags

File *f = File.Open("$SAVEGAMEDIR$/savegame.txt", eFileWrite);
f.WriteRawLine(MyLineOfText);
f.Close();

Code: ags

if (File.Exists("$SAVEGAMEDIR$/savegame.txt")) {
    File *f = File.Open("$SAVEGAMEDIR$/savegame.txt", eFileRead);
    MyLineOfText = f.ReadRawLineBack();
    f.Close();
} else {
    // error
}


You may also name this file with player's unique name, or let them type in the name like in normal save game dialog.

Mandle

Thanks Crimson Wizard. I think that is the exact solution I'm looking for. I will give it a try!!!

SMF spam blocked by CleanTalk