Frictional Games Forum (read-only)

Full Version: Script and Quest help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,if you don't know i'm making a map (The Darkness,coming very very soon) and i need some help on some scripts and quest...

First,the scripts :
-I don't know how to made a script that blow all the selected torches,play wind effect & sound,close a door at the same time and make lantern oil-less/inactive...if someone could help

And the quest/Memento :
-I want to add memento but i can't,i checked the .lang of the game and found it was :
Code:
<Entry Name="Quest_NAMEOFMEMENTO_Text>DESCRIPTION OF MEMENTO</Entry>
I did this in my custom .lang file and it crashes when selecting the custom story...i don't know what to do T_T
And if i'm right the code for addquest is :
Code:
AddQuest ("NAMEOFMEMENTO";"NAMEOFMEMENTO");

Please help me :/
Code:
//Use AddEntityCollideCallBack() in OnStart() to call this when player enters area
void NameOfArea(string &in asParent, string &in asChild, int alState)
{   //Plays the wind sound in the area
    PlaySoundAtEntity("windwhirl", "general_wind_whirl.snt", "NameOfArea", 0.0f, false);
     //Creates the wind effect in the area
    CreateParticleSystemAtEntity("pswhirl", "ps_dust_whirl.ps", "NameOfArea", false);
    
    SetSwingDoorClosed("name_of_door", true, true); //Closes the door
    
    for(int i = first_torch_number; i <= last_torch_number; i++)
        SetLampLit("name_of_torches_" + i, false, true); //Blows out the torches
        
    SetLanternActive(false, false); //Deactivates the lantern
}

This example is very simple and you should add timers and reaction sounds to make it more realistic.

Also, you're using a semicolon instead of a comma in your AddQuest call (which would generate the error), unless you just got it wrong here.
FORGOT THIS (LOOK THE EDIT) Thank you for this script and for answering but there is a little problem,i've done everything but still get an error :
Code:
FATAL ERROR: Could not load script file
"custom_stories/TheDarkness/maps/ch00/ch00.hps'!
main (27,1) : ERR : Expected ';'

Look like there is a place where a ';' is missing but where Confused

Edit : Oh it's repaired,i accidently messed up with a script,i'm testing

Edit 2 : The script don't start :/

Edit 3: For the Quest,i don't have to add AddQuest in the .hps to make it crash
Just write the memento dialog in .lang file make it crash...

Edit 4 : Corrected,work perfectly well,thank you,now if i find how to make memento the map will be out tomorrow i think
I'm looking at your last post and I'm not sure what your problem is, are you still having trouble making a memento entry?


*edit*

Well I decided to look at implementing mementos anyway, here's what I did to get one working:

added the following code to my .hps file to add the memento when the map loads:
Code:
void OnStart()
{
    AddQuest("test","test");
}

In my custom stories' folder I created a file called extra_english.lang containing the following:

Code:
<LANGUAGE>
    <CATEGORY Name="Journal">
            <Entry Name="Quest_test_Text">This is a test entry.</Entry>
    </CATEGORY>
</LANGUAGE>

Hope this helps.
It now work,i don't know why,maybe because i put test with a "t" and before i put it with a "T" but it now work and the map will be released tomorrow !
Someone can lock this subject,all my problems are resolved
All i have to do now is make a screen.png for the description
Does anyone know the dimensions ?
Edit : Fixed ! I'm ready for release