Frictional Games Forum (read-only)
Lag issue when triggering scripts - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Lag issue when triggering scripts (/thread-21614.html)

Pages: 1 2


RE: Lag issue when triggering scripts - Linus Ă…gren - 05-31-2013

(05-30-2013, 09:24 PM)The chaser Wrote: Oh, I'm sorry then. You could try to make something different though: Why must everything go together? You can put timers to distribute the falling ceiling, like this:



void RoofScare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("default_entity_1", false);

CreateParticleSystemAtEntity("", "ps_dust_elevator_crash.ps", "Area_BreakDust", false);

PlaySoundAtEntity("", "break_wood.snt", "Area_BreakDust", 0.0f, false);

AddTimer("", 0.8, "Do");

}

void Do (string &in asTimer)
{
SetEntityActive("default_entity_2", true);
SetEntityActive("wooden_board02_*", true);
SetEntityActive("wooden_board03_*", true);
}

Well, thing is that the ceiling has to break at the same time as the sound and boards fall down, else it will look very un-natural!
But I will look for a workaround, otherwise I will just have to accept this. Smile


RE: Lag issue when triggering scripts - Adrianis - 05-31-2013

Well, a slight off-set of timing could be a good idea, as things collapse generally it will come in stages as one part breaking causes another to collapse etc.

How many entities being activated are we talking about here? In 10's, or 100's?

Also, is there any lag as the objects actually fall & hit the ground, or is it really just the moment they get activated?


RE: Lag issue when triggering scripts - The chaser - 05-31-2013

(05-31-2013, 02:53 PM)junkfood2121 Wrote:
(05-30-2013, 09:24 PM)The chaser Wrote: Oh, I'm sorry then. You could try to make something different though: Why must everything go together? You can put timers to distribute the falling ceiling, like this:



void RoofScare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("default_entity_1", false);

CreateParticleSystemAtEntity("", "ps_dust_elevator_crash.ps", "Area_BreakDust", false);

PlaySoundAtEntity("", "break_wood.snt", "Area_BreakDust", 0.0f, false);

AddTimer("", 0.8, "Do");

}

void Do (string &in asTimer)
{
SetEntityActive("default_entity_2", true);
SetEntityActive("wooden_board02_*", true);
SetEntityActive("wooden_board03_*", true);
}

Well, thing is that the ceiling has to break at the same time as the sound and boards fall down, else it will look very un-natural!
But I will look for a workaround, otherwise I will just have to accept this. Smile

Well, use this script if the player doesn't see the broken roof when this happens. Anyways, if the player is right there, where the script has place, lag isn't an issue.