Henriksen
Senior Member
Posts: 308
Threads: 71
Joined: Dec 2010
Reputation:
2
|
Wake Up Script Problems
Hi.
I need to find out a wake up script for my level
But i just get fatal error D:
So i wondered if anyone could see whats wrong in my script :/
This is the WHOLE hps file:
////////////////////////////
// Run first time starting map
void wakeUp ()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 11.0f, "beginStory");
}
void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}
{
AddUseItemCallback("", "Key1", "Unlock1", "UsedKeyOnDoor1", true);
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Unlock1", false, true);
PlaySoundAtEntity("", "unlock_door", "Unlock1", 0, false);
RemoveItem("Key1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("04_amb.ogg", true, 1.0f, 0, 0, true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|
|
01-29-2011, 06:19 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: Wake Up Script Problems
At "Run first time starting map", change the void wakeUp() to void OnStart().
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 01-29-2011, 06:26 PM by Robby.)
|
|
01-29-2011, 06:23 PM |
|
Henriksen
Senior Member
Posts: 308
Threads: 71
Joined: Dec 2010
Reputation:
2
|
RE: Wake Up Script Problems
(01-29-2011, 06:23 PM)Nemet Robert Wrote: At "Run first time starting map", change the void wakeUp() to void OnStart().
Hi i tried but it didnt work now my script look like this:
////////////////////////////
// Run first time starting map
void OnStart ()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 11.0f, "beginStory");
}
void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}
{
AddUseItemCallback("", "Key1", "Unlock1", "UsedKeyOnDoor1", true);
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Unlock1", false, true);
PlaySoundAtEntity("", "unlock_door", "Unlock1", 0, false);
RemoveItem("Key1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("04_amb.ogg", true, 1.0f, 0, 0, true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|
|
01-29-2011, 07:12 PM |
|
Oscar House
Senior Member
Posts: 302
Threads: 3
Joined: Nov 2010
Reputation:
9
|
RE: Wake Up Script Problems
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Key1", "Unlock1", "UsedKeyOnDoor1", true);
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 11.0f, "beginStory");
}
void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Unlock1", false, true);
PlaySoundAtEntity("", "unlock_door", "Unlock1", 0, false);
RemoveItem("Key1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("04_amb.ogg", true, 1.0f, 0, 0, true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
There. See if that works.
(This post was last modified: 01-29-2011, 07:25 PM by Oscar House.)
|
|
01-29-2011, 07:22 PM |
|
rmdashrf
Junior Member
Posts: 7
Threads: 3
Joined: Jan 2011
Reputation:
0
|
RE: Wake Up Script Problems
Wtf is this line
{
AddUseItemCallback("", "Key1", "Unlock1", "UsedKeyOnDoor1", true);
}
You need to declare it as a function. That syntax is invalid
|
|
01-29-2011, 07:59 PM |
|
Henriksen
Senior Member
Posts: 308
Threads: 71
Joined: Dec 2010
Reputation:
2
|
RE: Wake Up Script Problems (SOLVED)
Thanks guys it works now i just copied the code to Oscar House
|
|
01-30-2011, 11:43 AM |
|
|