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 Music Help
RedSampson00 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Nov 2012
Reputation: 0
#1
Music Help

I have been having problems with my script. I used a Youtube tutorial to get my first music file working. After that, I tried to do it by myself. Didn't work out very well Sad.
Music_2 is the music file not working. I get an error saying the signatures don't match on lines 5, 142 or something like that. You'll find the rest of the script for the Music_2 file after all the pathnode spam. Thanks in advance.

void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Music_2", "StartMusic_2", true, 1);
AddUseItemCallback("", "key_1", "lockdoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide_2", "ArmourFunc", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
}

void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic ("Music1", true, 0.8, 2, 1, true);
}

void StartMusic_2(string &in asParent, string &in asChild, int alState)
{
PlayMusic ("enemy_hallucination_disappear", 0.8, 2, 1, true);
}

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

void ArmourFunc(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_1", true);
}
(This post was last modified: 11-18-2012, 02:04 PM by RedSampson00.)
11-18-2012, 01:28 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Music Help

1. Is it a custom music file?
2. Where did you place it?
3. Tell us the error you get. It's pretty important what it says

Trying is the first step to success.
11-18-2012, 02:49 PM
Find
RedSampson00 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Nov 2012
Reputation: 0
#3
RE: Music Help

1. No

2.I copied it from its original location into my custom story folder.

3. FATAL ERROR:blah blah blah blah

main (142,7) : ERR :No matching signatures to 'PlayMusic(string@&, const double, const uint, const uint, const bool)
(This post was last modified: 11-18-2012, 03:08 PM by RedSampson00.)
11-18-2012, 03:04 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#4
RE: Music Help

PlayMusic ("enemy_hallucination_disappear", 0.8, 2, 1, true);
must be
PlayMusic ("enemy_hallucination_disappear", true, 0.8, 2, 1, true);

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
11-18-2012, 03:28 PM
Find
RedSampson00 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Nov 2012
Reputation: 0
#5
RE: Music Help

Thank you, works great now Smile.

Only one thing, I don't want the sounds to repeat after they have already occured, for some reason that is happening.
(This post was last modified: 11-18-2012, 03:41 PM by RedSampson00.)
11-18-2012, 03:38 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Music Help

PlayMusic ("enemy_hallucination_disappear", true, 0.8, 2, 1, true);


This true indicates if it should loop...


Is enemy_hallucination_disappear even a music file??


With sounds you should use:
PlaySoundAtEntity("", "enemy_hallucination_disappear.snt", "Player", 0.0f, false);

Trying is the first step to success.
11-18-2012, 04:05 PM
Find
RedSampson00 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Nov 2012
Reputation: 0
#7
RE: Music Help

Thanks a lot! I'm kind of a noob when it comes to scripting :/.
11-18-2012, 04:07 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#8
RE: Music Help

Did you know that you don't need to have to use that function for every Path node? You could simply do like this instead:

AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
11-18-2012, 07:32 PM
Website Find




Users browsing this thread: 1 Guest(s)