Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 4 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone need help?
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
RE: Anyone need help?

The problem is that I did that and it didn't worked, but maybe the problem is in here:

AddEntityCollideCallback("StoneInteracteable_10", "ScriptArea_1", "ScriptArea_1_Func", true, 1);//Where StoneInteracteable_10, Is a rock and scriptarea is an area in which the rock should collide to break the rope.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
05-15-2011, 01:19 AM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
RE: Anyone need help?

(05-15-2011, 01:19 AM)nemesis567 Wrote: The problem is that I did that and it didn't worked, but maybe the problem is in here:

AddEntityCollideCallback("StoneInteracteable_10", "ScriptArea_1", "ScriptArea_1_Func", true, 1);//Where StoneInteracteable_10, Is a rock and scriptarea is an area in which the rock should collide to break the rope.

No one knows how to make this. I've checked the original scripts but I don't think this happens in there. Is at least someway of disconnecting the prop attached to the end of the rope from the rest o the rope?

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
05-15-2011, 12:55 PM
Find
Modular100 Offline
Junior Member

Posts: 35
Threads: 5
Joined: Apr 2011
Reputation: 0
RE: Anyone need help?

I need some help with teleporting a player to a different location upon colliding with an area, I've played through the game about 5 times, so I know where everything happens, and I've tracked down some code (lol detective I am) to the first area of the cellar archives, just before you get to know little lurky, and when you collide with an area, you get teleported to another area in the map. I have VERY little experience with scripting, I understand coordinates and I can read the script with difficulty, but I have no idea how to set it all up myself. Just to sum it up: I need help with teleporting the player within a map, preferably without following disasters Wink

05-15-2011, 01:18 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
RE: Anyone need help?

Ok, I'll help you. First of all you create the area in the level editor and name it, for instance let's say you named it "MrLurkyArea".
Now, to he scripting.

First you go on the callback OnStart

void OnStart()
{
    AddEntityCollideCallback("Player", "MrLurkyArea", "AreaCallback", true, 1);//You add this function. This function activates the callback "AreaCallback" whenever the both the entities stated(in this case "Player"(It is the actual player) and "MrLurkyArea", your area, collide). If you want the callback to happen everytime the player touches the area, change the parameter 'true' to false.
}

Ok, now you will create an area in the editor with the type, PlayerSpawn, and name it SpawnAfterTeleport.
Now the actual callback 'AreaCallback'
void AreaCallback(string &in asParent, string &in asChild, int alState)//This is the syntax of the callback, you can't change it since it is stated by the game.
{
    TeleportPlayer("SpawnAfterTeleport");//This will place the player in the SpawnAfterTeleport PlayerSpawn area.
}

Hope it helps.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
05-15-2011, 03:28 PM
Find
Dominic0904 Offline
Member

Posts: 63
Threads: 14
Joined: Apr 2011
Reputation: 0
RE: Anyone need help?

quick question, is there a way I can trigger a function when the player lights a certain lamp? Like I want enemies to appear once the player lights a lamp but I am not sure how to go about it.
05-15-2011, 03:45 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
RE: Anyone need help?

Go to the editor, click the lamp and in the Entity Tab add something to the CallbackFunc. Let's suppose for instance that you wrote there "OnLitMyLight"

Now, you go on the script and do the following:

void OnLitMyLight(string &in entity, string &in type)//This callback will be called whenever you Ignite/Break or Pickup the lamp.
{
    if(type == "OnIgnite")//This will check if the interaction the player used was to ignite the lamp. Note: I'm not sure if this script requires a determined function to compare strings!! So this might not work. Correct me if I am wrong.
    {
        //Place here whatever you want, in this case activate the monster entities and whatsoever
    }
}
I hope I've helped.

PS: I've never used these functions before, so it may not work :S

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
(This post was last modified: 05-15-2011, 04:17 PM by nemesis567.)
05-15-2011, 04:12 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
RE: Anyone need help?

Here is a simpler answer. Smile

void OnStart()
{
     SetEntityPlayerInteractCallback("LampName", "Func01", true);
}
void Func01(string &in asEntity)
{
     SetEntityActive("MonsterName", true);
}

(This post was last modified: 05-15-2011, 04:28 PM by Kyle.)
05-15-2011, 04:28 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
RE: Anyone need help?

SetEntityActive won't work on rope areas. There is a way to do it, but I guess we won't know until Justine is released without encryption. D:
05-15-2011, 04:34 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
RE: Anyone need help?

(05-15-2011, 04:34 PM)MrBigzy Wrote: SetEntityActive won't work on rope areas. There is a way to do it, but I guess we won't know until Justine is released without encryption. D:

What a crap. I'll have to find out by myself.
With the support they give to personal developers, I don't understand how can new scripters make a custom story. They are really missing some helping threads and some tutorials on the wiki.
(05-15-2011, 04:28 PM)Kyle Wrote: Here is a simpler answer. Smile

void OnStart()
{
     SetEntityPlayerInteractCallback("LampName", "Func01", true);
}
void Func01(string &in asEntity)
{
     SetEntityActive("MonsterName", true);
}

What if the lamp has physics attached? When the player picks it up it will also activate the monster. At least I think so, I've only started modding for amnesia yesterday Tongue
Is Justine Available for NOn Steam games?

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
(This post was last modified: 05-15-2011, 05:19 PM by nemesis567.)
05-15-2011, 05:12 PM
Find
Dominic0904 Offline
Member

Posts: 63
Threads: 14
Joined: Apr 2011
Reputation: 0
RE: Anyone need help?

Thanks for the help with the Lamp thing...now, I got a timer problem. I want to add a timer in so the screen fades to black, this is the code so far.

((this is put here so you know where the timer came from))
AddTimer("FadeToBlackTimer", 5, "FadeToBlack_01");

((this is the part I mean))
void FadeToBlack_01(float string &in asTimer)
{
    if (asTimer == "FadeToBlackTimer")
    {
    FadeOut("", 4);
    return;
    }
}

It keeps giving me an error saying "Expected ')' or ',' "
it says that it expects it right before "&in".

I think I know it's something to do with the whole "(float string &in asTimer)" part. Since I still don't really understand what I need to put in here.
05-15-2011, 05:45 PM
Find




Users browsing this thread: 15 Guest(s)