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?
FlawlessHappiness Offline
Posting Freak

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

(11-06-2012, 02:16 PM)craven7 Wrote:
if(GetSwingDoorLocked("BlockedDoor") == true);

{

AddQuest("BlockedDoorQuest", "BlockedDoorQuest");

}

the semicolon after the condition needs to be removed.
Also (the bigger problem I guess) your if (the code I posted 2 lines above) is not in a function/methode.

If you want to add a memento to a locked door I would do it like this:

SetEntityPlayerInteractCallback("door","interactLockedDoor",true);

void interactLockedDoor(string &in item)
{
    AddQuest("","lockedDoor");
}
string &in asItem is only used when you use an item on an entity. And that is: (string &in asItem, string &in asEntity)

(string &in asEntity) is when you interact with something

Trying is the first step to success.
11-06-2012, 02:47 PM
Find
Tiger Away
Posting Freak

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

Should I place the
"SetEntityPlayerInteractCallback("door","interactLockedDoor",true);"
in the Onstart or by itself?
11-06-2012, 04:04 PM
Find
The chaser Offline
Posting Freak

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

SetEntityPlayerInteractCallback("nameofdoor","interactLockedDoor",true);

void interactLockedDoor(string &in asEntity)
{
AddQuest("","lockedDoor");
}


Copy-paste this, adjust it and it should work.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

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

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

(11-06-2012, 04:19 PM)The chaser Wrote: SetEntityPlayerInteractCallback("nameofdoor","interactLockedDoor",true);

void interactLockedDoor(string &in asEntity)
{
AddQuest("","lockedDoor");
}


Copy-paste this, adjust it and it should work.
It still doesn't work.
Here is my script:


void OnStart()
{
}

SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true);

void BlockedDoorQuest(string &in asEntity)
{
AddQuest("","BlockedDoorQuest");
}

void OnEnter()
{
SetSkyBoxActive(true);
SetSkyBoxTexture("NightSky.dds");
}

void OnLeave()
{
CompleteQuest("", "BlockedDoorQuest");
}
11-06-2012, 04:28 PM
Find
craven7 Offline
Member

Posts: 50
Threads: 8
Joined: Aug 2012
Reputation: 1
#25
RE: Adding mementos to locked doors?

Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.

Quote: string &in asItem is only used when you use an item on an entity.
And that is: (string &in asItem, string &in asEntity)



(string &in asEntity) is when you interact with something
It doesn't matter if you name it item, entity, cookie or whatever. But semantically you are right Big Grin
11-06-2012, 05:29 PM
Find
FlawlessHappiness Offline
Posting Freak

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

(11-06-2012, 05:29 PM)craven7 Wrote: Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.

Quote: string &in asItem is only used when you use an item on an entity.
And that is: (string &in asItem, string &in asEntity)



(string &in asEntity) is when you interact with something
It doesn't matter if you name it item, entity, cookie or whatever. But semantically you are right Big Grin
It does matter! If you write the syntax wrong, it won't work

Trying is the first step to success.
11-06-2012, 06:15 PM
Find
Tiger Away
Posting Freak

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

(11-06-2012, 05:29 PM)craven7 Wrote: Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.
That's what I asked before but you guys didn't say so D:<
(This post was last modified: 11-06-2012, 08:45 PM by Tiger.)
11-06-2012, 08:31 PM
Find
FlawlessHappiness Offline
Posting Freak

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

(11-06-2012, 08:31 PM)Tigerwaw Wrote:
(11-06-2012, 05:29 PM)craven7 Wrote: Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.
That's what I asked before but you didn't say so D:<


You can also just go into the editor and place your function under: PlayerInteractCallback in the door-properties

Trying is the first step to success.
11-06-2012, 08:33 PM
Find
craven7 Offline
Member

Posts: 50
Threads: 8
Joined: Aug 2012
Reputation: 1
#29
RE: Adding mementos to locked doors?

Quote: That's what I asked before but you didn't say so D:<
Sorry.
You always have to put statements into functions ( == everything with ";" at the end has to be put in a { })
Big Grin
11-06-2012, 08:38 PM
Find
Tiger Away
Posting Freak

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

I'm still not sure what to write here:

AddQuest("Here","BlockedDoorQuest");
(This post was last modified: 11-08-2012, 03:15 PM by Tiger.)
11-06-2012, 08:43 PM
Find




Users browsing this thread: 5 Guest(s)