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 Parentheses issue
Grimm101 Offline
Junior Member

Posts: 12
Threads: 3
Joined: Dec 2011
Reputation: 0
#1
Parentheses issue

Hey guys,

EDIT: Updated the script and managed to remove the error for line 20 but my current error is it points to the bracket below void doorclosebang

I've got an issue when I start my level, I want to make a door slam when I walk into a specific area and play a sound when it happens. I am getting an error on line 20 and line 25. Which are both curly brackets. I'm not sure what this means. This is my code below. The 20th line can be seen below //Triggers

PS: I'm new to PHP/C++ and I think this a good starting point. I'm good with VB and Ok ish with C#. So far i've found this the easiest code to understand and read fluently but this kind of issue I am unsure of. I'm sure it is something simple and silly. =)

Thanks


PHP Code: (Select All)
////////////////////////////////
// Run when starting the map
void OnStart()

////////////////////////////////
// Entities
{
    
AddUseItemCallback("""Bedroom_Key""Bedroom_Key_Door""UsedKeyOnDoor"true); //Assigns the key to the door and sets the action of this as UsedKeyOnDoor
    
AddEntityCollideCallback("Player""DoorCloseArea1""DoorCloseBang"true1); // Declaring when a player walks into an area called "Name" Deletes the possibility of it happening again so it can only happen once: Number = 1 for player enters. -1 for when player leaves. 0 for both
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity//Declaring the Key as a string 
{
        
SetSwingDoorLocked("Bedroom_Key_Door"falsetrue); //Sets what door the key works on and it can only be used once
            
PlaySoundAtEntity("""unlock_door""Bedroom_Key_Door"0false); //Plays sound when the key is used on the door
            
RemoveItem("Bedroom_Key"); //Removes the key after it has been used
}

////////////////////////////////
// Triggers

void DoorCloseBang(string &in asParentstring &in asChildint alState); 
{
    
SetSwingDoorClosed("Bedroom_Key_Door"truetrue); //Closes a swing door: Effects indicate true to see the door close
    
PlaySoundAtEntity("""bang""DoorCloseBang"0false); //Create banging on the door sound when the door shuts
}

////////////////////////////////
// Run when entering the map
void OnEnter()
{

}

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


(This post was last modified: 12-22-2011, 11:54 PM by Grimm101.)
12-22-2011, 10:56 PM
Find


Messages In This Thread
Parentheses issue - by Grimm101 - 12-22-2011, 10:56 PM
RE: Parentheses issue - by Your Computer - 12-22-2011, 11:45 PM
RE: Parentheses issue - by Grimm101 - 12-22-2011, 11:55 PM
RE: Parentheses issue - by Your Computer - 12-23-2011, 12:14 AM
RE: Parentheses issue - by Apjjm - 12-23-2011, 12:15 AM
RE: Parentheses issue - by Grimm101 - 12-23-2011, 12:21 AM
RE: Parentheses issue - by Your Computer - 12-23-2011, 12:57 AM
RE: Parentheses issue - by Grimm101 - 12-23-2011, 01:00 AM
RE: Parentheses issue - by Your Computer - 12-23-2011, 01:06 AM
RE: Parentheses issue - by Grimm101 - 12-23-2011, 01:08 AM
RE: Parentheses issue - by DRedshot - 12-23-2011, 01:18 AM
RE: Parentheses issue - by Grimm101 - 12-23-2011, 01:30 AM
RE: Parentheses issue - by Your Computer - 12-23-2011, 03:30 AM



Users browsing this thread: 1 Guest(s)