Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Key
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#11
RE: Key

(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?

Tutorials: From Noob to Pro
(This post was last modified: 02-01-2012, 07:40 PM by Your Computer.)
02-01-2012, 07:39 PM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#12
RE: Key

(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()
{

}
02-01-2012, 08:34 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#13
RE: Key

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

02-01-2012, 08:37 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#14
RE: Key

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

Ninja'd.

Tutorials: From Noob to Pro
(This post was last modified: 02-01-2012, 08:38 PM by Your Computer.)
02-01-2012, 08:38 PM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#15
RE: Key

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
(This post was last modified: 02-01-2012, 09:14 PM by Saren.)
02-01-2012, 09:05 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#16
RE: Key

(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.

Tutorials: From Noob to Pro
02-01-2012, 09:37 PM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#17
RE: Key

(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
(This post was last modified: 02-01-2012, 10:07 PM by Saren.)
02-01-2012, 09:43 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#18
RE: Key

(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: (Select All)
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_door"asEntity0false);
    
RemoveItem(asItem);


Tutorials: From Noob to Pro
02-01-2012, 10:14 PM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#19
RE: Key

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?
(This post was last modified: 02-02-2012, 12:06 PM by Saren.)
02-01-2012, 10:45 PM
Find




Users browsing this thread: 1 Guest(s)