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
Help with Amnesia Level Editor
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#21
RE: Help with Amnesia Level Editor

Someone please, can tell me how can I make this?
04-27-2013, 05:01 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#22
RE: Help with Amnesia Level Editor

Like a bookcase?

I *think* this would be the function to use.

PHP Code: (Select All)
void SetMoveObjectState(stringasNamefloat afState); 

asName is the name of your moving bookcase and afState is open and closed. (1 and 0, respectively)

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
04-27-2013, 07:13 PM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#23
RE: Help with Amnesia Level Editor

Yeah, remember the room where Daniel gets the first note for himself? There's a lever that activates an event moving the bookcase. Anyways, I'm going to test this one and I shall come back and post if it either worked or not. Thanks.
(This post was last modified: 04-27-2013, 10:13 PM by Natsu.)
04-27-2013, 09:06 PM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#24
RE: Help with Amnesia Level Editor

Ok, your brings another one question. I must supose that Collide and Activate isn't the same. What I mean is that I want to activate an action after pulling a lever, or just after trying to open a locked door. How do I do this?

On the door case, something like when I try to open it, it shows a message or adds something to the log.
04-27-2013, 10:14 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#25
RE: Help with Amnesia Level Editor

Collide is when, well, two entities collide. =p "Activate" is a loose term.

I think what you mean is "callback."

When a lever is pulled (a "state change"), it will call(back) whichever function you specified, thus executing your script. You can set a callback for collides, interactions, on pickup etc etc, as well. The basic formula will apply.

Anyway, use this to call a function when you pull a lever:

PHP Code: (Select All)
void SetEntityConnectionStateChangeCallback(stringasNamestringasCallback);

//Callback syntax is:

void Func(string &in asEntityint alState

//State can either be 1, 0, or -1
//I'm not quite sure this works with doors 

To answer your second question, use this for interactions with doors:

PHP Code: (Select All)
void SetEntityPlayerInteractCallback(stringasNamestringasCallbackbool abRemoveOnInteraction);

//Callback syntax

void MyFunc(string &in asEntity

Now, you want something to happen if the player interacts with a locked door, correct?

Do something like this:

PHP Code: (Select All)
void CallbackForPlayerInteract(string &in asEntity)
{
     if(
GetSwingDoorLocked("doorname"))
      {
         
//Do something if locked
      
}
    
      else
      {
         
//Do something if unlocked, or omit this if you don't want anything to happen
      
}



Play around with it a bit. =p If you need any more help, lemme know.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
04-27-2013, 11:02 PM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#26
RE: Help with Amnesia Level Editor

Well yeah, I have another question. How do I make appear a text below kinda like a sign? Because to do that I have to go to Extra_English but I want to make it appear once it activates a determinated command, like when when it tries to open the door.

In other words, can I activate something to trigger the sign? If so how can I do it?
04-27-2013, 11:44 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#27
RE: Help with Amnesia Level Editor

You can display a text message with this:

PHP Code: (Select All)
void SetMessage(stringasTextCategorystringasTextEntryfloat afTime); 

That's the category in your .lang file, the name of the entry, and the time on screen.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
04-28-2013, 12:04 AM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#28
RE: Help with Amnesia Level Editor

Sorry if I'm bothering you with this, I'm pretty much new to scripts so there are things that I don't comprehend like the ones on the link you posted.

I want to see if I understanded well, AsTextCategory would be the Sign category right? Like, when the Player interacts with the door a sign shows up saying "The Door is Locked, there must be a way to open it.". Am I right? aftime is are the seconds that the message is displayed on the screen right? What's asTextEntry? I suppose it's not the name of the door as on the script I already clarified that the message displays if the player interacts with it, repeating would be futile right?

Nevermind, I managed to make the door show the message.
(This post was last modified: 04-28-2013, 07:32 PM by Natsu.)
04-28-2013, 06:46 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#29
RE: Help with Amnesia Level Editor

Don't worry about it. =p

To answer your question, a sign and a message are different. A sign is displayed when you look over an "examine" area (like in the elevator machine room), whereas message appears on screen.

Do you know how to set up a .lang file? If not, then check out this tutorial. (It's a bit down the page)

asTextCategory is the name "category" in which the text for your message can be found. It doesn't have to be anything in particular, it's more of an organizational thing. You could name it "bananas" or "messages" if you want. Now, asTextEntry is the name of the message that will display on screen. By that I mean entry name, not the actual text. Kinda confusing.

Imagine this hierarchy.

----.lang file
---Category (Messages)
--Entry (DoorLocked)
-Entry Text ("The door is locked!")

Thus, you would set up the function as such:

PHP Code: (Select All)
SetMessage("Messages","DoorLocked",NumberHere); //The last argument is the amount of time its displayed on screen 


Anyway, look at that guide and it should make sense
04-28-2013, 07:34 PM
Find
Natsu Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2013
Reputation: 0
#30
RE: Help with Amnesia Level Editor

I already solved that, you can see the message up there.

Glad to hear that though.

Now I have a new problem, I want to move an Entity when I pull a lever, but I it doesn't move once I pull it. I know it activated because I set to play a music when I pull it and it played.

I can also move the Entity by myself with Daniel's hands. I leave the code below, please someone help me.
PHP Code: (Select All)
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever""func_open");
}
void func_open(string &in asEntityint alState)
{
     if (
alState == 1)
     {
        
PlaySoundAtEntity("""01_door.snt""Player"0.1ftrue);
        
PlayMusic ("01_puzzle_passage.ogg"false121true);
        
SetMoveObjectState("woodenwall1",1.0f);
     }

(This post was last modified: 04-28-2013, 08:48 PM by Natsu.)
04-28-2013, 08:14 PM
Find




Users browsing this thread: 4 Guest(s)