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
Door messages and noises and memos in scripting?
MissMarilynn Offline
Member

Posts: 77
Threads: 23
Joined: Oct 2011
Reputation: 1
#5
RE: Door messages and noises and memos in scripting?

(10-17-2011, 11:23 PM)Your Computer Wrote:
(10-17-2011, 11:04 PM)MissMarilynn Wrote: Could you be a bit more detailed and give a scripted example of 1 and 2 and 3?

Example for 1 and 3:

PHP Code: (Select All)
void OnStart()
{
     
SetEntityPlayerInteractCallback("door_name""IsItLocked"false);
}

void IsItLocked(string &in entity)
{
     if (
GetSwingDoorLocked(entity)
     && 
entity == "door_name")
     {
          
SetMessage("cat_name""entry_name"0);
          
// Category name: "Journal"; Entry name: "Quest_open_door_Text"
          
AddQuest("open_door_quest""open_door");
     }


Example for 2:

PHP Code: (Select All)
PlaySoundAtEntity("play_sound_at_door""unlock_door.snt" /* or filename.snt */"door_name"0false);

GiveSanityBoostSmall(); // or GiveSanityBoost(); 
How would I set up the .lang stuff for 1 and 3? Particularly the quests.

and how do I get a message to show up for a locked door that I don't want to be unlocked. For instance, I have a door that is blocked from the other side. How do I get text to appear that says "It's blocked on the other side. You need to go a different way."
(10-17-2011, 11:23 PM)Your Computer Wrote:
(10-17-2011, 11:04 PM)MissMarilynn Wrote: Could you be a bit more detailed and give a scripted example of 1 and 2 and 3?

Example for 1 and 3:

PHP Code: (Select All)
void OnStart()
{
     
SetEntityPlayerInteractCallback("door_name""IsItLocked"false);
}

void IsItLocked(string &in entity)
{
     if (
GetSwingDoorLocked(entity)
     && 
entity == "door_name")
     {
          
SetMessage("cat_name""entry_name"0);
          
// Category name: "Journal"; Entry name: "Quest_open_door_Text"
          
AddQuest("open_door_quest""open_door");
     }


Example for 2:

PHP Code: (Select All)
PlaySoundAtEntity("play_sound_at_door""unlock_door.snt" /* or filename.snt */"door_name"0false);

GiveSanityBoostSmall(); // or GiveSanityBoost(); 
Your scripting gave me a whole lotta trouble. It says: "officekey' is not declared" when I put it in the entity section.

SetEntityPlayerInteractCallback("officedoor", "IsItLocked", false);



void IsItLocked(string &in entity)
{
if (GetSwingDoorLocked(officekey)
&& entity == "officedoor")
{
SetMessage("Journal", "Quest_open_door_Text", 0);
}
}


(This post was last modified: 10-17-2011, 11:59 PM by MissMarilynn.)
10-17-2011, 11:39 PM
Find


Messages In This Thread
RE: Door messages and noises and memos in scripting? - by MissMarilynn - 10-17-2011, 11:39 PM



Users browsing this thread: 1 Guest(s)