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? - Kyle - 05-11-2011

Yup, no "if" statements involved. Any more questions? Tongue


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

(05-11-2011, 10:55 PM)Ge15t Wrote: Oh wow that is easy! Also really simple, I cant believe I didnt think of that lol. Thanks heaps!

Wow! nice one kyle, i never thought of that! I use a different method xD
{
AddEntityCollideCallback("Player", "Area_1", "Func1", true, 1);
AddEntityCollideCallback("Player", "Area_2", "Func2", true, 1);
}
void Func1(string &in asParent, string &in asChild, string intalState)
{
SetEntityActive("Area_2", true);
}
void Func2(string &in asParent, string &in asChild, string intalState)
{
What you want to happen here
}



Using this method i set the entity (the area) inactive in the editor so it only becomes active when i walk into Area_1 =)
Similar idea though ^_^


RE: Anyone need help? - Ge15t - 05-12-2011

Hi there, another problem!

Code:
void OnStart()
AddEntityCollideCallback("Player", "PianoArea_1", "PianoPlayCallback", true, 1);

Code:
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, false);
    SetLampLit("CandleActivate_2", true, false);
    SetLampLit("CandleActivate_3", true, false);
    SetLightVisible("PointLightActivate_1", true);
    SetLightVisible("PointLightActivate_2", true);
    SetLightVisible("PointLightActivate_3", true);
    
}

So when I hit the area, it calls this function which activates point lights and candles, and the sound effect, so its like as i touch the bottom of the stairs, lights activate at the top and haunting piano music starts playing to phantom pianos..

But what happens is the lights are off and DONT come on, and the point lights STAY on, even though I deactivated both the candles and the pointlights.

Any tips?


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

One time, I was designing a light time system that is like a full day that then switched every 10 minutes to the next hour. But when I tried it, it didn't work and nothing happened.

Suggestions:

1. If there is a .mapcache file, delete it.

2. Check to see if you actually did deactive the lights.

3. Check the script in case you somehow set them active before you wanted to.


RE: Anyone need help? - Ge15t - 05-12-2011

(05-12-2011, 10:55 AM)Kyle Wrote: One time, I was designing a light time system that is like a full day that then switched every 10 minutes to the next hour. But when I tried it, it didn't work and nothing happened.

Suggestions:

1. If there is a .mapcache file, delete it.

2. Check to see if you actually did deactive the lights.

3. Check the script in case you somehow set them active before you wanted to.

Yeah theres a .map_cache file but its 20mb.. are you sure I should delete it?


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

You can delete it. It just makes the level load faster. It will get replaced by an updated one later on.


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

Sorry to basically be reposting this, dunno if you missed it Kyle but it was about the doors that the grunt was hitting

Quote:Aha, thanks again dude...one minor other thing...Testing the map, I hid in a cabinet after the monster saw me. He started to hit the doors, but the doors don't seem to be breaking. He's hit them a good ten times roughly now. I haven't got "DisableBreakable" box checked, maybe he's just a weakling...Tongue

While the door he breaks down seems rather weak. He takes two hits and it's down. While I remember it usually took at least 3-4 hits beforehand...is it something do to with the pathnodes he is assigned too? Makes him stronger?


that's what I said, dunno if you just didn't know or missed it Tongue


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

Oops, sorry. I think the monster hits random damages between it's low and high. Or it just depends on the health of the door. It also might depend if he seen you not.


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

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

Ok so i managed to get the lights to come on, but the point lights either stay active (if they are checked 'active' in the editor) or stay off (if they are unchecked). I deleted my cache, but no luck so far with the point lights.


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

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.