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 - Frontcannon - 10-25-2010

Code:
void OnStart()
{
    AddUseItemCallback("", "R01_Key1", "mansion_1", "KeyOnDoor", true);
    AddUseItemCallback("", "R01_Key2", "mansion_2", "KeyOnDoor2", true);
}

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

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



RE: Scripts Recollection - Everlone - 10-25-2010

great I was so close to it Smile big thx to you Smile


RE: Scripts Recollection - zlandael - 10-27-2010

Good job guys!


RE: Scripts Recollection - mastersmith98 - 10-27-2010

Maybe we should create a page on the wiki with all of these examples? It would be a place for someone to post script examples that aren't quite tutorials.

EDIT: wow sorry about that, I'm totally out of it. I didn't realize I already said this a few posts ago, my bad.


RE: Scripts Recollection - anzki - 10-27-2010

Add message:
1.Make category to language file with any name you want to! Let's say category named:"Example". (To easily add this use HPLangtool found in the same folder as the level editor.)
2.Inside the category ("Example", or anything you have put it's name.) create entry with any name you want. Example; "Entry1".
3.Use this script where you want the message to be showed:
Code:
SetMessage(string &asTextCategory, string &asTextEntry, float afTime);
-string &asTextCategory and string &asTextEntry will be the name of a category and entry.
-float afTime will be the time the message is on screen in form; 1.0f(=1 second.)

Example using category "Example" and entry "Entry1", showing the entry for 20 seconds:
Code:
SetMessage("Example", "Entry1", 20.0f);



RE: Scripts Recollection - Arvaga - 11-11-2010

BUMP.

I added how to make a lever functional.

C'mon don't let this thread die =P.


RE: Scripts Recollection - Frontcannon - 11-11-2010

I've been map-building for the past weeks, but now the scripting start's again!

I think you'll have plenty material soon enough Big Grin


RE: Scripts Recollection - Equil - 01-03-2011

Could someone post a script on how to make a basic puzzle? For example I'd like to know how to write that puzzle in the storage map where you need to clear the rubble with the explosive . I tried looking at the dev scripts but they make no sense to me Undecided


RE: Scripts Recollection - Frontcannon - 01-03-2011

The explosive puzzle is far from being 'basic'. If you don't understand anything what you're reading, it's just going to be frustrating to try scripting your own. It involves CombineItemCallbacks in a special Inventory.hps which so far nobody here seems to understand, lots of custom particle effects and animations to make it look real etc etc...

The most basic puzzle would be a locked door and a key item, try to look and that and built from its code.


RE: Scripts Recollection - Equil - 01-03-2011

Quote:The explosive puzzle is far from being 'basic'. If you don't understand anything what you're reading, it's just going to be frustrating to try scripting your own. It involves CombineItemCallbacks in a special Inventory.hps which so far nobody here seems to understand, lots of custom particle effects and animations to make it look real etc etc...

The most basic puzzle would be a locked door and a key item, try to look and that and built from its code.


I already have working locked doors in my map with key items, I just want to add some more advanced puzzles to my map so it's not so bland as "Find key, next area, find another key, escape". Any ideas?