Frictional Games Forum (read-only)
Anyone need help? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Anyone need help? (/thread-7825.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


RE: Anyone need help? - nemesis567 - 05-15-2011

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.


RE: Anyone need help? - nemesis567 - 05-15-2011

(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?


RE: Anyone need help? - Modular100 - 05-15-2011

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


RE: Anyone need help? - nemesis567 - 05-15-2011

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

Code:
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'
Code:
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.


RE: Anyone need help? - Dominic0904 - 05-15-2011

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.


RE: Anyone need help? - nemesis567 - 05-15-2011

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:

Code:
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


RE: Anyone need help? - Kyle - 05-15-2011

Here is a simpler answer. Smile

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



RE: Anyone need help? - MrBigzy - 05-15-2011

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:


RE: Anyone need help? - nemesis567 - 05-15-2011

(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

Code:
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?


RE: Anyone need help? - Dominic0904 - 05-15-2011

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.

Code:
((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.