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 Newbie problems that are driving me crazy!
Vic7im Offline
Junior Member

Posts: 44
Threads: 9
Joined: Sep 2012
Reputation: 3
#1
Newbie problems that are driving me crazy!

Afternoon everyone \o

I've stumbled into HPL editor last week when re-playing Amnesia and decided to give it a try.
I've been lurking the wiki and this forum and always found a solution to my problems with scripts.

But now, I can't find a solution to these.

Theorically, what I'd want to do is really simple:
#1Big Grinisplay a Hint or a Message when Interacting with a closed door
#2:Make entities DISappear
#3:Add Custom sounds
#4:Sounds have no fade range aka: they keep looping at full volume even if im far far away.
#5Sadmarginal) Forceplayerlookat X variables

#1:
Spoiler below!
Assuming that my door is called "Door1" and has the PlayerInteractCallback named "Locked"

all I know is that you place this code in the hps file:


void Locked(string &in asEntity)


{ if(GetLocalVarInt("MessageSet") != 1)
{

SetMessage("Messages", "Hint1", 4.0f);
SetLocalVarInt("MessageSet", 1);
}
}

and this in the extra_english.lang file

< CATEGORY Name="Messages" >
< Entry Name=“Hint1” > A complex lock.[br]I'll have to find the right key.< /Entry >
< /CATEGORY >

I have no idea what to do. It should play just fine but it doesn't.


#2:
Spoiler below!

No clue how to do it. SetEntityActive with a false flag doesn't work

#3:

Spoiler below!
I've followed the guide for custom sounds but they simply won't work. All I've done is to create a new folder named sounds within my custom story folder, then place the .ogg files, then open up a txt editor and write


< SOUNDENTITY >
< SOUNDS >
< Main >
< Sound File="<font 9pt:normal/auto;;rgb(255, 0, 0);;inherit>laugh3.ogg</font> " />
< /Main >
< /SOUNDS >
< PROPERTIES Volume="5" MinDistance="1" MaxDistance="50" Random="0" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="false" Blockable="False" BlockVolumeMul="0.7" Priority="5" />
< /SOUNDENTITY >
I've put some spaces because for some reason the forum won't copy-paste my code correctly.
Obviously replacing the "sound.ogg" with the one I want.
Then just use the HPL editor to associate that sound with an event, but that doesn't work.

#4 and #5: No idea what to do, any help is appreciated Big Grin


Thanks in advance for the help, I really hope you'll enjoy the custom story I'm creating. Here's a screen [Image: 8xqwib.jpg]
(This post was last modified: 09-20-2012, 03:15 PM by Vic7im.)
09-20-2012, 03:11 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Newbie problems that are driving me crazy!

Number 2:
SetEntityActive("[ENTITY]", false);

use this webpage: http://wiki.frictionalgames.com/hpl2/amn..._functions

Trying is the first step to success.
09-20-2012, 04:18 PM
Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#3
RE: Newbie problems that are driving me crazy!

I like the screenie! Looks good so far. Interesting little stand for the books. Looks slightly weird though.
Anyway.
Since I'm a lazy boy, I'll only answer some.

1.

void Locked(string &in asEntity)



{ if(GetLocalVarInt("MessageSet") != 1)

{


SetMessage("Messages", "Hint1", 4.0f);

SetLocalVarInt("MessageSet", 1);

}

}

You need to write "Locked" at the "Entity" tab (right to the general tab, with the name and all that) on the door you're interacting with, so that this script is played when the door is interacted with.

2.

If, say, you want a grunt to appear, you only need to write in the desired properties.

void AnyCallback(>words here depend on the event: is it a collide, look at, interact, etc?<)
{
SetEntityActive("Grunt",true); // This will activate a grunt with the simple name of "Grunt".
}

3.

Isn't it possible to just mimic an original amnesia snt.? Your name on the code you posted seems fucked up, if that could be the cause? (<font 9pt:normal/auto;;rgb(255, 0, 0);;inherit>laugh3.ogg</font> ???)

4.

Hm, not sure... are you sure the sound abruptly stops, when you move outta the circle?

5.

StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);

Fill in yo numbers.

Though I don't get the part "X variables".

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
09-20-2012, 05:26 PM
Website Find
Vic7im Offline
Junior Member

Posts: 44
Threads: 9
Joined: Sep 2012
Reputation: 3
#4
RE: Newbie problems that are driving me crazy!

Thanks for the replies, I've got most things working by now. Except
(09-20-2012, 05:26 PM)Theforgot3n1 Wrote: Hm, not sure... are you sure the sound abruptly stops, when you move outta the circle?


The problem is that the sound simply doesn't stop. For instance, the insanity ear ring, it should stop after a while, right? At least when opening it with media player, it stops after 4-5 seconds. In-game, it doesn't. I think I'll have to copy-paste it, edit it in the snt and use it as a custom sound.


About #1, I've found what my problem is, the .lang file. Nothing works. The file has the correct name, it's in the correct folder (I took it from another custom story and edited the parts I desidred, it has to be correct)

It's in E:/Amnesia/custom_stories/Mystory/, the name is extra_english.lang


I don't know what I should do. Everything I put in there doesn't show up in game. (Yes, names are checked and are correct)


Help? :<
09-21-2012, 03:20 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#5
RE: Newbie problems that are driving me crazy!

(09-21-2012, 03:20 PM)Vic7im Wrote: I've found what my problem is, the .lang file. Nothing works. The file has the correct name, it's in the correct folder (I took it from another custom story and edited the parts I desidred, it has to be correct)

It's in E:/Amnesia/custom_stories/Mystory/, the name is extra_english.lang


I don't know what I should do. Everything I put in there doesn't show up in game. (Yes, names are checked and are correct)


Help? :<


It won't show until you properly check for quotation marks and everything. There's a tiny mistake in there. Otherwise, post the lang file as an attachment. I'll fix that.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 09-21-2012, 03:23 PM by Robby.)
09-21-2012, 03:22 PM
Website Find
Vic7im Offline
Junior Member

Posts: 44
Threads: 9
Joined: Sep 2012
Reputation: 3
#6
RE: Newbie problems that are driving me crazy!

(09-21-2012, 03:22 PM)Nemet Robert Wrote: It won't show until you properly check for quotation marks and everything. There's a tiny mistake in there. Otherwise, post the lang file as an attachment. I'll fix that.

Thanks, there was a "<zEntry> because I was typing fast Tongue

But again *sigh* Messages don't work.

Door name is Study, PlayerInteractCallback name is NoCrowbar

void OnStart()
{
SetEntityPlayerInteractCallback("NoCrowbar", "Hint1", true);
}


void Hint1 (string &in asEntity)
{
if(GetLocalVarInt("MessageSet") != 1)
{
SetMessage("Messages", "HintDoor", 4.0f);
SetLocalVarInt("MessageSet", 1);
}
}


///////////// Lang file ///////////////////

<CATEGORY NAME="Messages">
<Entry Name="HintDoor">Text here</Entry>
</CATEGORY>

The same door is opened by a Key, and that script works fine. It's this script I'm having trouble with. Any suggestions?
09-21-2012, 03:45 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#7
RE: Newbie problems that are driving me crazy!

I think the problem is here:
(09-21-2012, 03:45 PM)Vic7im Wrote: if(GetLocalVarInt("MessageSet") != 1)
Is that ! supposed to be there?

Also, the reason it may not work is because you are telling the game that IF LocalVarInt named "MessageSet" is 1, it should trigger that message.

But it looks like you want to set it to 1 after checking if the LocalVarInt is 1, which is technically not possible. That is what I get out of it. Try removing that "GetLocalVarInt" script function. If that fixes it, you're heading the right way.

Also, try "restarting" the map after each change (not quick map reload).

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 09-21-2012, 03:50 PM by Robby.)
09-21-2012, 03:50 PM
Website Find
Vic7im Offline
Junior Member

Posts: 44
Threads: 9
Joined: Sep 2012
Reputation: 3
#8
RE: Newbie problems that are driving me crazy!

(09-21-2012, 03:50 PM)Nemet Robert Wrote: I think the problem is here:
(09-21-2012, 03:45 PM)Vic7im Wrote: if(GetLocalVarInt("MessageSet") != 1)
Is that ! supposed to be there?

Also, the reason it may not work is because you are telling the game that IF LocalVarInt named "MessageSet" is 1, it should trigger that message.

But it looks like you want to set it to 1 after checking if the LocalVarInt is 1, which is technically not possible. That is what I get out of it. Try removing that "GetLocalVarInt" script function. If that fixes it, you're heading the right way.

I saw that on another script, the process is: if it isn't equal to 1, then display the message and set the value to 1 (so that if you do that again, it won't display the message because the value is set to 1) But, even if I remove that part the script won't work. I have no clue what's causing this. I'll place an "area" there with a collidecallback function, let's hope that works.
(This post was last modified: 09-21-2012, 05:46 PM by Vic7im.)
09-21-2012, 05:44 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#9
RE: Newbie problems that are driving me crazy!

This has nothing to do with the scripting, just something I reacted on. No door frame?

"What you think is irrelevant" - A character of our time

A Christmas Hunt
09-21-2012, 08:07 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#10
RE: Newbie problems that are driving me crazy!

void OnStart()
{
SetPlayerInteractCallback("door", "InteractDoor", false);

}

void InteractDoor(string &in asEntity)
{
if(GetSwingDoorLocked== true)
{
SetMessage("Category", "Message", 0);
}
else
{
//Do nothing
}
}

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
09-21-2012, 08:46 PM
Website Find




Users browsing this thread: 1 Guest(s)