I'm writing a story where at some point the main character is going to realize he is the main character of a story (like in Redshirts, but different).
Now if that character was of the hero type, there would be no problem as heroes per definition think they are unsinkable and will save the girl. While most of them would probably die due to stupidity, being the main character has the advantage they don't (that's per requierement, my main characters don't just die half way through the story).
This character however is rather boring and after realizing he is not only the main character but actually the main character (read: the main joke) of a comical fantasy story, he loses all motivation to pursue the authors (my) agenda / the goals set out for him.
As an example think of the following situation (let's call the main character Joe).
Joe picks up the gun, pauses for a second or two, tilts his head while considering what seems to be a vaguely insane idea, puts the gun to his head, looks up - because for some reason he believes I am somewhere above him watching, which in itself is a rather unrealistic concept for I am an author and not a god, but we had already established Joe is not the most clever person and maybe a theological discussion should be moved into the appendix - and with a challenging tone says "You know what?! I'm done. Get me home now or the story ends right here! I'll count back from 3 and if I'm not home at 0, I'll kill your stupid main character. 3 ... 2 ... 1 ... I mean it!" Click. Dud shot. Click. Dud shot. Click. Dud shot. "Seriously?!"
The world doesn't have many specifics, the main character can't be 100% sure he actually is the main character, but apparently he evolved to just not care or he is certain enough. Now imagine beeing in that situation - you were thrown into a world where some allmighty entity threw you into a situation you completly dislike and has to prevent you from dying. You decide to challenge that entity instead of following it's plans.
My question is, how do I get that character back on track? Or rather, what can I build into my world to motivate someone to do as I say even though they know they have the sympathy points and I don't? As a limiting condition - I don't talk to any character, but I can do/create what I want as longs as it is funny.
So basically I need to construct a set of boundaries around a character's basic needs and that character beeing a "good person" to get him to go beat the bad guy.
To further narrow the question (and prevent it from beeing closed as to broad or off topic), I'm only interested in creating a set of boundaries around a "normal person" from a world like ours that does think what he perceives is real but knows there is any sort of restriction that keeps them from dying and just wants to go home.
Edit: As suggested in the comments I'll try adding something to rate the answers - (the mental hospital one is hilarious especially because it allows drugs and hypnosis to be introduced but) I'd like it to be something usable in a medieval/fantasy setting, it should be funny and disruptive to the main character (think of a battle between character and author) and require a minimum of direct author actions (just teleporting the character where I want him to be is a no go) and at the same time be effective. The mental hospital answer for example solves the problem in a way I really like, it's just not a perfect fit to my world (sorry for not making that clear before) and a little (really just a little) radical, but that's the way I was thinking, something using in world resources and e.g. just bad luck in that case to impose my will. The simpler the solution the better. Simpler in this case just means that the reader could accept that just happened or was a very smooth way of solving this problem (like that someone was watching and put him in a mental hospital, that's exactly the sort of accidental influence I'm aiming at).
Short example of another incident - the main character was shifted into another dimension by an anomaly while sitting on the toilet and there attacked by a skeleton. Because he had no way of winning that battle the toilet was dimension shifted too just a little later and crushed the skeleton - in my opinion that's a better fit than having a passing by giant stomp the skeleton into the ground.
I hope I actually made it clearer not unclearer ;)