Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Saving the game when the player interacts with something like a bed
Skiveo Offline
Junior Member

Posts: 25
Threads: 5
Joined: Jun 2012
Reputation: 0
#1
Question  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
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#2
RE: Saving the game when the player interacts with something like a bed

AutoSave();
06-22-2012, 08:56 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#3
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.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
(This post was last modified: 06-22-2012, 08:59 PM by i3670.)
06-22-2012, 08:58 PM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#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
Find
Skiveo Offline
Junior Member

Posts: 25
Threads: 5
Joined: Jun 2012
Reputation: 0
#5
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
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#6
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
Find
Skiveo Offline
Junior Member

Posts: 25
Threads: 5
Joined: Jun 2012
Reputation: 0
#7
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
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#8
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
Find
Skiveo Offline
Junior Member

Posts: 25
Threads: 5
Joined: Jun 2012
Reputation: 0
#9
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
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#10
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
Find




Users browsing this thread: 4 Guest(s)