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
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#11
RE: Hollow needle

(12-07-2012, 03:33 AM)TheGreatCthulhu Wrote: Are you sure about the names? You can use the Print() or the AddDebugMessage() function to check if the script is loaded at all (just call it from OnEnter()). For the first one, you'll have to check the log file, so make it print something distinctive, like:
Print("---------------------------- OnEnter() function -------------------------------");

AddDebugMessage() func should display something on the screen if the script get's called, and debug messages are enabled.

If any of these is shown, then the script is executed, but there's some other subtle problem.
Also, if are you loading a saved game? This can sometimes cause strange behavior when the map is sitll being developed - have you tried reloading the map from the debug menu?
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.

12-07-2012, 10:21 AM
Find Reply
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#12
RE: Hollow needle

Check the name of the .hps file. Or if it's hps. It happened me once that the script wasn't an .hps, it was a .hpd.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-07-2012, 10:26 AM
Find Reply
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#13
RE: Hollow needle

(12-07-2012, 10:26 AM)The chaser Wrote: Check the name of the .hps file. Or if it's hps. It happened me once that the script wasn't an .hps, it was a .hpd.
I've checked the name multiple times, I even remade the .hps file and it still wont work.

12-07-2012, 10:29 AM
Find Reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#14
RE: Hollow needle

Whats the name of the hps file?

Trying is the first step to success.
12-07-2012, 10:51 AM
Find Reply
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#15
RE: Hollow needle

(12-07-2012, 10:51 AM)beecake Wrote: Whats the name of the hps file?
the files are dungeon.map and dungeon.hps

12-07-2012, 12:23 PM
Find Reply
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 Reply
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#17
RE: Hollow needle

How could I miss that? Is void OnStart(), not void Onstart(). This thread is just a big LOL.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 12-07-2012, 03:40 PM by The chaser.)
12-07-2012, 03:38 PM
Find Reply
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#18
RE: Hollow needle

(12-07-2012, 03:38 PM)The chaser Wrote: How could I miss that? Is void OnStart(), not void Onstart(). This thread is just a big LOL.
Oh wow Dodgy a bit embarrassing that I missed that after checking it like loads of times -.- Well I'm gonna fix that mistake lol and hope it works, it should work Tongue ty for the help

12-08-2012, 01:57 AM
Find Reply




Users browsing this thread: 1 Guest(s)