Frictional Games Forum (read-only)
[LVL ED] Need help... - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [LVL ED] Need help... (/thread-13778.html)

Pages: 1 2


RE: Need help... - jessehmusic - 03-07-2012

(03-06-2012, 05:28 PM)Nevicar Wrote: Last time I checked, if statements need a pair of brackets for their own statements.


i.e.


void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}

Maybe that?
noting works :/

void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}


RE: Need help... - Red - 03-07-2012

(03-07-2012, 09:59 PM)jessehmusic Wrote:
(03-06-2012, 05:28 PM)Nevicar Wrote: Last time I checked, if statements need a pair of brackets for their own statements.


i.e.


void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}

Maybe that?
noting works :/

void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}
To that //DO STUFF// you just add a function that does the thing what you want it to do when you enter the area with the key. like:
if(HasItem("key_study"){
GiveSanityBoostSmall();
}
(that gives you a sanityboost when you enter the area with the key named "key_study".)

EDIT: The script function is [bool HasItem(string& asName);]

have you tried using it this way?
[void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key"))
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}]




RE: Need help... - jessehmusic - 03-08-2012

(03-07-2012, 10:25 PM)Pyöveli Wrote:
(03-07-2012, 09:59 PM)jessehmusic Wrote:
(03-06-2012, 05:28 PM)Nevicar Wrote: Last time I checked, if statements need a pair of brackets for their own statements.


i.e.


void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}

Maybe that?
noting works :/

void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}
To that //DO STUFF// you just add a function that does the thing what you want it to do when you enter the area with the key. like:
if(HasItem("key_study"){
GiveSanityBoostSmall();
}
(that gives you a sanityboost when you enter the area with the key named "key_study".)

EDIT: The script function is [bool HasItem(string& asName);]

have you tried using it this way?
[void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key"))
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}]
Well im confused realy much about this "IF" can you make the script for the area to work ?


RE: Need help... - Red - 03-08-2012

(03-08-2012, 09:13 AM)jessehmusic Wrote:
(03-07-2012, 10:25 PM)Pyöveli Wrote:
(03-07-2012, 09:59 PM)jessehmusic Wrote:
(03-06-2012, 05:28 PM)Nevicar Wrote: Last time I checked, if statements need a pair of brackets for their own statements.


i.e.


void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}

Maybe that?
noting works :/

void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}
To that //DO STUFF// you just add a function that does the thing what you want it to do when you enter the area with the key. like:
if(HasItem("key_study"){
GiveSanityBoostSmall();
}
(that gives you a sanityboost when you enter the area with the key named "key_study".)

EDIT: The script function is [bool HasItem(string& asName);]

have you tried using it this way?
[void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key"))
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}]
Well im confused realy much about this "IF" can you make the script for the area to work ?
Okay...

void OnStart()
{
AddEntityCollideCallback("Player", "TestArea_1", "TestFunc", true, 1);
}


void TestFunc(string &in asParent,string &in asChild, int alState)
{
If(HasItem("Key_test"))GiveSanityBoostSmall();

}






RE: Need help... - jessehmusic - 03-09-2012

(03-08-2012, 09:30 AM)Pyöveli Wrote:
(03-08-2012, 09:13 AM)jessehmusic Wrote:
(03-07-2012, 10:25 PM)Pyöveli Wrote:
(03-07-2012, 09:59 PM)jessehmusic Wrote:
(03-06-2012, 05:28 PM)Nevicar Wrote: Last time I checked, if statements need a pair of brackets for their own statements.


i.e.


void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}

Maybe that?
noting works :/

void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}
To that //DO STUFF// you just add a function that does the thing what you want it to do when you enter the area with the key. like:
if(HasItem("key_study"){
GiveSanityBoostSmall();
}
(that gives you a sanityboost when you enter the area with the key named "key_study".)

EDIT: The script function is [bool HasItem(string& asName);]

have you tried using it this way?
[void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key"))
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}]
Well im confused realy much about this "IF" can you make the script for the area to work ?
Okay...

void OnStart()
{
AddEntityCollideCallback("Player", "TestArea_1", "TestFunc", true, 1);
}


void TestFunc(string &in asParent,string &in asChild, int alState)
{
If(HasItem("Key_test"))GiveSanityBoostSmall();

}
so i need "
GiveSanityBoostSmal" to get the collide to work...


RE: Need help... - jessehmusic - 03-09-2012

(03-08-2012, 09:30 AM)Pyöveli Wrote:
(03-08-2012, 09:13 AM)jessehmusic Wrote:
(03-07-2012, 10:25 PM)Pyöveli Wrote:
(03-07-2012, 09:59 PM)jessehmusic Wrote:
(03-06-2012, 05:28 PM)Nevicar Wrote: Last time I checked, if statements need a pair of brackets for their own statements.


i.e.


void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}

Maybe that?
noting works :/

void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}
To that //DO STUFF// you just add a function that does the thing what you want it to do when you enter the area with the key. like:
if(HasItem("key_study"){
GiveSanityBoostSmall();
}
(that gives you a sanityboost when you enter the area with the key named "key_study".)

EDIT: The script function is [bool HasItem(string& asName);]

have you tried using it this way?
[void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key"))
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}]
Well im confused realy much about this "IF" can you make the script for the area to work ?
Okay...

void OnStart()
{
AddEntityCollideCallback("Player", "TestArea_1", "TestFunc", true, 1);
}


void TestFunc(string &in asParent,string &in asChild, int alState)
{
If(HasItem("Key_test"))GiveSanityBoostSmall();

}
Still dosnt work :7


RE: Need help... - Red - 03-11-2012

(03-09-2012, 07:57 PM)jessehmusic Wrote:
(03-08-2012, 09:30 AM)Pyöveli Wrote:
(03-08-2012, 09:13 AM)jessehmusic Wrote:
(03-07-2012, 10:25 PM)Pyöveli Wrote:
(03-07-2012, 09:59 PM)jessehmusic Wrote: noting works :/

void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key") == true)//false//
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}
To that //DO STUFF// you just add a function that does the thing what you want it to do when you enter the area with the key. like:
if(HasItem("key_study"){
GiveSanityBoostSmall();
}
(that gives you a sanityboost when you enter the area with the key named "key_study".)

EDIT: The script function is [bool HasItem(string& asName);]

have you tried using it this way?
[void OnStart()
{
AddEntityCollideCallback(" ", "Ghost_Start_Area_Event", "Ghost_Horror_Ghost_Event1", true, 1);

}



void Ghost_Horror_Ghost_Event1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Scary_key"))
{
AddTimer("T4", 1.0f, "Timer_4");
AddTimer("T5", 1.5f, "Timer_5");
}
}
void Timer_4(string &in Timer)
{
SetEntityActive("alexander_3", true);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_5(string &in Timer)
{
SetEntityActive("alexander_3", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
}]
Well im confused realy much about this "IF" can you make the script for the area to work ?
Okay...

void OnStart()
{
AddEntityCollideCallback("Player", "TestArea_1", "TestFunc", true, 1);
}


void TestFunc(string &in asParent,string &in asChild, int alState)
{
If(HasItem("Key_test"))GiveSanityBoostSmall();

}
Still dosnt work :7
My mistake, those If should be if.(spelled on small i) try to change them and it does not need givesanityboos etc. i just wrote an example what it could do when you enter the area with the key or item.




RE: Need help... - Strembitsky - 03-11-2012

You guys are making it too complex. You could simply make it so that when the player interacts with the key, the script area is enabled, whereas it would be disabled before.


RE: Need help... - jessehmusic - 03-15-2012

(03-11-2012, 03:34 PM)Strembitsky Wrote: You guys are making it too complex. You could simply make it so that when the player interacts with the key, the script area is enabled, whereas it would be disabled before.
can you give me the script please ?