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 - Kyle - 11-09-2011

In math, as they say, combine like terms.

So what is in the void OnStart() combines with what is in the other one.

It should look like this:

Code:
void OnStart()
{
     AddUseItemCallback("", "torture_1", "castle_1", "KeyOnDoor1", true);
     AddUseItemCallback("", "tomb", "mansion_1", "KeyOnDoor2", true);
     AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunc1", true, 1);
}

void KeyOnDoor1(string &in asItem, string &in asEntity)
{
     SetSwingDoorLocked("castle_1", false, true);
     PlaySoundAtEntity("", "unlock_door.snt", "castle_1", 0.0f, true);
     RemoveItem("torture_1");
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
     SetSwingDoorLocked("mansion_1", false, true);
     PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
     RemoveItem("tomb");
}

void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
     SetEntityActive("servant_grunt", true);
}

void OnLeave()
{
}




RE: Scripts Recollection - teddan50 - 12-12-2011

(04-18-2011, 05:42 PM)nkmol Wrote: i'm trying to use the moveable_book, but it seems it doesn't work as a normal lever :S
i used this script :
Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("book_moveable_1", "BookMoved");
}

void BookMoved(string &in EntityName, int alState)
{
AddDebugMessage("book_moveable_1" + "'s current state: " + alState, false);

if(alState == 1)
{
SetPropHealth("default_broken01_1", 0);
StartScreenShake(0.07f, 0.3f, 1, 1);
SetLeverStuckState("book_moveable_1", 1, true);
}
}


even the DebugMessage doesn't work.
I don't get any error, think it has to do whith the OnStart line though. But i can't find a other script that works. And yes, i putted the callback in the level editor Big Grin




I did it like this:

void OnStart()
{
AddEntityCollideCallback("booklever_1", "ScriptArea_1", "Dooropening", true, 1);

}

void Dooropening(string &in asParent , string &in asChild , int alState)
{
SetSwingDoorLocked("mansion_1", false, false);
}



Probably not the correct method, but it worked for me. You just have to make sure that the book enters the scriptarea when you pull it out.



RE: Scripts Recollection - jessehmusic - 12-23-2011

what is that i gonna set in lang file to make the key have another name...


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

What is the minimum script necessary to make a map work?


RE: Scripts Recollection - Elven - 01-13-2012

(01-12-2012, 05:26 PM)CorinthianMerchant Wrote: What is the minimum script necessary to make a map work?
none


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

(01-13-2012, 10:19 PM)Elven Wrote:
(01-12-2012, 05:26 PM)CorinthianMerchant Wrote: What is the minimum script necessary to make a map work?

none


Thanks!


RE: Scripts Recollection - Loveridge - 01-19-2012

I need some help... This script doesnt work.. It says its missing "'" or ";".. Im trying to make it so when you step somewhere you gasp and sanity goes. then you turn round and there is bodies.. Please Help


////////////////////////////
// Run when entering map
void OnStart()

void Collide "ScriptArea_1"(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("scare_wall_stomp", "Player", 0, false);
GiveSanityDamage(50, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}




RE: Scripts Recollection - Khyrpa - 01-19-2012

////////////////////////////
// Run when entering map
void OnStart()
{
}
void Collide "ScriptArea_1"(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("scare_wall_stomp", "Player", 0, false);
GiveSanityDamage(50, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}




always brackets after void's. This wont still work because you have anything that sets the void Collide to motion. thers lots of wrong, try to go through some tutorials



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

I'll just nudge you in the right direction : )


Quote:////////////////////////////
// Run when entering map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Gasp", true, 1);
}

void Gasp(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("scare_wall_stomp", "Player", 0, false);
GiveSanityDamage(50, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



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

Help, please! How do I script this; you walk through a script area without anything happening, but when you enter it with a certain key, a monster will spawn.

=====================================================================================

Lamps will extinguish when you pick up a key.

=====================================================================================

When using objects A and B on object C lamps will go out and you die like in the portal ending and you will be transported into a dark tunnel similar to the original one but with a billboard instead of the original light.

===================================================================================

When putting entity D inside script area 1 and using object E on object C a sound will play and particles will be deactivated and a lever will appear.