Frictional Games Forum (read-only)
[SCRIPT] Key - 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 Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Key (/thread-13020.html)

Pages: 1 2


RE: Key - Your Computer - 02-01-2012

(02-01-2012, 07:36 PM)Saren Wrote: Right....

"Still nothing" implies you're getting the same error. Putting quotes around what otherwise would have been a variable name (which hasn't been declared) makes it a string. Therefore does away with the error message. If it still gives you the same error message, then you forgot to save the changes or didn't place quotes (properly).

Quote:Great... now it said something about a ; .... Maybe missing, 1 too much.. I dunno...

What's your new code?


RE: Key - Saren - 02-01-2012

(02-01-2012, 07:39 PM)Your Computer Wrote: What's your new code?
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("masterbedroomdoor", false, true);
UsedPlaySoundAtEntity("", "unlock_door", "masterbedroomdoor", 0, false);
"RemoveItem"(Masterbedroomkey);
}

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

}



RE: Key - SilentStriker - 02-01-2012

You have done it wrong. it should look like this RemoveItem("Masterbedroomkey");


RE: Key - Your Computer - 02-01-2012

I think you need to look at post #6 again.

Ninja'd.


RE: Key - Saren - 02-01-2012

Lol omg..... xD

Yaaaay another problem =D
No matching signatures to 'UsedPlaySoundAtEntity(String@&, string@&, const unit, const bool)2
Whatever the hell that means... lol



RE: Key - Your Computer - 02-01-2012

(02-01-2012, 09:05 PM)Saren Wrote: Yaaaay another problem =D
No matching signatures to 'UsedPlaySoundAtEntity(String@&, string@&, const unit, const bool)2
Whatever the hell that means... lol

It means the function doesn't exist, which it doesn't. The actual function is PlaySoundAtEntity.


RE: Key - Saren - 02-01-2012

(02-01-2012, 09:37 PM)Your Computer Wrote:
(02-01-2012, 09:05 PM)Saren Wrote: Yaaaay another problem =D
No matching signatures to 'UsedPlaySoundAtEntity(String@&, string@&, const unit, const bool)2
Whatever the hell that means... lol

It means the function doesn't exist, which it doesn't. The actual function is PlaySoundAtEntity.
Yea, I was thinking about removing that... but I was'nt sure.. thx dude


My story works now... but my key dose'nt



RE: Key - Your Computer - 02-01-2012

(02-01-2012, 09:43 PM)Saren Wrote: My story works now... but my key dose'nt

Replace your KeyOnDoor function with this:

PHP Code:
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_door"asEntity0false);
    
RemoveItem(asItem);




RE: Key - Saren - 02-01-2012

I think it worked but.... my key dose'nt have a name.... it just says Picked Up..... might have failed at something in the extra_english file as well.. lol, would'nt surprise me
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">escription">You are Dr. Alexandrov. A very famous rich Russian doctor who is trying to make war easier for the Russian army.</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_note1_Name">Experiment Report</Entry>
<Entry Name="Note_note1_Text">The experiments are going well dr. We've almost completed the first attempt of a mindless soldier but we still have to find a way to make it follow your orders.
<Entry Name="Note_note2_Name">Failure!</Entry>
<Entry Name="Note_note2_Text">Dr! The experiment has gone wrong! It's lose, don't have much time... I can hear it's footsteps outside the door, don't think it knows I'm here... Yet. I've putted the key to the cellar in the drawers. Hurry dr.
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemName_Masterbedroomkey">Master bedroom key</Entry>
<Entry Name="ItemDesc_Masterbedroomkey">The key to my bedroom door.</Entry>
<Entry Name="ItemName_Cellarkey">Cellar key</Entry>
<Entry Name="ItemDesc_Cellarkey">This key will open the door to my cellar</Entry>
<Entry Name="ItemName_Prisonkey">Prison key</Entry>
<Entry Name="ItemDesc_Prisonkey">The key to the prison section in my mansion</Entry>
</CATEGORY>

<CATEGORY Name="Map1">
<Entry Name="Masterbedroomdoor">Locked. I need to find the key.</Entry>
<Entry Name="InteractDoorHaveKey">Use the key on the door to unlock it.</Entry>
</CATEGORY>

</LANGUAGE>

Anyone?