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 callback and scripting issues! :(
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#1
callback and scripting issues! :(

i am a beginner at scripting and i have a few questions...i am using the call back script to change my music in a game but the music wont change...and its not saying theres anything wrong with the script...wjat do i do???HELP PLEASE!

.....
(This post was last modified: 06-16-2014, 05:05 AM by G510s.)
06-16-2014, 05:04 AM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#2
RE: callback and scripting issues! :(

Post the script you used for the callback. Smile

06-16-2014, 05:55 AM
Find
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#3
RE: callback and scripting issues! :(

oid OnStart()
{
PlayMusic("10_amb", true, 4.3, 7, 2, true);


AddUseItemCallback("", "Key_01", "Door_01", "DoorUnlock", true);


AddEntityCollideCallback("Player", "Script", "Music", true, 1);
}

void DoorUnlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_Door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void Music(string &in asParent, string &in asChild, int alState)
{
PlayMusic("dan_Brute", true, 3.2, 8, 1, true);
}




void OnEnter()
{

}







void OnLeave()
{

}

void OnStart()
{
PlayMusic("10_amb", true, 4.3, 7, 2, true);


AddUseItemCallback("", "Key_01", "Door_01", "DoorUnlock", true);


AddEntityCollideCallback("Player", "Script", "Music", true, 1);
}

void DoorUnlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_Door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void Music(string &in asParent, string &in asChild, int alState)
{
PlayMusic("dan_Brute", true, 3.2, 8, 1, true);
}




void OnEnter()
{

}







void OnLeave()
{

}




-------------------------------------
srry i messed up i forgot to highlight the "V" on void on start.
(This post was last modified: 06-16-2014, 09:11 AM by G510s.)
06-16-2014, 09:10 AM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#4
RE: callback and scripting issues! :(

Your regular musics priority is higher than the brute music.

PlayMusic("10_amb", true, 4.3, 7, "2", true); - That is higher than the brutes music. (the one surrounded with "")
PlayMusic("dan_Brute", true, 3.2, 8, "1", true);

So change them to this below:

PlayMusic("10_amb", true, 4.3, 7, 0, true);
PlayMusic("dan_Brute", true, 3.2, 8, 10, true);

Derp.
(This post was last modified: 06-16-2014, 10:25 AM by Neelke.)
06-16-2014, 10:24 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: callback and scripting issues! :(

It might be important to name the dan_brute track correctly with case as well. The original sound file is named dan_brute with a lower B.

06-16-2014, 10:58 AM
Find




Users browsing this thread: 1 Guest(s)