Frictional Games Forum (read-only)
Scripts Recollection - 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 Articles (https://www.frictionalgames.com/forum/forum-40.html)
+---- Thread: Scripts Recollection (/thread-5117.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12


RE: Scripts Recollection - SilentStriker - 01-21-2012

This is a pretty effective script that makes you add/remove/lit alot of stuff without having alot of text Smile

For example if you have 6 torches and you want to turn off at the same time when walking in to an area you can use this Smile

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "NAMEOFTHEAREA", "FUNCTIONNAME", true, 1);
}

void FUNCTIONNAME(string &in asParent, string &in asChild, int alState)
{
for(int x = 1; x <= 6; x++) SetLampLit("LightName_"+x, false, false);
}



RE: Scripts Recollection - CorinthianMerchant - 01-21-2012

(01-21-2012, 10:03 AM)SilentStriker Wrote: This is a pretty effective script that makes you add/remove/lit alot of stuff without having alot of text Smile

For example if you have 6 torches and you want to turn off at the same time when walking in to an area you can use this Smile

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "NAMEOFTHEAREA", "FUNCTIONNAME", true, 1);
}

void FUNCTIONNAME(string &in asParent, string &in asChild, int alState)
{
for(int x = 1; x <= 6; x++) SetLampLit("LightName_"+x, false, false);
}


Thanks a lot, but what do I put instead of "FUNCTIONNAME", and how do I make it with the key?




RE: Scripts Recollection - SilentStriker - 01-21-2012

(01-21-2012, 02:29 PM)CorinthianMerchant Wrote:
(01-21-2012, 10:03 AM)SilentStriker Wrote: This is a pretty effective script that makes you add/remove/lit alot of stuff without having alot of text Smile

For example if you have 6 torches and you want to turn off at the same time when walking in to an area you can use this Smile

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "NAMEOFTHEAREA", "FUNCTIONNAME", true, 1);
}

void FUNCTIONNAME(string &in asParent, string &in asChild, int alState)
{
for(int x = 1; x <= 6; x++) SetLampLit("LightName_"+x, false, false);
}


Thanks a lot, but what do I put instead of "FUNCTIONNAME", and how do I make it with the key?
The FUCTIONNAME is just the name you want to call so it could be anything as long as you write the same on the void FUCTIONNAME

What do you mean about the key?




RE: Scripts Recollection - CorinthianMerchant - 01-21-2012


Quote:Lamps will extinguish when you pick up a key.



RE: Scripts Recollection - SilentStriker - 01-21-2012

(01-21-2012, 03:23 PM)CorinthianMerchant Wrote:
Quote:Lamps will extinguish when you pick up a key.
then you use this:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

instead of the AddEntityCollideCallback Smile




RE: Scripts Recollection - CorinthianMerchant - 01-21-2012

(01-21-2012, 03:43 PM)SilentStriker Wrote:
(01-21-2012, 03:23 PM)CorinthianMerchant Wrote:
Quote:Lamps will extinguish when you pick up a key.
then you use this:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

instead of the AddEntityCollideCallback Smile


Excellent!





RE: Scripts Recollection - jillis - 01-23-2012

Hey there I need some help! What I want: you pick up a key and something moves.
What I have:
PHP Code:
void OnStart()
{
    
SetEntityPlayerInteractCallback("key1""gotkey"true);
}

void gotkey(stringasNamestringasCallback)
{
    
AddDebugMessage("Picked up key LLOOOOOL"false); /// instead of AddPropImpulse for now.


What I get: nothing!
I've tried everything but it doesn't work!! I am sure the key is called key1. where does the message pop up? im in dev mode and show debug messages is enabled.



RE: Scripts Recollection - flamez3 - 01-23-2012

Wrong syntax.

Use:

(string &in asEntity, int alState)


Instead of

(string& asName, string& asCallback) Big Grin



RE: Scripts Recollection - jillis - 01-23-2012

(01-23-2012, 10:14 AM)flamez3 Wrote: Wrong syntax.

Use:

(string &in asEntity, int alState)


Instead of

(string& asName, string& asCallback) Big Grin
Sorry it doesn't work. I'm in a dev environment and show debug messages is on. I don't get any errors but I don't know where the msg is.




RE: Scripts Recollection - flamez3 - 01-24-2012

Oops, use (string &in asEntity) instead ^^