Frictional Games Forum (read-only)
Scripting Problem? - 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: Scripting Problem? (/thread-24492.html)



Scripting Problem? - TheNextLevelz - 01-30-2014

I dont know what to do but what I wan't is that I move into an area and that things are appearing... I dont get any "FATAL ERROR" but it just won't work..
this is my script:

void OnStart()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 1, 1, false);
AddEntityCollideCallback("Player", "Jumpscare_1", "Jump1", true, 1);
AddEntityCollideCallback("Player", "lols", "Jump2", true, 1);
}

void Jump1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.ogg", "Player", 0, false);
SetEntityActive("bro_1", true);
AddTimer("", 0.7f, "scared");
}

void Jump2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "01_tiny1.ogg", "Player", 0, false);
SetEntityActive("deformed_man_1", true);
SetEntityActive("deformed_man_2", true);
SetEntityActive("deformed_man_3", true);
SetEntityActive("deformed_man_4", true);
SetEntityActive("deformed_man_5", true);
SetEntityActive("deformed_man_6", true);
SetEntityActive("deformed_man_7", true);
SetEntityActive("deformed_man_8", true);
SetEntityActive("deformed_man_9", true);
SetEntityActive("deformed_man_10", true);
SetEntityActive("deformed_man_11", true);
SetEntityActive("deformed_man_12", true);
SetEntityActive("deformed_man_13", true);
SetEntityActive("deformed_man_14", true);
SetEntityActive("deformed_man_15", true);
SetEntityActive("deformed_man_16", true);
SetEntityActive("deformed_man_17", true);
SetEntityActive("deformed_man_18", true);
SetEntityActive("deformed_man_19", true);
SetEntityActive("deformed_man_20", true);
SetEntityActive("deformed_man_21", true);
SetEntityActive("deformed_man_22", true);
SetEntityActive("deformed_man_23", true);
SetEntityActive("deformed_man_24", true);
SetEntityActive("deformed_man_25", true);
SetEntityActive("deformed_man_26", true);
SetEntityActive("deformed_man_27", true);
SetEntityActive("deformed_man_28", true);
SetEntityActive("deformed_man_29", true);
SetEntityActive("deformed_man_30", true);
SetEntityActive("deformed_man_31", true);
SetEntityActive("deformed_man_32", true);
SetEntityActive("deformed_man_34", true);
SetEntityActive("deformed_man_35", true);
SetEntityActive("deformed_man_36", true);
SetEntityActive("deformed_man_37", true);
SetEntityActive("deformed_man_38", true);
SetEntityActive("deformed_man_39", true);
SetEntityActive("deformed_man_40", true);
SetEntityActive("deformed_man_41", true);
SetEntityActive("deformed_man_42", true);
SetEntityActive("deformed_man_43", true);
SetEntityActive("deformed_man_44", true);
SetEntityActive("deformed_man_45", true);
SetEntityActive("deformed_man_46", true);
SetEntityActive("deformed_man_47", true);
SetEntityActive("deformed_man_48", true);
SetEntityActive("deformed_man_49", true);
SetEntityActive("deformed_man_50", true);
SetEntityActive("deformed_man_51", true);
SetEntityActive("deformed_man_52", true);
SetEntityActive("deformed_man_53", true);
SetEntityActive("deformed_man_54", true);
SetEntityActive("deformed_man_55", true);
AddTimer("", 50.0f, "scared2");
}

void scared(string &in asTimer)
{
SetEntityActive("bro_1", false);
}

void scared2(string &in asTimer)
{
SetEntityActive("deformed_man_1", false);
SetEntityActive("deformed_man_2", false);
SetEntityActive("deformed_man_3", false);
SetEntityActive("deformed_man_4", false);
SetEntityActive("deformed_man_5", false);
SetEntityActive("deformed_man_6", false);
SetEntityActive("deformed_man_7", false);
SetEntityActive("deformed_man_8", false);
SetEntityActive("deformed_man_9", false);
SetEntityActive("deformed_man_10", false);
SetEntityActive("deformed_man_11", false);
SetEntityActive("deformed_man_12", false);
SetEntityActive("deformed_man_13", false);
SetEntityActive("deformed_man_14", false);
SetEntityActive("deformed_man_15", false);
SetEntityActive("deformed_man_16", false);
SetEntityActive("deformed_man_17", false);
SetEntityActive("deformed_man_18", false);
SetEntityActive("deformed_man_19", false);
SetEntityActive("deformed_man_20", false);
SetEntityActive("deformed_man_21", false);
SetEntityActive("deformed_man_22", false);
SetEntityActive("deformed_man_23", false);
SetEntityActive("deformed_man_24", false);
SetEntityActive("deformed_man_25", false);
SetEntityActive("deformed_man_26", false);
SetEntityActive("deformed_man_27", false);
SetEntityActive("deformed_man_28", false);
SetEntityActive("deformed_man_29", false);
SetEntityActive("deformed_man_30", false);
SetEntityActive("deformed_man_31", false);
SetEntityActive("deformed_man_32", false);
SetEntityActive("deformed_man_34", false);
SetEntityActive("deformed_man_35", false);
SetEntityActive("deformed_man_36", false);
SetEntityActive("deformed_man_37", false);
SetEntityActive("deformed_man_38", false);
SetEntityActive("deformed_man_39", false);
SetEntityActive("deformed_man_40", false);
SetEntityActive("deformed_man_41", false);
SetEntityActive("deformed_man_42", false);
SetEntityActive("deformed_man_43", false);
SetEntityActive("deformed_man_44", false);
SetEntityActive("deformed_man_45", false);
SetEntityActive("deformed_man_46", false);
SetEntityActive("deformed_man_47", false);
SetEntityActive("deformed_man_48", false);
SetEntityActive("deformed_man_49", false);
SetEntityActive("deformed_man_50", false);
SetEntityActive("deformed_man_51", false);
SetEntityActive("deformed_man_52", false);
SetEntityActive("deformed_man_53", false);
SetEntityActive("deformed_man_54", false);
SetEntityActive("deformed_man_55", false);
}


void scared is working but
void scared2 isn't working....
as i said before i dont get any FATAL ERROR it already shows up when i'am NOT in the area and if i stand in the area nothing happends

any help would be appreciated!! Smile

(sorry for bad english i'm from Holland)


RE: Scripting Problem? - DnALANGE - 01-30-2014

scared2(string &in asTimer)

The timer is 50 seconds.
50.0f,
Maybe wait and try if it works after 50 seconds.


RE: Scripting Problem? - TheNextLevelz - 01-30-2014

(01-30-2014, 08:34 PM)DnALANGE Wrote: scared2(string &in asTimer)

The timer is 50 seconds.
50.0f,
Maybe wait and try if it works after 50 seconds.
nope that isn't working either i waited and they don't dissapear
the statues are there already but that is not what it is supposed to be
i must walk in a area and then they are active but they are already active.


RE: Scripting Problem? - Radical Batz - 01-30-2014

nope that isn't working either i waited and they don't dissapear
the statues are there already but that is not what it is supposed to be
i must walk in a area and then they are active but they are already active.
[/quote]

They should be inactive then, uncheck Active on them


RE: Scripting Problem? - daortir - 01-30-2014

No. The statues you are using cannot be active/inactive. They are considered as static props.
You can't set those active/inactive unless you edit the files of the model ^^.

The statues in ptest can be deactivated though.


RE: Scripting Problem? - ingedoom - 01-30-2014

This hurts my eyes. Please use for loops.

for(int i = 1; i <= 55; i++)
SetEntityActive("deformed_man_" + i, true);


RE: Scripting Problem? - PutraenusAlivius - 01-31-2014

void OnStart()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 1, 1, false);
AddEntityCollideCallback("Player", "Jumpscare_1", "Jump1", true, 1);
AddEntityCollideCallback("Player", "lols", "Jump2", true, 1);
}

void Jump1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.ogg", "Player", 0, false);
SetEntityActive("bro_1", true);
AddTimer("", 0.7f, "scared");
}

void Jump2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "01_tiny1.ogg", "Player", 0, false);
SetEntityActive("deformed_man_*", true);
AddTimer("", 50.0f, "scared2");
}

void scared(string &in asTimer)
{
SetEntityActive("bro_1", false);
}

void scared2(string &in asTimer)
{
SetEntityActive("deformed_man_*", false);
}

I think the deformed man entity cannot be activated/deactivated.


RE: Scripting Problem? - TheNextLevelz - 01-31-2014

Okay i removed the statues with something else and it woorked perfectly