Issue302

Title CHEAT: add quests/cookies via cheat menu
Priority feature Status open
Assigned To Keywords
Linked issues Watchers

Submitted on 2011-07-24 19h07 by tracker_migration, last changed by ahuillet.

Messages
Author: tracker_migration Date: 2010-09-25   10h01
Submitted by matthiaskrgr
There should be an option in the cheat menu which makes it possible to add quests and cookies to the player.
Such an option will make finding quest-related bugs much more easier.
Author: tracker_migration Date: 2010-10-15   07h09
Posted by salimiles
You can use lua, eg paste this somewhere:
type_quest = user_input_string("Type quest name.",  "Quest Name")
assign_quest(type_quest)

It crashes if you don't type a name that actually resolves to a quest.

That trick doesn't seem to work with underscores.
Author: tracker_migration Date: 2010-10-15   09h19
Posted by ahuillet
This makes me think - perhaps we should think about implementing a Lua console ingame? It seems a bit overkill but it can help debugging tremendously IMO. Especially if we prepare "cheat scripts" to e.g. give complete equipment and invulnerability, etc.

Technically the Lua API we have is almost sufficient, we'd need some stuff to make tux invincible and invisible but it's not hard to do.

Obviously that's post-0.14 unless I am very motivated.

What do you think about that?
Author: tracker_migration Date: 2010-10-15   09h32
Posted by fluzz
Good idea, me thinks. But instead of creating the GUI of the console 'inside' fdrpg, I think that you should rather add a socket connection. So one can use whatever 'remote console' he wants ('telnet', 'nc'...) to connect to the 'debug console'.
Author: tracker_migration Date: 2010-10-15   09h56
Posted by ahuillet
Excellent idea but we need to do that in a portable manner. 

SDL_net comes to mind but it's an added dependency, so... a named FIFO (mkfifo) could work too.
Author: tracker_migration Date: 2010-10-15   11h22
Posted by fluzz
a FIFO is not a portable thing. No FIFO on Windows... And how will you connect to the FIFO ? It's not so easy to use a FIFO as a bidir communication channel. But perhaps there is a tool that I'm not aware of which could be used for such a purpose... 
Author: tracker_migration Date: 2010-10-15   11h38
Posted by ahuillet
Two FIFOs. It's easier than sockets (provided we don't add dependencies), and while not portable, it wouldn't clutter our code more.

However - this is still more complicated than a small ingame console.
Author: tracker_migration Date: 2010-10-15   11h43
Posted by fluzz
Yes, 2 FIFOs, I know, I used FIFOs several times as a communication mean in real project, years ago... But what do you use to read from/write to those 2 FIFOs, in a 'comfortable' way ? (so not one window to read from the output FIFO, and an other one to write to the input FIFO)
Author: tracker_migration Date: 2011-03-21   08h20
Posted by ahuillet
I think a Lua console is overkill at this point.
Author: ahuillet Date: 2011-07-28   06h39
A socket would not be a bad idea, in fact. It would require SDL_net, however,
but I think we can easily make it optional!
History
Date User Action Args
2011-07-28 06:39:27ahuilletsetpriority: bug -> feature
2011-07-28 06:39:24ahuilletsetmessages: + msg1355
2011-07-24 19:07:56tracker_migrationcreate