Frictional Games Forum (read-only)
[CHAOS] Script collapse. - 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: [CHAOS] Script collapse. (/thread-22199.html)



Script collapse. - Icaab2608 - 07-21-2013

At me a problem with a script:
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""Collapse""Collapse"true1)
}
void Collapse(string &in asParentstring &in asChildint alState)
{
SetEntityActive("servant_nyan_2"false);
SetEntityActive("thin_straight_long_1"false);
SetEntityActive("drag_brown_rock_1"false);
SetEntityActive("block_box_nonchar_1"false);

SetEntityActive("thin_straight_long_2"true);
SetEntityActive("drag_brown_rock_1"true);
SetEntityActive("drag_brown_rock_2"true);
SetEntityActive("drag_brown_rock_3"true);
SetEntityActive("drag_brown_rock_4"true);
SetEntityActive("drag_brown_rock_5"true);
SetEntityActive("drag_brown_rock_6"true);
SetEntityActive("drag_brown_rock_7"true);
SetEntityActive("drag_brown_rock_8"true);
SetEntityActive("drag_brown_rock_9"true);
SetEntityActive("drag_brown_rock_10"true);
SetEntityActive("drag_brown_rock_11"true);
SetEntityActive("drag_brown_rock_12"true);
SetEntityActive("drag_brown_rock_13"true);
SetEntityActive("drag_brown_rock_14"true);
SetEntityActive("drag_brown_rock_15"true);
SetEntityActive("drag_brown_rock_16"true);
SetEntityActive("drag_brown_rock_17"true);
SetEntityActive("drag_brown_rock_18"true);
SetEntityActive("drag_brown_rock_19"true);
SetEntityActive("drag_brown_rock_20"true);
SetEntityActive("drag_brown_rock_21"true);
SetEntityActive("drag_brown_rock_22"true);
SetEntityActive("drag_brown_rock_23"true);
SetEntityActive("drag_brown_rock_24"true);
SetEntityActive("drag_brown_rock_25"true);
SetEntityActive("drag_brown_rock_26"true);
SetEntityActive("drag_brown_rock_27"true);
SetEntityActive("drag_brown_rock_28"true);
SetEntityActive("drag_brown_rock_29"true);
SetEntityActive("brown_cave_in_1"true);
SetEntityActive("brown_cave_in_2"true);
SetEntityActive("stone_small01_brown_1"true);
SetEntityActive("stone_small01_brown_2"true);
SetEntityActive("stone_small01_brown_3"true);
SetEntityActive("stone_small01_brown_4"true);
SetEntityActive("stone_med01_brown_1"true);
StopMusic(3.00);
DestroyParticleSystem("ParticleSystem_1");
DestroyParticleSystem("ParticleSystem_2");
DestroyParticleSystem("ParticleSystem_5");
DestroyParticleSystem("ParticleSystem_6");
DestroyParticleSystem("ParticleSystem_14");
DestroyParticleSystem("ParticleSystem_19");
DestroyParticleSystem("ParticleSystem_15");
DestroyParticleSystem("ParticleSystem_62");
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_1"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_2"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_3"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_4"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_5"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_6"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_7"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_8"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_9"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_10"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_11"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_12"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_13"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_14"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_15"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_16"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_17"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_1"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_2"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_3"true);
PreloadParticleSystem("ps_dust_whirl");

Huh
[img][Image: bandicam20_4872334_8520422.jpg][/img]



The error is,that not all objects become active.
File:http://www.mediafire.com/download/j8fbo1efxstvf11/dr1map.rar


RE: Script collapse. - ExpectedIdentifier - 07-21-2013

(07-21-2013, 05:09 PM)Icaab2608 Wrote: At me a problem with a script:
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""Collapse""Collapse"true1)
}
void Collapse(string &in asParentstring &in asChildint alState)
{
SetEntityActive("servant_nyan_2"false);
SetEntityActive("thin_straight_long_1"false);
SetEntityActive("drag_brown_rock_1"false);
SetEntityActive("block_box_nonchar_1"false);

SetEntityActive("thin_straight_long_2"true);
SetEntityActive("drag_brown_rock_1"true);
SetEntityActive("drag_brown_rock_2"true);
SetEntityActive("drag_brown_rock_3"true);
SetEntityActive("drag_brown_rock_4"true);
SetEntityActive("drag_brown_rock_5"true);
SetEntityActive("drag_brown_rock_6"true);
SetEntityActive("drag_brown_rock_7"true);
SetEntityActive("drag_brown_rock_8"true);
SetEntityActive("drag_brown_rock_9"true);
SetEntityActive("drag_brown_rock_10"true);
SetEntityActive("drag_brown_rock_11"true);
SetEntityActive("drag_brown_rock_12"true);
SetEntityActive("drag_brown_rock_13"true);
SetEntityActive("drag_brown_rock_14"true);
SetEntityActive("drag_brown_rock_15"true);
SetEntityActive("drag_brown_rock_16"true);
SetEntityActive("drag_brown_rock_17"true);
SetEntityActive("drag_brown_rock_18"true);
SetEntityActive("drag_brown_rock_19"true);
SetEntityActive("drag_brown_rock_20"true);
SetEntityActive("drag_brown_rock_21"true);
SetEntityActive("drag_brown_rock_22"true);
SetEntityActive("drag_brown_rock_23"true);
SetEntityActive("drag_brown_rock_24"true);
SetEntityActive("drag_brown_rock_25"true);
SetEntityActive("drag_brown_rock_26"true);
SetEntityActive("drag_brown_rock_27"true);
SetEntityActive("drag_brown_rock_28"true);
SetEntityActive("drag_brown_rock_29"true);
SetEntityActive("brown_cave_in_1"true);
SetEntityActive("brown_cave_in_2"true);
SetEntityActive("stone_small01_brown_1"true);
SetEntityActive("stone_small01_brown_2"true);
SetEntityActive("stone_small01_brown_3"true);
SetEntityActive("stone_small01_brown_4"true);
SetEntityActive("stone_med01_brown_1"true);
StopMusic(3.00);
DestroyParticleSystem("ParticleSystem_1");
DestroyParticleSystem("ParticleSystem_2");
DestroyParticleSystem("ParticleSystem_5");
DestroyParticleSystem("ParticleSystem_6");
DestroyParticleSystem("ParticleSystem_14");
DestroyParticleSystem("ParticleSystem_19");
DestroyParticleSystem("ParticleSystem_15");
DestroyParticleSystem("ParticleSystem_62");
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_1"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_2"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_3"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_4"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_5"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_6"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_7"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_8"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_9"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_10"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_11"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_12"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_13"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_14"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_15"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_16"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_17"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_1"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_2"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_3"true);
PreloadParticleSystem("ps_dust_whirl");

Huh
[img][Image: bandicam20_4872334_8520422.jpg][/img]



The error is,that not all objects become active.

Some entities can't be set active/unactive. These are StaticProp entities. Also static objects can't be set active/unactive. I'm assuming this is your problem.

Also a little tip, when doing something to multiple objects, it is better and less time consuming to use a for loop, like this:

PHP Code:
for(int i 0<31i++)
SetEntityActive("rock_"+itrue); 

This would set all entity rocks named rock_1 to rock_30 active.


RE: Script collapse. - ClayPigeon - 07-21-2013

I also encountered this problem when I tried to set gallery images active and deactivate them, but the didn't appear. So yeah, StaticProps can't be deactivated.
The solution is to open the model editor and set the type to Object -> Static Object (User Defined Variables) and then output the .ent to your custom story folder.