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? - Ge15t - 05-13-2011

(05-13-2011, 12:35 AM)Acies Wrote: Ge15t:

Alternative 1 (not sure of this one):
Spoiler below!

OnStart()
{
SetLightVisible("PointLightActivate_1", false);
SetLightVisible("PointLightActivate_2", false);
SetLightVisible("PointLightActivate_3", false);
}

void PianoPlayCallback(string &in asParent, string &in asChild, int alState)
{

PlaySoundAtEntity("", "03_waking_up.snt", "Player", 0, false);
AddPropImpulse("piano_1", 0, 100, 0, "World");
AddPropImpulse("piano_2", 0, 100, 0, "World");
AddPropImpulse("piano_3", 0, 100, 0, "World");
SetLampLit("CandleActivate_1", true, true);
SetLampLit("CandleActivate_2", true, true);
SetLampLit("CandleActivate_3", true, true);
SetLightVisible("PointLightActivate_1", true);
SetLightVisible("PointLightActivate_2", true);
SetLightVisible("PointLightActivate_3", true);

}


Alternative 2 (Will work for sure):
Spoiler below!

void PianoPlayCallback(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "03_waking_up.snt", "Player", 0, false);
AddPropImpulse("piano_1", 0, 100, 0, "World");
AddPropImpulse("piano_2", 0, 100, 0, "World");
AddPropImpulse("piano_3", 0, 100, 0, "World");
SetLampLit("CandleActivate_1", true, true);
SetLampLit("CandleActivate_2", true, true);
SetLampLit("CandleActivate_3", true, true);
FadeLightTo("PointLightActivate_1", float afR, float afG, float afB, float afA, -1.0f, float afTime);
FadeLightTo("PointLightActivate_2", float afR, float afG, float afB, float afA, -1.0f, float afTime);
FadeLightTo("PointLightActivate_3", float afR, float afG, float afB, float afA, -1.0f, float afTime);
}

afR = red amount
afG = green amount
afB = blue amount
afA = alpha amount
afTime = time in seconds of change (I'm guessing set to 0 in your case, as the pointlights represents the candles)
the -1.0f means that the pointlights should keep their previous radius.

What you do now is go into the mapeditor - have all lights active.
Then check their color R,G,B and A. Copy these numbers (amount of R,G,B and A) into the script.
Then back into the mapeditor and set all of the pointlights R,G,B and A to 0. Thus they will not project any light/color until told to by the script.


I tried them both and neither of them work. Lol im sure that just the candles will be fine for the time being. Thanks for the help


RE: Anyone need help? - Selyp - 05-13-2011

Looking for a creative way of implementing a carraige ride. I am thinking to build a small room (the interior of the carriage, with a view to the outside of the room, add sound fx, and make the room move with the player inside. Not sure if this is feasible with scripting, can you make a room slowly move as if it was a carriage. Any ideas on alternatives?


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

(05-13-2011, 05:21 AM)Selyp Wrote: Looking for a creative way of implementing a carraige ride. I am thinking to build a small room (the interior of the carriage, with a view to the outside of the room, add sound fx, and make the room move with the player inside. Not sure if this is feasible with scripting, can you make a room slowly move as if it was a carriage. Any ideas on alternatives?

The Village custom story seems to do it pretty good. Smile

Look at the elevator in Amnesia and see how they moved the wall instead of the actual elevator.


RE: Anyone need help? - Greven - 05-14-2011

Hi thear,

So i havent completely grasped the whole "if" command thingy and I wonder if you could either describe it (know it might be tiresome) or just link to a tutorial that makes sence.

Also how do i get a door to swing or bang open?


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

(05-14-2011, 08:30 AM)Greven Wrote: Hi thear,

So i havent completely grasped the whole "if" command thingy and I wonder if you could either describe it (know it might be tiresome) or just link to a tutorial that makes sence.

Also how do i get a door to swing or bang open?

An "if" statement is when you ask the game if something is compaired to something else.

When you want to use it, you must have 3 things: An item or thing that you are using, a value or another thing, and a reason why you are using it.

Lets say this:

Code:
x = 1;
y = 2;

if (x > y) // Asks if 1 is greater than 2. Since it's not true, it moves on.
{
     x--; // This takes 1 away from x. (x = 2, now it is x = 1)
}
else if (x < y) // Asks if 1 is less than 2. It's true so it does this making y = 1.
{
     y--; // Takes 1 away from y.
}
else if (x == y) // Since they both equal 1, it does this. Making z = 2.
{
     int z = x + y;
}

This shows how it could work, but if you have a local variable instead of a variable that is limited to its function, it is more advanced.

Code:
void OnStart()
{
     SetLocalVarInt("name", 1);
     Function();
}
void Function()
{
     if (GetLocalVarInt("name") == 1)
     {
          // Something happens when it equals 1, if it doesn't, the game doesn't do anything.
     }
}

I think I know how.

Use this:

AddPropImpulse("DoorName", 1.0f, 0.0f, 0.0f, "world");

It depends on which way you want it to go. For it to open, you need to give the door a force with one of the axis. The first one is x, second, y, and the third, z. If you want the door to blast open, try a little more.


RE: Anyone need help? - Greven - 05-14-2011

hmmm... ok, but what do you use these commands for? like give an example of something (sry for being stupid Big Grin)


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

(05-14-2011, 02:41 PM)Greven Wrote: hmmm... ok, but what do you use these commands for? like give an example of something (sry for being stupid Big Grin)

Here is an example. It checks to see if the local variable is equal to 2 once the player interacts with an object and enters an area. Then causing the player, when they enter some other area, having a light to turn off by itself. Complex? Not really. :p

Code:
OnStart()
{
     SetLocalVarInt("Var01", 0);
     AddEntityCollideCallback("Player", "ScriptArea_1", "FuncCheck1", true, 1);
     SetEntityPlayerInteractCallback("Item_1", "FuncCheck2", true);
     Func01();
}
void Func02(string &in asParent, string &in asChild, int alState)
{
     SetLampLit("Light1", false, true);
}
void Func01()
{
     if (GetLocalVarInt("Var01") == 2)
     {
          AddEntityCollideCallback("Player", "ScriptArea_2", "Func02", true, 1);
          return;
     }
}
void FuncCheck1(string &in asParent, string &in asChild, int alState)
{
     AddLocalVarInt("Var01", 1);
}
void FuncCheck2(string &in asEntity)
{
     AddLocalVarInt("Var01", 1);
}



RE: Anyone need help? - Simpanra - 05-14-2011

Hi, i really need some help =)

I want to make my custom story begin with a fade in form black and the player walking forward by itself. I want them to walk about two or three metres forward and then stop and give the player back control =)

I dont have the expansion and so i can't use the MovePlayerForward(af floatAmount) function, please help =)

Thanks ^_^


RE: Anyone need help? - Roenlond - 05-14-2011

Only thing I can think of is the AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords); command, although Kyle might be able to find a better answer.


RE: Anyone need help? - Greven - 05-14-2011

(05-14-2011, 01:39 PM)Kyle Wrote: I think I know how.

Use this:

AddPropImpulse("DoorName", 1.0f, 0.0f, 0.0f, "world");

It depends on which way you want it to go. For it to open, you need to give the door a force with one of the axis. The first one is x, second, y, and the third, z. If you want the door to blast open, try a little more.

What does the "world" stand for?