The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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 a funtion with the same name and parameter already exists
chweaw Offline
Junior Member

Posts: 4
Threads: 1
Joined: Apr 2012
Reputation: 0
#1
a funtion with the same name and parameter already exists

Ok hi! I know you hear this a lot but I am new to the whole making of customstories and Im not good with scripting. I tried to read some about it but i get dizzy and get headaches so I figured you guys might help me and teach me a thing about this problem of mine.
So what I have done is that I have created an area that closes a door behind me on collision and what I wanted to do next was to make a sound play as i enter the new room.

Script as it looks like so far:


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
}


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

void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "DoorCloseFunc1" , true , 1);
}
void DoorCloseFunc1(string &in asParent , string &in asChild , int alState)
{
SetSwingDoorClosed("door_1", true, true);
}

void OnStart()
{
PreloadSound("00_laugh.snt");
AddEntityCollideCallback("Player", "ScriptArea_1", "Sound", true, 1);
}


void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("sound", "00_laugh.snt", "ScriptArea_1", 0.0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}
I get the error 21,1 : a funtion with the same name and parameter already exists


So what should I do? I want to learn more.
04-24-2012, 11:19 PM
Find


Messages In This Thread
a funtion with the same name and parameter already exists - by chweaw - 04-24-2012, 11:19 PM



Users browsing this thread: 1 Guest(s)