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 I need a help please
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#11
RE: I need a help please

It is like this Neelke

Spoiler below!
void PickKey(string &in asEntity, string &in asType)
{
GiveSanityBoostSmall(); //Just a nice little sanity boost
SetSwingDoorLocked("Door01", false, true);
}

SetEntityPlayerInteractCallback("Key01", "PickKey", true);


(This post was last modified: 05-14-2014, 06:53 PM by Statyk.)
05-14-2014, 06:50 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#12
RE: I need a help please

So how does the whole script look at the moment?
05-14-2014, 06:54 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#13
RE: I need a help please

Spoiler below!
void OnStart()

{
AddEntityCollideCallback("Player", "CloseDoor", "CollideLockDoor", true, 1);
AddEntityCollideCallback("Player", "Area01", "LookBack01", true, 1);
SetEntityPlayerInteractCallback("Key01", "PickKey", true);
}

void LookBack01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door01", 2, 25, "CallbackName");
AddTimer("", 3, "StopLookingAtDoor");
AddTimer("DoorDown", 3, "LockDoor");
}

void StopLookingAtDoor(string &in asTimer)
{
StopPlayerLookAt();
}

void LockDoor(string &in asTimer)
{
SetSwingDoorLocked("Door01", true, true);

PlaySoundAtEntity("bang", "scare_slam_door", "castle_1", 0.0f, false);
StartScreenShake(0.02f, 1.0f, 0.5f, 1.0f);
}

void PickKey(string &in asEntity, string &in asType)
{
GiveSanityBoostSmall(); //Just a nice little sanity boost
SetSwingDoorLocked("Door01", false, true);
}
Forgot in last post NOT WORKING:Key and Sounds i don't know what is wrong whith sounds but it's okay

Fix the sound Smile

(This post was last modified: 05-14-2014, 07:10 PM by Straxedix.)
05-14-2014, 06:56 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#14
RE: I need a help please

I told you that the sound is played on the wrong object. Try with this:

PlaySoundAtEntity("bang", "scare_slam_door", "Door01", 0.0f, false);

I might sound rude, but please pay attention to what I say.

Derp.
(This post was last modified: 05-14-2014, 08:49 PM by Neelke.)
05-14-2014, 08:49 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#15
RE: I need a help please

Yeah i saw that two x) but what is wrong with key

05-15-2014, 09:35 AM
Find
Red Offline
Posting Freak

Posts: 1,757
Threads: 49
Joined: Feb 2012
Reputation: 54
#16
RE: I need a help please

Key is not working? You have to use "AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy)", for it to work.
And for the syntax: "void YourFunction(string &in asItemA, string &in asItemB)"

asName - internal name for the callback
asItemA - internal name of first item
asItemB - internal name of second item
asFunction - the function to call
abAutoRemove - determines whether the callback should be removed when the items are combined

I would recommend to put the "AddUseItemCallback" script under OnStart() or OnEnter() section.
(This post was last modified: 05-15-2014, 02:56 PM by Red.)
05-15-2014, 02:46 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#17
RE: I need a help please

I need to make that when pick up just pick up key doors unlock WITHOUT USING IT!

05-15-2014, 03:22 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#18
RE: I need a help please

Just remove SetSwingDoorLocked then. Simple as that. (if I understand you)

Derp.
(This post was last modified: 05-15-2014, 03:50 PM by Neelke.)
05-15-2014, 03:50 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#19
RE: I need a help please

In the future, please name your threads according what your problem is, instead of ''I need help''

Makes it easier for everyone to see if it's something they can actually help with without checking the thread.
05-15-2014, 04:41 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#20
RE: I need a help please

Traggey ok i will
Neelke you gived me script SetSwingDoorLocked so guess to leave that like that to delete it ok to understand me clean look

Spoiler below!
I need after script we make (doors close by it self turning around blah blah blah) to just pick the... yes PICK KEY and WITHOUT USING KEY on door Door01 Unlock


(This post was last modified: 05-15-2014, 07:53 PM by Straxedix.)
05-15-2014, 07:00 PM
Find




Users browsing this thread: 3 Guest(s)