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?
Ge15t Offline
Junior Member

Posts: 48
Threads: 8
Joined: Feb 2011
Reputation: 0
RE: Anyone need help?

(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
05-13-2011, 03:50 AM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
RE: Anyone need help?

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?

Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
05-13-2011, 05:21 AM
Find
Kyle Offline
Posting Freak

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

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

05-13-2011, 10:55 AM
Find
Greven Offline
Member

Posts: 106
Threads: 13
Joined: May 2011
Reputation: 3
RE: Anyone need help?

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?

[WIP] Recidivus
(This post was last modified: 05-14-2011, 08:33 AM by Greven.)
05-14-2011, 08:30 AM
Find
Kyle Offline
Posting Freak

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

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

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.

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.

05-14-2011, 01:39 PM
Find
Greven Offline
Member

Posts: 106
Threads: 13
Joined: May 2011
Reputation: 3
RE: Anyone need help?

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

[WIP] Recidivus
(This post was last modified: 05-14-2011, 03:12 PM by Greven.)
05-14-2011, 02:41 PM
Find
Kyle Offline
Posting Freak

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

(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

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);
}

(This post was last modified: 05-14-2011, 03:48 PM by Kyle.)
05-14-2011, 03:46 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
RE: Anyone need help?

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 ^_^
05-14-2011, 05:14 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
RE: Anyone need help?

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.
05-14-2011, 05:28 PM
Find
Greven Offline
Member

Posts: 106
Threads: 13
Joined: May 2011
Reputation: 3
RE: Anyone need help?

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

[WIP] Recidivus
05-14-2011, 06:35 PM
Find




Users browsing this thread: 1 Guest(s)