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
Simple Scripting Problem
physcostealth Offline
Junior Member

Posts: 25
Threads: 12
Joined: Mar 2014
Reputation: 0
#1
Simple Scripting Problem

I'm having a little problem with scripting right now. Yesterday I was able to make the player walk into an area and have music play. Now, I want the player to walk into the same area and in doing so forces him to look at a door nearby. I've been scripting for a while today and I think everything is correct, but when I load the custom story it crashes. It did this to me yesterday when I tried loading the music area script, but all I did to fix it was delete the cache file of the map the script was tied to. Here's the code:

void OnStart()
    {
        AddEntityCollideCallback("Player", "SoundArea", "triggermusic", true, 1);
        AddEntityCollideCallback("Player", "SoundArea", "triggerlook", true, 1);
    }

void triggermusic(string &in asParent, string &in asChild, int alState)

    {
        PlayMusic("ThePatronusLight.ogg", true, 1.0, 0, 1, false);
    }
    
void triggerlook(string&in asTimer)    
    
    {
        StartPlayerLookAt("mansion_door", 1.0f, 1.0f, "");
        AddTimer("TimeDoor", 3.0f, "stoptimer");
    }
    
void stoptimer(string&is asTimer);
    {
        StopPlayerLookAt();
        SetPlayerActive(true);
    }

Any help will be appreciated. Thanks!
P.S All the names match with their counterparts in the level editor.
03-13-2014, 12:12 AM
Find


Messages In This Thread
Simple Scripting Problem - by physcostealth - 03-13-2014, 12:12 AM
RE: Simple Scripting Problem - by Mudbill - 03-13-2014, 12:47 AM
RE: Simple Scripting Problem - by Daemian - 03-13-2014, 12:53 AM
RE: Simple Scripting Problem - by physcostealth - 03-13-2014, 01:05 AM
RE: Simple Scripting Problem - by Mudbill - 03-13-2014, 05:19 PM
RE: Simple Scripting Problem - by DnALANGE - 03-14-2014, 02:03 AM



Users browsing this thread: 1 Guest(s)