FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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)
Aculy iz dolan.
|
|
11-06-2012, 04:19 PM |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
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 |
|
craven7
Member
Posts: 50
Threads: 8
Joined: Aug 2012
Reputation:
1
|
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
|
|
11-06-2012, 05:29 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 Big Grin](https://www.frictionalgames.com/forum/images/smilies/biggrin.gif) 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 |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
craven7
Member
Posts: 50
Threads: 8
Joined: Aug 2012
Reputation:
1
|
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 { })
|
|
11-06-2012, 08:38 PM |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
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 |
|
|