Frictional Games Forum (read-only)
How do I make a lever that removes an entity? - 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: How do I make a lever that removes an entity? (/thread-10589.html)



How do I make a lever that removes an entity? - oscar1007 - 10-04-2011

Like the title says, How do I make a lever that removes an entity? Huh
Fast replies are much appreciated! Smile

Thanks!
please someone?
Im jusing it so i can remove knights that's blocking a way. so when you pull the lever they will disappear. Smile
Anyone? Huh


RE: How do I make a lever that removes an entity? - schmupper - 10-04-2011

Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("LeverName", "Function");
}


void OnEnter()
{

}

void Function(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetEntityActive("EntityName", false);
          return;
    }
void OnLeave()
{

}

That should work.



RE: How do I make a lever that removes an entity? - oscar1007 - 10-04-2011

(10-04-2011, 05:09 PM)schmupper Wrote:
Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("LeverName", "Function");
}


void OnEnter()
{

}

void Function(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetEntityActive("EntityName", false);
          return;
    }
void OnLeave()
{

}

That should work.
Thank you! it works now. but you forgot a "}" for ending the function. just sayin! Wink


RE: How do I make a lever that removes an entity? - schmupper - 10-04-2011

(10-04-2011, 05:25 PM)oscar1007 Wrote:
(10-04-2011, 05:09 PM)schmupper Wrote:
Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("LeverName", "Function");
}


void OnEnter()
{

}

void Function(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetEntityActive("EntityName", false);
          return;
    }
void OnLeave()
{

}

That should work.
Thank you! it works now. but you forgot a "}" for ending the function. just sayin! Wink
Great! Smile

Ah Ctrl+C/Ctrl+V can be your worst enemy in this business Smile



RE: How do I make a lever that removes an entity? - oscar1007 - 10-04-2011

(10-04-2011, 05:31 PM)schmupper Wrote:
(10-04-2011, 05:25 PM)oscar1007 Wrote:
(10-04-2011, 05:09 PM)schmupper Wrote:
Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("LeverName", "Function");
}


void OnEnter()
{

}

void Function(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetEntityActive("EntityName", false);
          return;
    }
void OnLeave()
{

}

That should work.
Thank you! it works now. but you forgot a "}" for ending the function. just sayin! Wink
Great! Smile

Ah Ctrl+C/Ctrl+V can be your worst enemy in this business Smile
And btw, how do i make that blue shiny thing the comes up at the screen when you etc. use sanity potion? thanks again! Big Grin




RE: How do I make a lever that removes an entity? - schmupper - 10-04-2011

(10-04-2011, 05:49 PM)oscar1007 Wrote: And btw, how do i make that blue shiny thing the comes up at the screen when you etc. use sanity potion? thanks again! Big Grin
No idea Sad I always thought that occured by itself?
But if you just mean the very effect... well I guess you should find it in the wiki if it exist http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#screen_effects

Code:
void GiveSanityBoost(); void GiveSanityBoostSmall();
Perhaps one of these?





RE: How do I make a lever that removes an entity? - Mehis - 10-04-2011

Code:
void GiveSanityBoost();
void GiveSanityBoostSmall();



RE: How do I make a lever that removes an entity? - oscar1007 - 10-04-2011

Thanks!