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
Please Help!
EthanLancaster Offline
Junior Member

Posts: 15
Threads: 9
Joined: Mar 2012
Reputation: 0
#1
Please Help!

Ive been trying to find the error in this script for about an hour! Im really bad at it please help!

void OnStart ( )
{
AddUseItemCallback("", "LibraryKey, mansion_1, UsedKeyOnDoor, true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void UsedKeyOnDoor(string &in asEntity, int alState)
void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_1", false, true);
AddQuest ( "investigate", "Investigate" ) ;
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest ( "investigate", "Investigate" ) ;
}

03-15-2012, 05:16 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Please Help!

Do research on how to define a function.

Tutorials: From Noob to Pro
03-15-2012, 06:54 AM
Website Find
Equil Offline
Member

Posts: 94
Threads: 8
Joined: Sep 2010
Reputation: 0
#3
RE: Please Help!

Um, could you explain exactly what you're trying to achieve with this script? Unlock a door then start a quest?
03-15-2012, 07:16 AM
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#4
RE: Please Help!

You're missing an immense amount of quotations in your script. Do what Your Computer said.

The Nightmares v1.0 - Dreadful Fires WIP
03-15-2012, 02:23 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#5
RE: Please Help!

I see this error
AddUseItemCallback("", "LibraryKey, mansion_1, UsedKeyOnDoor, true);

See this ["LibraryKey]
Add them "
FIXED ["LibraryKey"]
See this [mansion_1]
FIXED ["mansion_1"]

--And I would add this to the scripts--
GiveSanityBoostSmall();
OR
GiveSanityBoost();
----

PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("LibraryKey");
-----------------Now Here I fix it all At once--------------
void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void UsedKeyOnDoor(string &in asEntity, int alState)
{
SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest ( "investigate", "Investigate" ) ;
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest ( "investigate", "Investigate" ) ;
GiveSanityBoostSmall();
}

-----------------------------
Plug that shit in and if a message pops up.
Reply that message so I can fixy
(This post was last modified: 03-16-2012, 01:21 AM by Xanthos.)
03-16-2012, 01:19 AM
Find
EthanLancaster Offline
Junior Member

Posts: 15
Threads: 9
Joined: Mar 2012
Reputation: 0
#6
RE: Please Help!

Thank you!!! I no longer get an error but the key will not go to the door. It says cannot use item this way. :/ Do I have to connect the props somehow? Thanks again for your help!
03-16-2012, 06:54 PM
Find
EthanLancaster Offline
Junior Member

Posts: 15
Threads: 9
Joined: Mar 2012
Reputation: 0
#7
RE: Please Help!

Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!

void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void KeyOnDoor(string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate") ;
GiveSanityBoostSmall();
}



03-16-2012, 08:12 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#8
RE: Please Help!

(03-16-2012, 08:12 PM)EthanLancaster Wrote: Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!

void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void KeyOnDoor(string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate") ;
GiveSanityBoostSmall();
}
I decided to post this on your thread so others can see.
The Error
void KeyOnDoor(string &in asEntity)

This Fixed
void KeyOnDoor(string &in asItem, string &in asEntity)

03-16-2012, 09:42 PM
Find
EthanLancaster Offline
Junior Member

Posts: 15
Threads: 9
Joined: Mar 2012
Reputation: 0
#9
RE: Please Help!

(03-16-2012, 09:42 PM)Xanthos Wrote:
(03-16-2012, 08:12 PM)EthanLancaster Wrote: Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!

void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void KeyOnDoor(string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate") ;
GiveSanityBoostSmall();
}
I decided to post this on your thread so others can see.
The Error
void KeyOnDoor(string &in asEntity)

This Fixed
void KeyOnDoor(string &in asItem, string &in asEntity)


That fixed it! Thank you!!!
03-16-2012, 10:14 PM
Find




Users browsing this thread: 1 Guest(s)