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
Scripting issues
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#1
Scripting issues

Ok so i got this script for this scene in a room, whats its supposed to do is when you walk to a script area the screen goes black and sound plays but while its doing that it teleports you to another room and then the screen goes to normal. But here is the problem the only thing that works atm is teleporting the player, the sound wont play and the fadein and fadeout is not working. Below is what i have right now, ive been working with it for a bit and i tried putting them all together instead of in different sections like it is now but that causes a error with the fades. Not to sure what to do.



void OnStart()
{
}

void OnEnter()
{
AddEntityCollideCallback("Player", "Teleport", "Nightmare", true, 1);
AddEntityCollideCallback("Player", "Grr", "Rawr", true, 1);
}

void OnLeave()
{
}

void Nightmare(string &inasParent, string &in asChild, int alState)
{
AddTimer("", 0, "Rawr");
AddTimer("", 0, "Fadeout");
TeleportPlayer("PlayerStartArea_2");
AddTimer("", 4.0, "Fadein");
}

void Fadein(float afTime)
{
Fadein(2);
}

void Fadeout(float afTime)
{
Fadeout(0);
}

void Rawr(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound)
{
PlaySoundAtEntity("insanity_monster_roar01", "insanity_monster_roar01.ogg", "player", 0, false);
}

[Image: qg_logo.png]
(This post was last modified: 12-23-2011, 03:33 AM by Nomad923.)
12-22-2011, 10:10 AM
Find
ferryadams10 Offline
Senior Member

Posts: 288
Threads: 40
Joined: Apr 2011
Reputation: 19
#2
RE: Scripting issues



This'll do it.

Add me on skype or steam for more questions.

Skype: ferryadams10

Steam: ferryadams1

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""Teleport""Nightmare"true1);
AddEntityCollideCallback("Player""Grr""Rawr"true1);

void Nightmare(string &in asParentstring &in asChildint alState)
{
AddTimer(""0"Fadeout");
TeleportPlayer("PlayerStartArea_2");
AddTimer(""4.0"Fadein");
}

void Fadein(float afTime)
{
Fadein(2);
}

void Fadeout(float afTime)
{
Fadeout(0);
}

void Rawr(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("insanity_monster_roar01""insanity_monster_roar01.ogg""player"0false);

void OnEnter()
{
}

void OnLeave()
{




Got a nice sofa
Please come and have a seat for a while

(This post was last modified: 12-22-2011, 10:40 AM by ferryadams10.)
12-22-2011, 10:39 AM
Find
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#3
RE: Scripting issues

(12-22-2011, 10:39 AM)ferryadams10 Wrote: This'll do it.

Add me on skype or steam for more questions.

Skype: ferryadams10

Steam: ferryadams1

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""Teleport""Nightmare"true1);
AddEntityCollideCallback("Player""Grr""Rawr"true1);

void Nightmare(string &in asParentstring &in asChildint alState)
{
AddTimer(""0"Fadeout");
TeleportPlayer("PlayerStartArea_2");
AddTimer(""4.0"Fadein");
}

void Fadein(float afTime)
{
Fadein(2);
}

void Fadeout(float afTime)
{
Fadeout(0);
}

void Rawr(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("insanity_monster_roar01""insanity_monster_roar01.ogg""player"0false);

void OnEnter()
{
}

void OnLeave()
{

No it still just teleports, no sounds is made and the fading is not working.


[Image: qg_logo.png]
12-22-2011, 10:45 AM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#4
RE: Scripting issues

Change the (float afTime) to (string &in asTimer)
I also think that the timer needs some kind of value. Change 0 to 0.01f or something.

Creator of The Dark Treasure.
12-22-2011, 01:57 PM
Website Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#5
RE: Scripting issues

Also, "player" should be "Player" that will be why no sound plays, because it is trying to play a sound at an entity that doesn't exist! junkfood's post will fix your fadein problem Smile

12-22-2011, 06:18 PM
Find
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#6
RE: Scripting issues

Ok ill give it a try.....I get an error saying No matching signatures to 'Fadein...... wait a minute *Changes Fadein to FadeIn, and Fadeout to FadeOut* let me try again...... Everything works now except the sound, let me try one thing and see how it goes......Nope the sound still does not play.

[Image: qg_logo.png]
12-23-2011, 12:47 AM
Find
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#7
RE: Scripting issues

Nevermind got it to work

[Image: qg_logo.png]
12-23-2011, 03:33 AM
Find




Users browsing this thread: 1 Guest(s)