andrejapotic98
Junior Member
Posts: 4
Threads: 2
Joined: Aug 2012
Reputation:
0
|
I need help with multiple keys
I realy need help so please respond .
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 .
|
|
08-11-2012, 11:29 AM |
|
Steve
Member
Posts: 178
Threads: 17
Joined: Jun 2012
Reputation:
7
|
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 |
|
The Shanus
Member
Posts: 134
Threads: 15
Joined: Jun 2012
Reputation:
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 ^
(This post was last modified: 08-11-2012, 12:19 PM by The Shanus.)
|
|
08-11-2012, 12:18 PM |
|
andrejapotic98
Junior Member
Posts: 4
Threads: 2
Joined: Aug 2012
Reputation:
0
|
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
If you can answer me fast as you answered now thanks in advance
|
|
08-11-2012, 01:43 PM |
|
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
|
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 |
|
andrejapotic98
Junior Member
Posts: 4
Threads: 2
Joined: Aug 2012
Reputation:
0
|
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
|
|
08-11-2012, 02:27 PM |
|
|