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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Adding mementos to locked doors?
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#1
Question  Adding mementos to locked doors?

I want to add a memento to a locked door and I looked for it on the wiki and found this:

http://wiki.frictionalgames.com/hpl2/tut...cked_doors


I tried to do the same thing but instead of a message I tried to make a memento "pop-up" and it does not work (surprisingly!). How should I do to make it work?
11-04-2012, 07:36 PM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#2
RE: Adding mementos to locked doors?

(11-04-2012, 07:36 PM)Tigerwaw Wrote: I want to add a memento to a locked door and I looked for it on the wiki and found this:

http://wiki.frictionalgames.com/hpl2/tut...cked_doors


I tried to do the same thing but instead of a message I tried to make a memento "pop-up" and it does not work (surprisingly!). How should I do to make it work?
did you create a lang file?

[Image: 2H1Mc.jpg]
11-04-2012, 07:40 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Adding mementos to locked doors?

So, the whole script would look like this:
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("EXAMPLE_DOOR") == true)
{

AddQuest(string& asName, string& asNameAndTextEntry);

}
}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-04-2012, 07:44 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#4
RE: Adding mementos to locked doors?

(11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?
Yes, of course

(11-04-2012, 07:44 PM)The chaser Wrote: So, the whole script would look like this:
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("EXAMPLE_DOOR") == true)
{

AddQuest(string& asName, string& asNameAndTextEntry);

}
What am I supposed to write into the .lang file and where should I write the name for the memento that is in the .lang file?
(This post was last modified: 11-04-2012, 08:39 PM by Tiger.)
11-04-2012, 07:54 PM
Find
ZeroPie Offline
Junior Member

Posts: 15
Threads: 2
Joined: Apr 2012
Reputation: 0
#5
RE: Adding mementos to locked doors?

(11-04-2012, 07:54 PM)Tigerwaw Wrote:
(11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?
Yes, of course

(11-04-2012, 07:44 PM)The chaser Wrote: So, the whole script would look like this:
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("EXAMPLE_DOOR") == true)
{

AddQuest(string& asName, string& asNameAndTextEntry);

}
What am I supposed to write into the .lang file and where should I write the name for the memento that is in the .lang file?
<Entry Name="Quest_MyQuest_Text">TEXT HERE</Entry>
Must be in .lang category Journal
And the script would like this: AddQuest("myquest", "MyQuest");
To complete a Momento(aka. quest) you just script this: CompleteQuest("myquest", "MyQuest");
So basicly the same but instead of 'Add' just type in 'Complete'.
Hope it helps.
11-04-2012, 11:18 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#6
RE: Adding mementos to locked doors?

(11-04-2012, 11:18 PM)ZeroPie Wrote:
(11-04-2012, 07:54 PM)Tigerwaw Wrote:
(11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?
Yes, of course

(11-04-2012, 07:44 PM)The chaser Wrote: So, the whole script would look like this:
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("EXAMPLE_DOOR") == true)
{

AddQuest(string& asName, string& asNameAndTextEntry);

}
What am I supposed to write into the .lang file and where should I write the name for the memento that is in the .lang file?
TEXT HERE
Must be in .lang category Journal
And the script would like this: AddQuest("myquest", "MyQuest");
To complete a Momento(aka. quest) you just script this: CompleteQuest("myquest", "MyQuest");
So basicly the same but instead of 'Add' just type in 'Complete'.
Hope it helps.


Ok thanks. Does it have to have a 'completeQuest'-thing or is it only if you want the player to regain sanity(the blue screen and calm music playing)?

AddQuest("myquest", "MyQuest");

What should I put instead of the 'MyQuest' and 'myquest'?


Is this right?

.hps:

If(GetSwingDoorLocked("BlockedDoor") == true)
{
AddQuest("myquest", "BlockedDoorQuest");
}

.lang:

<CATEGORY Name="Journal">
<Entry Name="Quest_BlockedDoorQuest_Text">Text that you're not allowed to see</Entry>
</LANGUAGE>
(This post was last modified: 11-05-2012, 12:38 PM by Tiger.)
11-04-2012, 11:19 PM
Find
ZeroPie Offline
Junior Member

Posts: 15
Threads: 2
Joined: Apr 2012
Reputation: 0
#7
RE: Adding mementos to locked doors?

(11-04-2012, 11:19 PM)Tigerwaw Wrote:
(11-04-2012, 11:18 PM)ZeroPie Wrote:
(11-04-2012, 07:54 PM)Tigerwaw Wrote:
(11-04-2012, 07:40 PM)ZodiaC Wrote: did you create a lang file?
Yes, of course

(11-04-2012, 07:44 PM)The chaser Wrote: So, the whole script would look like this:
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("EXAMPLE_DOOR") == true)
{

AddQuest(string& asName, string& asNameAndTextEntry);

}
What am I supposed to write into the .lang file and where should I write the name for the memento that is in the .lang file?
TEXT HERE
Must be in .lang category Journal
And the script would like this: AddQuest("myquest", "MyQuest");
To complete a Momento(aka. quest) you just script this: CompleteQuest("myquest", "MyQuest");
So basicly the same but instead of 'Add' just type in 'Complete'.
Hope it helps.


Ok thanks. Does it have to have a 'completeQuest'-thing or is it only if you want the player to regain sanity(the blue screen and calm music playing)?

AddQuest("myquest", "MyQuest");

What should I put instead of the 'MyQuest' and 'myquest'?


Is this right?

.hps:

If(GetSwingDoorLocked("BlockedDoor") == true)
{
AddQuest("myquest", "BlockedDoorQuest");
}

.lang:



Text that you're not allowed to see >[Image: smile.gif]

The CompleteQuest script is just to remove the momento from the player's journal, but it can be combined with sanity scripts too.
But the CompleteQuest script is not required, but if it's not used the momento will be there the whole Custom Story.
And the one with the lowercase letters 'myquest' can be anything but I recommend using the same as the one with uppercase letters. (And just so you know it doesn't need to be uppercase/lowercase, but I do like so.)
So you can change the AddQuest to: AddQuest("blockeddoorquest", "BlockedDoorQuest");
Try that out and tell us if it works.
(This post was last modified: 11-05-2012, 02:07 AM by ZeroPie.)
11-05-2012, 02:01 AM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#8
RE: Adding mementos to locked doors?

I've tried with this script:

.hps:

if(GetSwingDoorLocked("BlockedDoor") == true)
{
AddQuest("BlockedDoorQuest", "BlockedDoorQuest");
}

Void OnLeave()
{
CompleteQuest("BlockedDoorQuest", "BlockedDoorQuest");
}


.lang:

<CATEGORY Name="Journal">
<Entry Name="Quest_BlockedDoorQuest_Text">The door seems to be blocked from the inside. You need to find another way in.</Entry>
</CATEGORY>


It still gives me an error that says that there's something wrong with the .hps :c
(This post was last modified: 11-05-2012, 12:41 PM by Tiger.)
11-05-2012, 12:36 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: Adding mementos to locked doors?

Maybe it's not in that script, but rather somewhere where you mistakely deleted something, or added something. Check where the game says the problem is. It is described with line-numbers

fx: (Linenumber, Letternumber)
(95, 35)

Also tell us. What does the error say?
Unexpected end of file?
Unexpected ...?

Trying is the first step to success.
(This post was last modified: 11-05-2012, 01:00 PM by FlawlessHappiness.)
11-05-2012, 12:58 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#10
RE: Adding mementos to locked doors?

(11-05-2012, 12:58 PM)beecake Wrote: Maybe it's not in that script, but rather somewhere where you mistakely deleted something, or added something. Check where the game says the problem is. It is described with line-numbers

fx: (Linenumber, Letternumber)
(95, 35)

Also tell us. What does the error say?
Unexpected end of file?
Unexpected ...?
It says:

Spoiler below!

FATAL ERROR: Could not load script file
'custom_stories/MyCs/maps/MapName.hps'!
main (16, 2) : ERR : Unexpected end of file

11-05-2012, 01:17 PM
Find




Users browsing this thread: 1 Guest(s)