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
I need help with multiple keys
andrejapotic98 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Aug 2012
Reputation: 0
#1
Exclamation  I need help with multiple keys

I realy need help so please respond Smile .

I am making my custom story for a while and i already made the key for one locked door.
Now i decided to make another key for the another door.
So what i did, I copied the whole script again and just renamed key and locked door.
When i start the custom story the game crashes and shows:ERR: A function with the same name and parameters already exists.
I dont know whats the problem this is how it looks like:

void OnEnter ()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true) ;
AddUseItemCallback("", "hallwaykey", "HallWayDoor", "UsedKeyOnDoor_1", true) ;
}

void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true) ;
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false) ;
RemoveItem ("monsterdoorkey_1") ;
}


void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("HallWayDoor", false, true) ;
PlaySoundAtEntity("", "unlock_door", "HallWayDoor", 0, false) ;
RemoveItem ("hallwaykey") ;
}

I saw that you have forum and i was like oh great someone will answer me. So please if you know the solution answer Big Grin .
08-11-2012, 11:29 AM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#2
RE: I need help with multiple keys

you forgto to make the second: void UsedKeyOnDoor_1
you ave three void UsedKeyOnDoor

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
08-11-2012, 12:06 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#3
RE: I need help with multiple keys

(08-11-2012, 11:29 AM)andrejapotic98 Wrote: void OnEnter ()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true) ;
AddUseItemCallback("", "hallwaykey", "HallWayDoor", "UsedKeyOnDoor_1", true) ;
}

void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true) ;
PlaySoundAtEntity("", asEntity, "monsterdoor", 0, false) ;
PlaySoundAtEntity("", asEntity, "HallWayDoor", 0, false) ;
RemoveItem (asItem) ;
}
Try that ^

[Image: theshanusyoutube.jpg]
(This post was last modified: 08-11-2012, 12:19 PM by The Shanus.)
08-11-2012, 12:18 PM
Find
andrejapotic98 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Aug 2012
Reputation: 0
#4
RE: I need help with multiple keys

(08-11-2012, 12:18 PM)The Shanus Wrote:
(08-11-2012, 11:29 AM)andrejapotic98 Wrote: void OnEnter ()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true) ;
AddUseItemCallback("", "hallwaykey", "HallWayDoor", "UsedKeyOnDoor_1", true) ;
}

void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true) ;
PlaySoundAtEntity("", asEntity, "monsterdoor", 0, false) ;
PlaySoundAtEntity("", asEntity, "HallWayDoor", 0, false) ;
RemoveItem (asItem) ;
}
Try that ^
It wont work it still says name and parameters already in use Sad
If you can answer me fast as you answered now thanks in advance Big Grin
08-11-2012, 01:43 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#5
RE: I need help with multiple keys

Try this:


void OnStart()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true);
AddUseItemCallback("", "hallwaykey", "HallWayDoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}

Hope that helped

I rate it 3 memes.
(This post was last modified: 08-11-2012, 01:45 PM by Adny.)
08-11-2012, 01:45 PM
Find
andrejapotic98 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Aug 2012
Reputation: 0
#6
RE: I need help with multiple keys

(08-11-2012, 12:18 PM)The Shanus Wrote:
(08-11-2012, 11:29 AM)andrejapotic98 Wrote: void OnEnter ()
{
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true) ;
AddUseItemCallback("", "hallwaykey", "HallWayDoor", "UsedKeyOnDoor_1", true) ;
}

void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true) ;
PlaySoundAtEntity("", asEntity, "monsterdoor", 0, false) ;
PlaySoundAtEntity("", asEntity, "HallWayDoor", 0, false) ;
RemoveItem (asItem) ;
}
Try that ^
Srry i saw where mistake was it all works perfect now thanks guys so much Big Grin
08-11-2012, 02:27 PM
Find




Users browsing this thread: 1 Guest(s)