Skiveo
Junior Member
Posts: 25
Threads: 5
Joined: Jun 2012
Reputation:
0
|
Saving the game when the player interacts with something like a bed
How do people make it so that when you click something for example a bed the game saves, this would be really helpfull
Thanks
Don't fear the shadows, it means there's a light nearby
Projects:
W.I.P. -A New Place- (Full Conversion)
|
|
06-22-2012, 08:54 PM |
|
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
|
RE: Saving the game when the player interacts with something like a bed
AutoSave();
|
|
06-22-2012, 08:56 PM |
|
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
|
RE: Saving the game when the player interacts with something like a bed
Well first you need to create a script area and tick the interact-box, write the callback etc.
Then I believe you use
AutoSave();
EDIT:
Dammit! Ninjad.
(This post was last modified: 06-22-2012, 08:59 PM by i3670.)
|
|
06-22-2012, 08:58 PM |
|
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
|
RE: Saving the game when the player interacts with something like a bed
sorry for the vivid response i was caught up in my custom story lol
|
|
06-22-2012, 09:00 PM |
|
Skiveo
Junior Member
Posts: 25
Threads: 5
Joined: Jun 2012
Reputation:
0
|
RE: Saving the game when the player interacts with something like a bed
Hm it won't work, this is what I did (not sure if I did it right >_<)
I putted down a bed first made a script area and in the .hps file I typed:
SetEntityPlayerInteractCallback("ScriptArea_1", "Save", false);
and then:
void Save(string &in asChild, string &in asParent, int alState)
{
AutoSave();
SetMessage("Messages", "PopUp5", 0);
///////this is so that the player will see the game is save.
}
Don't fear the shadows, it means there's a light nearby
Projects:
W.I.P. -A New Place- (Full Conversion)
|
|
06-22-2012, 09:12 PM |
|
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
|
RE: Saving the game when the player interacts with something like a bed
(06-22-2012, 09:12 PM)Skiveo Wrote: Hm it won't work, this is what I did (not sure if I did it right >_<)
I putted down a bed first made a script area and in the .hps file I typed:
SetEntityPlayerInteractCallback("ScriptArea_1", "Save", false);
and then:
void Save(string &in asChild, string &in asParent, int alState)
{
AutoSave();
SetMessage("Messages", "PopUp5", 0);
///////this is so that the player will see the game is save.
} its not SetEntityInteractCallback, you have to use AddEntityCollideCallback("Player", "ScriptArea_1", "Save", true, 1);
|
|
06-22-2012, 09:16 PM |
|
Skiveo
Junior Member
Posts: 25
Threads: 5
Joined: Jun 2012
Reputation:
0
|
RE: Saving the game when the player interacts with something like a bed
Thanks, it works, is there also a way that when the player steps on the bed he will ''fall asleep''?
Don't fear the shadows, it means there's a light nearby
Projects:
W.I.P. -A New Place- (Full Conversion)
|
|
06-22-2012, 09:20 PM |
|
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
|
RE: Saving the game when the player interacts with something like a bed
(06-22-2012, 09:20 PM)Skiveo Wrote: Thanks, it works, is there also a way that when the player steps on the bed he will ''fall asleep''? along the same lines as before, have your script area on the bed and when the player enters the area have the screen fade out and use FadePlayerRollTo.
Something like this
AddEntityCollideCallback("Player", "ScriptArea_2", "Sleep", true, 1);
void Sleep(string &in asParent, string &in asChild, int alState)
{
FadeOut(10.0);
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
SetPlayerCrouching(true);
FadePlayerRollTo(50,150,150);
}
//may need to play around with it a little
|
|
06-22-2012, 09:28 PM |
|
Skiveo
Junior Member
Posts: 25
Threads: 5
Joined: Jun 2012
Reputation:
0
|
RE: Saving the game when the player interacts with something like a bed
Ok, just one more thing, how do I take away the Save and Exit button when you press escape? (not just for me but for everyone who downloads it)
Don't fear the shadows, it means there's a light nearby
Projects:
W.I.P. -A New Place- (Full Conversion)
|
|
06-22-2012, 09:33 PM |
|
drunkmonk
Member
Posts: 109
Threads: 7
Joined: Jun 2012
Reputation:
4
|
RE: Saving the game when the player interacts with something like a bed
(06-22-2012, 09:33 PM)Skiveo Wrote: Ok, just one more thing, how do I take away the Save and Exit button when you press escape? (not just for me but for everyone who downloads it) I'm not sure that you can
|
|
06-22-2012, 09:34 PM |
|
|