Frictional Games Forum (read-only)

Full Version: Scripts Recollection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12
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);
}
great I was so close to it Smile big thx to you Smile
Good job guys!
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.
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);
BUMP.

I added how to make a lever functional.

C'mon don't let this thread die =P.
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
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
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.
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?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12