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
Hollow needle
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#16
RE: Hollow needle

(12-07-2012, 10:21 AM)Storfigge Wrote: I'm not sure i quite understand what you mean with the debug thing :S. But I have quick reloaded the map and i have never loaded a saved file on this CS. I have about 6 other maps in this CS that works perfectly fine. I'm not sure if this matter but the map was made on another PC. Maybe it's protected or something... It loads everything i write in the .lang file but not the .hps file.

It shouldn't matter; heck, the whole Amnesia game itself was made on another PC.
The AddDebugMessage() function displays custom info messages in the lower left part of the screen, so you can use it to check if the script is getting loaded and also to check what is going on during execution.
Just make sure that the option "Show debug messages" is checked in the Debug menu (F1).

Then you can try something like this:
void OnStart()
{
    AddDebugMessage("INSIDE OnStart()", false);
    AddUseItemCallback("", "hneedle", "pdoor", "UsedNeedleOnPdoor", true);
}


void UsedNeedleOnPdoor(string &in asItem, string &in asEntity)
{
    AddDebugMessage("INSIDE UsedNeedleOnPdoor()", false);

    SetSwingDoorLocked("pdoor", false, true);
    PlaySoundAtEntity("", "unlock_door", "pdoor", 0, false);
    RemoveItem("hneedle");
}


void OnEnter()
{
    AddDebugMessage("INSIDE OnEnter()", false);
}


void OnLeave()
{
}


If the script was loaded, the output should show:
INSIDE OnStart()
INSIDE OnEnter()

And then when you interact with the needle:
INSIDE UsedNeedleOnPdoor()

That said, I just noticed something. In your original post, it says:
void Onstart()

Is this a forum typo, or is this how it is in the actual script file? If so, then it's an error, since the script language is case-sensitive. It has to be:
void OnStart()

Otherwise, the function never get's called, and the callback is never assigned.
12-07-2012, 03:25 PM
Find


Messages In This Thread
Hollow needle - by Storfigge - 12-06-2012, 01:53 PM
RE: Hollow needle - by The chaser - 12-06-2012, 03:10 PM
RE: Hollow needle - by FlawlessHappiness - 12-06-2012, 03:39 PM
RE: Hollow needle - by Storfigge - 12-06-2012, 11:17 PM
RE: Hollow needle - by The chaser - 12-07-2012, 12:05 AM
RE: Hollow needle - by Storfigge - 12-07-2012, 01:44 AM
RE: Hollow needle - by 6346021815 - 12-06-2012, 04:21 PM
RE: Hollow needle - by Saitoshiba - 12-06-2012, 11:12 PM
RE: Hollow needle - by The chaser - 12-06-2012, 11:16 PM
RE: Hollow needle - by TheGreatCthulhu - 12-07-2012, 03:33 AM
RE: Hollow needle - by Storfigge - 12-07-2012, 10:21 AM
RE: Hollow needle - by TheGreatCthulhu - 12-07-2012, 03:25 PM
RE: Hollow needle - by The chaser - 12-07-2012, 10:26 AM
RE: Hollow needle - by Storfigge - 12-07-2012, 10:29 AM
RE: Hollow needle - by FlawlessHappiness - 12-07-2012, 10:51 AM
RE: Hollow needle - by Storfigge - 12-07-2012, 12:23 PM
RE: Hollow needle - by The chaser - 12-07-2012, 03:38 PM
RE: Hollow needle - by Storfigge - 12-08-2012, 01:57 AM



Users browsing this thread: 1 Guest(s)