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
Can someone take a look?
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#1
Can someone take a look?

PLEASE SEE 5th RESPONCE

Spoiler below!

Can someone help me out with this script, I have no clue what is wrong. I am honestly no good at this and keep getting something wrong please help if you can!

Quote: ////////////////////////////
// Run when entering map
void OnEnter(){
void wakeUp ()
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last


void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);



SetPlayerSanity(10);
SetPlayerHealth(40);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}

(This post was last modified: 05-12-2012, 02:06 AM by Cocomunches.)
05-09-2012, 04:02 AM
Find
JMFStorm Offline
Member

Posts: 205
Threads: 8
Joined: Aug 2011
Reputation: 28
#2
RE: Can someone take a look?

When I quickly watch this I can tell you should remove: "void wakeUp ()", and then put "}" after this line: "AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last".

05-09-2012, 04:42 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#3
RE: Can someone take a look?

There are lots of problems I can point out.Never put one function inside another or you will get tons of errors. So, it should be organized like this:

void OnEnter()
{
stuff
}


void beginStory(string &in asTimer)
{
stuff
}

Like JMFStorm said, get rid of "void wakeup ()", it serves no purpose.
Make sure every function has its own open and close bracket.
Make sure every number with a decimal is followed by "f": e.g. "10.0f".

05-09-2012, 05:00 AM
Find
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#4
RE: Can someone take a look?

I recommend that you don't use this script for the beginning, watch some Youtube tutorials, or read some beginner tutorials on the wiki, then when you get the scripts. Use this one.

Signature to awesome to be displayed.
05-09-2012, 05:04 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#5
RE: Can someone take a look?

Put the stuff in the void OnStart from the void OnEnter

05-09-2012, 07:38 PM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#6
RE: Can someone take a look?

I need some help here if anyone can take a look at this script and tell me what is wrong, I keep getting an error on line 38,56 and don't know what's wrong.

Spoiler below!
////////////////////////////
// Run when entering map
Void OnStart()

{
AddEntityCollideCallback("Player", "ScriptArea_1", "SetEntityActive", true, 1);
}

void OnEnter(){

FadeOut(20); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 8.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);



SetPlayerSanity(10);
SetPlayerHealth(40);
}

////////////////////////////
//Insane statue effect

void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)

{
PlaySoundAtEntity("", "react_scare", "Player", 1.0f, false);

SetEntityActive ("deformed_man_5", false);
SetEntityActive ("deformed_man_6", false);
SetEntityActive ("deformed_man_7", false);
SetEntityActive ("deformed_man_8", false);
SetEntityActive ("deformed_man_9", false);
SetEntityActive ("deformed_man_10", false);
SetEntityActive ("deformed_man_11", false);
SetEntityActive ("deformed_man_12", false);
SetEntityActive ("deformed_man_13", false);
SetEntityActive ("deformed_man_14", false);
SetEntityActive ("deformed_man_15", false);
SetEntityActive ("deformed_man_16", false);
SetEntityActive ("deformed_man_17", false);
SetEntityActive ("deformed_man_18", false);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
(This post was last modified: 05-12-2012, 02:11 AM by Cocomunches.)
05-12-2012, 02:04 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#7
RE: Can someone take a look?

First of all, it's "void", not "Void".

Second of all, wtf is this?
Quote:void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)
I mean, what were you even trying to do here? Change an already existing function and then just add some additional parameters because they looked nice?

Understand what you're doing. That's my solution.

Noob scripting tutorial: From Noob to Pro

05-12-2012, 02:17 AM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#8
RE: Can someone take a look?

(05-12-2012, 02:17 AM)Cranky Old Man Wrote: First of all, it's "void", not "Void".

Second of all, wtf is this?
Quote:void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)
I mean, what were you even trying to do here? Change an already existing function and then just add some additional parameters because they looked nice?

Understand what you're doing. That's my solution.
"Understand what you're doing. That's my solution."

Well I ask for help to get a better understanding of what I am doing.

and

"void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)"

must have gotten jumbled up with something else when I was deleting something else. And I think it looks very nice! Thank you for thinking so too!
05-12-2012, 02:30 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#9
RE: Can someone take a look?

(05-12-2012, 02:30 AM)Cocomunches Wrote:
(05-12-2012, 02:17 AM)Cranky Old Man Wrote: First of all, it's "void", not "Void".

Second of all, wtf is this?
Quote:void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)
I mean, what were you even trying to do here? Change an already existing function and then just add some additional parameters because they looked nice?

Understand what you're doing. That's my solution.
"Understand what you're doing. That's my solution."

Well I ask for help to get a better understanding of what I am doing.

and

"void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)"

must have gotten jumbled up with something else when I was deleting something else. And I think it looks very nice! Thank you for thinking so too!
You don't just ask for help every time your code somehow doesn't work.
Begin from the beginning: Learn to script with the aid of manuals and tutorials.
Here's an online tutorial: From Noob to Pro

Noob scripting tutorial: From Noob to Pro

05-12-2012, 02:39 AM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#10
RE: Can someone take a look?

(05-12-2012, 02:39 AM)Cranky Old Man Wrote:
(05-12-2012, 02:30 AM)Cocomunches Wrote:
(05-12-2012, 02:17 AM)Cranky Old Man Wrote: First of all, it's "void", not "Void".

Second of all, wtf is this?
Quote:void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)
I mean, what were you even trying to do here? Change an already existing function and then just add some additional parameters because they looked nice?

Understand what you're doing. That's my solution.
"Understand what you're doing. That's my solution."

Well I ask for help to get a better understanding of what I am doing.

and

"void SetEntityActive(string& asName, bool abActive);(string &in asParent, string &in asChild, int alState)"

must have gotten jumbled up with something else when I was deleting something else. And I think it looks very nice! Thank you for thinking so too!
You don't just ask for help every time your code somehow doesn't work.
Begin from the beginning: Learn to script with the aid of manuals and tutorials.
Here's an online tutorial: From Noob to Pro
But of course I ask when I need help. You can choose not to help.
05-12-2012, 02:43 AM
Find




Users browsing this thread: 1 Guest(s)