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 Functions aren't functioning properly
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#1
Functions aren't functioning properly

I decided I'd jump into this map making stuff.

I found out how do to mostly everything in about 2 hours.

This is my second question.

Here is my first problem

void Start(string &in asParent, string &in asChild, int alState)
{
PlayMusic("16_amb.ogg", true, 1, 4, 0, true);
SetEntityPlayerInteractCallback("Open", "Change", true);
SetPlayerCrouching(true);
SetPlayerActive(false);
FadeOut(0.0f);
FadeIn(12.0f);
FadeImageTrailTo(1, 2);
StartPlayerLookAt("tree_pine_59", 10, 120, "");
FadeRadialBlurTo(0.10, 2);
FadeRadialBlurTo(0.10, 2);
AddTimer("1", 3, "BeginTimer");
AddTimer("2", 4.5f, "BeginTimer");
AddTimer("3", 6.5f, "BeginTimer");
AddTimer("4", 9, "BeginTimer");
AddTimer("5", 11, "BeginTimer");
AddTimer("6", 14, "BeginTimer");
}


void BeginTimer(string &in asTimer)
{
if(asTimer == "1"){
PlayGuiSound("player_cough.snt", 0.7f);
StopPlayerLookAt();
}
else if(asTimer == "2"){
FadePlayerRollTo(85, 1, 1);
SetPlayerCrouching(true);
}
else if(asTimer == "3"){
StartPlayerLookAt("tree_pine_47", 1, 2.0f, "");
AddEffectVoice("Chat2.ogg", "", "Subtitles", "Chat2", false, "Player", 0, 0);
}
else if(asTimer == "4"){
StopPlayerLookAt();
StartPlayerLookAt("tree_pine_24", 1, 2.0f, "");
PlayGuiSound("react_breath_slow.snt", 0.7f);
}
else if(asTimer == "5"){
StopPlayerLookAt();
StartPlayerLookAt("foliage_grass01_6", 1, 2.0f, "");
}
else if(asTimer == "6"){
StopPlayerLookAt();
FadeImageTrailTo(0, 1.0f);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
PlayGuiSound("react_breath_slow.snt", 0.5f);
SetPlayerActive(true);
AddEffectVoice("Chat1.ogg", "", "Subtitles", "Chat1", false, "Player", 0, 0);
SetPlayerCrouching(false);
}
}


The "StartPlayerLookAt" Function is not working. I have no map_cache files.
Also another one is broken.



void ScareTimer(string &in asTimer)
{
if(asTimer == "1"){
SetEntityActive("servant_brute_run_1", false);
GiveSanityDamage(5, true);
StopPlayerLookAt();
SetPlayerActive(true);
AddEffectVoice("Chat3.ogg", "", "Subtitles", "Chat3", false, "Player", 0, 0);
}
}


void Creep(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_wind.snt", "Player", 0, false);
SetPlayerActive(false);
StartPlayerLookAt("tree_pine_50", 1, 252.0f, "");
SetEntityActive("servant_brute_run_1", true);
AddTimer("1", 4, "ScareTimer");
AddEnemyPatrolNode("servant_brute_run_1", "PathNodeArea_1", 1, "");
}
"AddEnemyPatrolNode" Isn't activating. The monster will just aimlessly stand there.

CreateParticleSystemAtEntity("ParticleSystem_1", "ps_break_mansionbase_wall.ps", "Open", false);

This above is another failed one. I don't believe I'm using it correctly. I placed a particle system down named "ParticleSystem_1" Copied the system it plays. The "Open" entity is an "Examine Area", I have a setEntityPlayerInteract Script to the Examine Area.


This is like me trying to do the dishes. A lot of hard work is put into it and it's barely effective.


Thanks for reading my question.
Who ever has helped me before knows I give rep for help.


(FYI : I used this thread before.)
(This post was last modified: 07-07-2012, 09:45 PM by Kazakarumariou.)
07-06-2012, 04:59 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Loading screen text?

The function:
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);

Determines which loading screen will be shown when changing maps.

asTextCat - the category of the loading text in the .lang file to be shown on the loading screen
asTextEntry
- the entry in the .lang file
alRandomNum
- if greater 1, then it will randomize between 1
and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If
< =1 then no suffix is added
asImageFile
- the image to be shown (optional)




So in the .hps, do this:

void OnLeave()
{
SetupLoadScreen("LoadText", "01_mapLoadText", 0, "image.jpg");
}
(This post was last modified: 07-06-2012, 05:10 PM by Statyk.)
07-06-2012, 05:09 PM
Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#3
RE: Loading screen text?

(07-06-2012, 05:09 PM)Statyk Wrote: The function:
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);

Determines which loading screen will be shown when changing maps.

asTextCat - the category of the loading text in the .lang file to be shown on the loading screen
asTextEntry
- the entry in the .lang file
alRandomNum
- if greater 1, then it will randomize between 1
and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If
< =1 then no suffix is added
asImageFile
- the image to be shown (optional)


Fantastic!

Thanks for the immediate response. I will use this more in the future. +1 reputation for you.
07-06-2012, 05:22 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Loading screen text?

Here's the list of the rest of the functions if you need them

http://wiki.frictionalgames.com/hpl2/amn..._functions
07-06-2012, 05:31 PM
Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#5
RE: Functions aren't functioning properly

*Bump* I added a new question. Please read the first post again. Any new answers will go below.
Thanks for helping and reading this thread!
07-07-2012, 09:43 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Functions aren't functioning properly

For starters, it's OnStart, not Start. Secondly, the Creep function has a syntax for collision callbacks, but i couldn't find AddEntityCollideCallback anywhere in your script.

Tutorials: From Noob to Pro
07-07-2012, 10:41 PM
Website Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#7
RE: Functions aren't functioning properly

(07-07-2012, 10:41 PM)Your Computer Wrote: For starters, it's OnStart, not Start. Secondly, the Creep function has a syntax for collision callbacks, but i couldn't find AddEntityCollideCallback anywhere in your script.
I must have confused you with the lack of script.
I'll post my entire script so far.

-----------------

void OnStart()
{
AddEntityCollideCallback("Player", "Creep", "Creep", true, 1);
AddEntityCollideCallback("Player", "Start", "Start", true, 1);
SetEntityPlayerInteractCallback("castle_gate_arched01_1", "Open", true);
SetPlayerHealth(30);
}


void Start(string &in asParent, string &in asChild, int alState)
{
PlayMusic("16_amb.ogg", true, 1, 4, 0, true);
SetEntityPlayerInteractCallback("Open", "Change", true);
SetPlayerCrouching(true);
SetPlayerActive(false);
FadeOut(0.0f);
FadeIn(12.0f);
FadeImageTrailTo(1, 2);
StartPlayerLookAt("tree_pine_59", 10, 120, "");
FadeRadialBlurTo(0.10, 2);
FadeRadialBlurTo(0.10, 2);
AddTimer("1", 3, "BeginTimer");
AddTimer("2", 4.5f, "BeginTimer");
AddTimer("3", 6.5f, "BeginTimer");
AddTimer("4", 9, "BeginTimer");
AddTimer("5", 11, "BeginTimer");
AddTimer("6", 14, "BeginTimer");
}

void BeginTimer(string &in asTimer)
{
if(asTimer == "1"){
PlayGuiSound("player_cough.snt", 0.7f);
StopPlayerLookAt();
}
else if(asTimer == "2"){
FadePlayerRollTo(85, 1, 1);
SetPlayerCrouching(true);
}
else if(asTimer == "3"){
StartPlayerLookAt("tree_pine_47", 1, 2.0f, "");
AddEffectVoice("Chat2.ogg", "", "Subtitles", "Chat2", false, "Player", 0, 0);
}
else if(asTimer == "4"){
StopPlayerLookAt();
StartPlayerLookAt("tree_pine_24", 1, 2.0f, "");
PlayGuiSound("react_breath_slow.snt", 0.7f);
}
else if(asTimer == "5"){
StopPlayerLookAt();
StartPlayerLookAt("foliage_grass01_6", 1, 2.0f, "");
}
else if(asTimer == "6"){
StopPlayerLookAt();
FadeImageTrailTo(0, 1.0f);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
PlayGuiSound("react_breath_slow.snt", 0.5f);
SetPlayerActive(true);
AddEffectVoice("Chat1.ogg", "", "Subtitles", "Chat1", false, "Player", 0, 0);
SetPlayerCrouching(false);
}
}

void ScareTimer(string &in asTimer)
{
if(asTimer == "1"){
SetEntityActive("servant_brute_run_1", false);
GiveSanityDamage(5, true);
StopPlayerLookAt();
SetPlayerActive(true);
AddEffectVoice("Chat3.ogg", "", "Subtitles", "Chat3", false, "Player", 0, 0);
}
}

void Creep(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_wind.snt", "Player", 0, false);
SetPlayerActive(false);
StartPlayerLookAt("tree_pine_50", 1, 252.0f, "");
SetEntityActive("servant_brute_run_1", true);
AddTimer("1", 4, "ScareTimer");
AddEnemyPatrolNode("servant_brute_run_1", "PathNodeArea_1", 1, "");
}

void Change(string& asName)
{
FadeOut(1);
CreateParticleSystemAtEntity("ParticleSystem_1", "ps_break_mansionbase_wall.ps", "Open", false);
SetEntityActive("castle_gate_arched01_1", false);
AddTimer("1", 1, "ExitTimer");
PlayGuiSound("react_breath_slow.snt", 0.7f);
}

void ExitTimer(string &in asTimer)
{
if(asTimer == "1"){
ChangeMap("02_map","Map2Start", "door_level_cistern_open.snt", "door_level_engine_close.snt");
}
}

void OnEnter()
{

}


void OnLeave()
{
SetupLoadScreen("LoadText", "01_mapLoadText", 0, "Leave1.jpg");
}


-------------------
Edit :: Oh god it looks like such a mess without the spacing.
(This post was last modified: 07-07-2012, 11:02 PM by Kazakarumariou.)
07-07-2012, 11:01 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Functions aren't functioning properly

Are tree_pine_* and foliage_grass01_* static objects? I don't think StartPlayerLookAt works with static objects.

Try preloading the particle system in OnEnter and try the event again.

Play through the entire map, activating every event, then check the hpl.log at Documents/Amnesia/Main for any insight on any issues.

Tutorials: From Noob to Pro
(This post was last modified: 07-08-2012, 12:48 AM by Your Computer.)
07-08-2012, 12:47 AM
Website Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#9
RE: Functions aren't functioning properly

(07-08-2012, 12:47 AM)Your Computer Wrote: Are tree_pine_* and foliage_grass01_* static objects? I don't think StartPlayerLookAt works with static objects.

Try preloading the particle system in OnEnter and try the event again.

Play through the entire map, activating every event, then check the hpl.log at Documents/Amnesia/Main for any insight on any issues.
Awesome! That works.
As promised here is you +1reputation.
07-09-2012, 12:54 AM
Find




Users browsing this thread: 1 Guest(s)