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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't find my Custom Story
Author Message
i3670 Online
Posting Freak

Posts: 986
Joined: Oct 2011
Reputation: 27
Post: #11
RE: Can't find my Custom Story

(10-03-2011 04:51 PM)Your Computer Wrote:  You're missing a function definition for the third code block (line 13). A code block that isn't a function (a.k.a. nested code blocks) are only allowed within function code blocks.
I put in the definition:

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

Copy/paste from Frictional Games Script website. Gives me the same error message, except the numbers has changed to 55,2
10-03-2011 04:57 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #12
RE: Can't find my Custom Story

(10-03-2011 04:57 PM)i3670 Wrote:  I put in the definition:

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

Copy/paste from Frictional Games Script website. Gives me the same error message, except the numbers has changed to 55,2

I meant change this:
{
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

To something like this:
void FunctionNameHere()
{
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

Tutorials: From Noob to Pro
10-03-2011 05:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
i3670 Online
Posting Freak

Posts: 986
Joined: Oct 2011
Reputation: 27
Post: #13
RE: Can't find my Custom Story

It's suppose to look like this?

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
{
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

Or do you mean this one?
void MyFunc(string &in asParent, string &in asChild, int alState)
(This post was last modified: 10-03-2011 05:02 PM by i3670.)
10-03-2011 05:02 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #14
RE: Can't find my Custom Story

(10-03-2011 05:02 PM)i3670 Wrote:  Or do you mean this one?
void MyFunc(string &in asParent, string &in asChild, int alState)

Most likely this. Also, you're missing a comma on line 8 and a quotation mark on line 10.

Tutorials: From Noob to Pro
(This post was last modified: 10-03-2011 05:06 PM by Your Computer.)
10-03-2011 05:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
i3670 Online
Posting Freak

Posts: 986
Joined: Oct 2011
Reputation: 27
Post: #15
RE: Can't find my Custom Story

Got the error msg again

main (55,1) instead

Forget what I said about that msg.

Got a new one after the changes.

main (51,56): ERR: Expected '('
main (52,63): ERR: Expected '('
main (53,61): ERR: Expected '('
(This post was last modified: 10-03-2011 05:13 PM by i3670.)
10-03-2011 05:07 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #16
RE: Can't find my Custom Story

(10-03-2011 05:07 PM)i3670 Wrote:  Got the error msg again

main (55,1) instead

I've edited my previous post, and replace "bool abResume" with either true or false from this:
PlayMusic("general_piano03.snt", false, 1, 2, 1, bool abResume);
PlayMusic("player_react_guardian3.snt", false, 1, 2, 1, bool abResume);
PlayMusic("scare_male_terrified4.ogg", true, 1, 2, 1, bool abResume);

Tutorials: From Noob to Pro
10-03-2011 05:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
i3670 Online
Posting Freak

Posts: 986
Joined: Oct 2011
Reputation: 27
Post: #17
RE: Can't find my Custom Story

Woho the map works! Big Grin almost. My key doesn't work on my door.
10-03-2011 05:18 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #18
RE: Can't find my Custom Story

(10-03-2011 05:18 PM)i3670 Wrote:  Woho the map works! Big Grin almost. My key doesn't work on my door.

Try replacing your first MyFunc function with this:
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}

Tutorials: From Noob to Pro
10-03-2011 05:26 PM
Visit this user's website Find all posts by this user Quote this message in a reply
i3670 Online
Posting Freak

Posts: 986
Joined: Oct 2011
Reputation: 27
Post: #19
RE: Can't find my Custom Story

Don't I need to "bind" the key to a specific door for it to work?


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Bedroom", false, true);
PlaySoundAtEntity("", "unlock_door", "Bedroom", 0, false);
RemoveItem("Bedroomkey");
}

How it looks atm
(This post was last modified: 10-03-2011 05:39 PM by i3670.)
10-03-2011 05:38 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #20
RE: Can't find my Custom Story

(10-03-2011 05:38 PM)i3670 Wrote:  Don't I need to "bind" the key to a specific door for it to work?


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Bedroom", false, true);
PlaySoundAtEntity("", "unlock_door", "Bedroom", 0, false);
RemoveItem("Bedroomkey");
}

How it looks atm

The AddUseItemCallback function is what "binds" it to a door (entity). In your case, the door has to be called "Bedroom" and the key "Bedroomkey". However, you have "Key" in the AddUseItemCallback function.

Tutorials: From Noob to Pro
10-03-2011 05:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




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