Frictional Games Forum (read-only)

Full Version: Saving the game when the player interacts with something like a bed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How do people make it so that when you click something for example a bed the game saves, this would be really helpfull

Thanks
AutoSave();
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.
sorry for the vivid response i was caught up in my custom story lol
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.
}
(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);
Thanks, it works, is there also a way that when the player steps on the bed he will ''fall asleep''?
(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
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)
(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
Pages: 1 2