Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please Help!
Author Message
EthanLancaster Offline
Junior Member

Posts: 15
Joined: Mar 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,230
Joined: Jul 2011
Reputation: 215
Post: #2
RE: Please Help!
Do research on how to define a function.

Tutorials: From Noob to Pro
03-15-2012 06:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Equil Offline
Member

Posts: 94
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #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 all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 322
Joined: Mar 2012
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
EthanLancaster Offline
Junior Member

Posts: 15
Joined: Mar 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
EthanLancaster Offline
Junior Member

Posts: 15
Joined: Mar 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 322
Joined: Mar 2012
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
EthanLancaster Offline
Junior Member

Posts: 15
Joined: Mar 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)