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
I can't get my script to work D:
Wrathborn771 Offline
Junior Member

Posts: 45
Threads: 10
Joined: Jun 2012
Reputation: 0
#1
I can't get my script to work D:

Hello,
I've come up with a script, based on a function I found at: http://wiki.frictionalgames.com/hpl2/amn..._functions

This is what it looks like:

void OnStart()
{
void Jump1(string& asName, string& asCallback);
}
Jump1("Player", "Thanks", "OnPickup");
{
SetEntityActive("bro_1", true);
AddTimer("", 200.4, "scared");
}
void scared(string &in asTimer)
{
SetEntityActive("bro_1", false);

I get the Fatal Error: Expected identifier all the time :/
I'm sure it's a super-easy-noob-error, because this is the very first time I script without using a tutorial on what/where to type..

Thank you for taking your time and reading this Wink
06-28-2012, 06:23 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#2
RE: I can't get my script to work D:

You dont seem to have any callback there.

06-28-2012, 10:36 PM
Find
Wrathborn771 Offline
Junior Member

Posts: 45
Threads: 10
Joined: Jun 2012
Reputation: 0
#3
RE: I can't get my script to work D:

(06-28-2012, 10:36 PM)Datguy5 Wrote: You dont seem to have any callback there.
Can you add what's missing then? :o
I accually have another function in that script, lemme post the full one for you to see:

void OnStart()
{
void Jump1(string& asName, string& asCallback);
}
Jump1("Player", "Thanks", "OnPickup");
{
SetEntityActive("bro_1", true);
AddTimer("", 200.4, "scared");
}
void scared(string &in asTimer)
{
SetEntityActive("bro_1", false);
AddEntityCollideCallback("Player", "bro_1", "collidemonster", true, 1);
}
void collidemonster(string &in asParent, string &in asChild, int alState)
{
StartCredits("29_amb_end_intense.ogg", true, "Ending", "MainCredits", 7);
}

Thanks for the reply Smile

P.S: I've played your CS Death Can Await. I must say, it was a masterpiece Wink I accually think it's one of my favorites. Big Grin
(This post was last modified: 06-28-2012, 11:31 PM by Wrathborn771.)
06-28-2012, 11:30 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#4
RE: I can't get my script to work D:

(06-28-2012, 11:30 PM)Wrathborn771 Wrote:
(06-28-2012, 10:36 PM)Datguy5 Wrote: You dont seem to have any callback there.
Can you add what's missing then? :o
I accually have another function in that script, lemme post the full one for you to see:

void OnStart()
{
void Jump1(string& asName, string& asCallback);
}
Jump1("Player", "Thanks", "OnPickup");
{
SetEntityActive("bro_1", true);
AddTimer("", 200.4, "scared");
}
void scared(string &in asTimer)
{
SetEntityActive("bro_1", false);
AddEntityCollideCallback("Player", "bro_1", "collidemonster", true, 1);
}
void collidemonster(string &in asParent, string &in asChild, int alState)
{
StartCredits("29_amb_end_intense.ogg", true, "Ending", "MainCredits", 7);
}

Thanks for the reply Smile

P.S: I've played your CS Death Can Await. I must say, it was a masterpiece Wink I accually think it's one of my favorites. Big Grin
void OnStart()
{
SetEntityCallbackFunc("NAME OF THE ITEM", "Jump1");
AddEntityCollideCallback("Player", "NAME OF THE SCRIPT AREA", "collidemonster", true, 1);
}
void Jump1(string& asName, string& asCallback);
{
AddTimer("scared", 2.4, "Timer_1");
}
void Timer_1(string &in asTimer)
{
SetEntityActive("bro_1", false);
}
void collidemonster(string &in asParent, string &in asChild, int alState)
{
StartCredits("29_amb_end_intense.ogg", true, "Ending", "MainCredits", 7);
}
void OnEnter()
{
}
void OnLeave()
{
}
Try that.Im not sure it will work(i doubt)but test it and say what happened(including a error report if you get one).Also what are you trying to do here?I had no idea Big Grin And i presume that Jump1("Player", "Thanks", "OnPickup"); you tried that when player picks up something,something will happen.Replace the NAME OF THE ITEM with the name of your item(obviously),and the NAME OF THE SCRIPT AREA replace with the name of the script area the player collides with.And thanks for liking my FIRST custom story :3 Have you seen the second one im currently making?

06-29-2012, 12:01 AM
Find
Wrathborn771 Offline
Junior Member

Posts: 45
Threads: 10
Joined: Jun 2012
Reputation: 0
#5
RE: I can't get my script to work D:

(06-29-2012, 12:01 AM)Datguy5 Wrote: void OnStart()
{
SetEntityCallbackFunc("NAME OF THE ITEM", "Jump1");
AddEntityCollideCallback("Player", "NAME OF THE SCRIPT AREA", "collidemonster", true, 1);
}
void Jump1(string& asName, string& asCallback);
{
AddTimer("scared", 2.4, "Timer_1");
}
void Timer_1(string &in asTimer)
{
SetEntityActive("bro_1", false);
}
void collidemonster(string &in asParent, string &in asChild, int alState)
{
StartCredits("29_amb_end_intense.ogg", true, "Ending", "MainCredits", 7);
}
void OnEnter()
{
}
void OnLeave()
{
}
Try that.Im not sure it will work(i doubt)but test it and say what happened(including a error report if you get one).Also what are you trying to do here?I had no idea Big Grin And i presume that Jump1("Player", "Thanks", "OnPickup"); you tried that when player picks up something,something will happen.Replace the NAME OF THE ITEM with the name of your item(obviously),and the NAME OF THE SCRIPT AREA replace with the name of the script area the player collides with.And thanks for liking my FIRST custom story :3 Have you seen the second one im currently making?
I'm sorry, you got something wrong in there :o
I want a monster (bro_1) to spawn when picking up a note (Thanks), and I want the credits to come up when he has killed the player.
So there is no script_area involved :/

Are you making another one? :o
I will totally play it! Big Grin
Will it be a total conversion? If not, I recomend you making it one, it's relly simple and I love more "custom" stories. Smile
Here's a tutorial, it takes like a few minutes to do one:
http://www.youtube.com/watch?v=puIfVx0lslA
06-30-2012, 02:23 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#6
RE: I can't get my script to work D:

(06-30-2012, 02:23 PM)Wrathborn771 Wrote:
(06-29-2012, 12:01 AM)Datguy5 Wrote: void OnStart()
{
SetEntityCallbackFunc("NAME OF THE ITEM", "Jump1");
AddEntityCollideCallback("Player", "NAME OF THE SCRIPT AREA", "collidemonster", true, 1);
}
void Jump1(string& asName, string& asCallback);
{
AddTimer("scared", 2.4, "Timer_1");
}
void Timer_1(string &in asTimer)
{
SetEntityActive("bro_1", false);
}
void collidemonster(string &in asParent, string &in asChild, int alState)
{
StartCredits("29_amb_end_intense.ogg", true, "Ending", "MainCredits", 7);
}
void OnEnter()
{
}
void OnLeave()
{
}
Try that.Im not sure it will work(i doubt)but test it and say what happened(including a error report if you get one).Also what are you trying to do here?I had no idea Big Grin And i presume that Jump1("Player", "Thanks", "OnPickup"); you tried that when player picks up something,something will happen.Replace the NAME OF THE ITEM with the name of your item(obviously),and the NAME OF THE SCRIPT AREA replace with the name of the script area the player collides with.And thanks for liking my FIRST custom story :3 Have you seen the second one im currently making?
I'm sorry, you got something wrong in there :o
I want a monster (bro_1) to spawn when picking up a note (Thanks), and I want the credits to come up when he has killed the player.
So there is no script_area involved :/

Are you making another one? :o
I will totally play it! Big Grin
Will it be a total conversion? If not, I recomend you making it one, it's relly simple and I love more "custom" stories. Smile
Here's a tutorial, it takes like a few minutes to do one:
http://www.youtube.com/watch?v=puIfVx0lslA

It wont be a total conversion.Here is the link to the thread: http://www.frictionalgames.com/forum/thread-14108.html And if you want the story to end when the monster kills the player,i suppose you could use a if function(i dont know exactly how they work so i cant help with that :/ ).

06-30-2012, 03:39 PM
Find
Wrathborn771 Offline
Junior Member

Posts: 45
Threads: 10
Joined: Jun 2012
Reputation: 0
#7
RE: I can't get my script to work D:

(06-30-2012, 03:39 PM)Datguy5 Wrote: It wont be a total conversion.Here is the link to the thread: http://www.frictionalgames.com/forum/thread-14108.html And if you want the story to end when the monster kills the player,i suppose you could use a if function(i dont know exactly how they work so i cant help with that :/ ).
But I already have the script with the credits, no need to worry about that. Smile
But can you please re-do the script you did for me yesterday without the script_area-function? Because I don't have a area involved.


I just need a monster to spawn when I pickup a letter, the monster is called "bro_1" and the letter is called "Thanks".

P.S: I look forward to play your new story, even tho it's not a total conversion. Tongue
06-30-2012, 03:48 PM
Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#8
RE: I can't get my script to work D:

float GetPlayerHealth(50);
-IF healt is below 50, it will be called, just setplayerhealth(0); and StartCredits()
simply nuff said

simply nuff said




06-30-2012, 03:48 PM
Find
Wrathborn771 Offline
Junior Member

Posts: 45
Threads: 10
Joined: Jun 2012
Reputation: 0
#9
RE: I can't get my script to work D:

(06-30-2012, 03:48 PM)EXAWOLT Wrote: float GetPlayerHealth(50);
-IF healt is below 50, it will be called, just setplayerhealth(0); and StartCredits()
simply nuff said
The problem I currently have is that I need a script which makes a monster spawn when picking up a note.
06-30-2012, 04:00 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#10
RE: I can't get my script to work D:

(06-30-2012, 04:00 PM)Wrathborn771 Wrote:
(06-30-2012, 03:48 PM)EXAWOLT Wrote: float GetPlayerHealth(50);
-IF healt is below 50, it will be called, just setplayerhealth(0); and StartCredits()
simply nuff said
The problem I currently have is that I need a script which makes a monster spawn when picking up a note.
Haven't done it myself but if you click your note inside the level editor and then press the entity tab of the note and on PlayerInteractCallback you can write the name of your function or it may work in the CallbackFunc too

06-30-2012, 04:21 PM
Find




Users browsing this thread: 2 Guest(s)