Frictional Games Forum (read-only)
AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK - 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: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK (/thread-15623.html)



AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK - Wapez - 05-25-2012

Hey guys, my scriptarea called "spawn1" wont trigger anything. Please take a look. Thanks.

The Callback in void OnStart() is:
AddEntityCollideCallback("Player", "spawn1", "ActivateMonster3", true, 1);


And my "ActivateMonster3" looks like this:

void ActivateMonster3(string &in item)
{
SetEntityActive("servant_grunt_3", true);
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_10", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_12", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_13", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_14", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_15", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_16", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_17", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_18", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_19", 0, "Idle");
PlaySoundAtEntity("", "amb_alert.snt", "spawn1", 0, false);

//ADD RED LIGHT
SetEntityActive("candlestick_floor_red_1", true);
SetEntityActive("candlestick_floor_red_2", true);
SetEntityActive("candlestick_floor_red_3", true);
SetEntityActive("candlestick_floor_red_4", true);
SetEntityActive("candlestick_floor_red_5", true);
SetEntityActive("candlestick_floor_red_6", true);
SetEntityActive("candlestick_floor_red_7", true);
SetEntityActive("candlestick_floor_red_8", true);
SetEntityActive("candlestick_floor_red_9", true);
SetEntityActive("candlestick_floor_red_10", true);
SetEntityActive("candlestick_floor_red_11", true);
SetEntityActive("candlestick_floor_red_12", true);
SetEntityActive("candlestick_floor_red_13", true);
SetEntityActive("candlestick_floor_red_14", true);
SetEntityActive("candlestick_floor_red_15", true);
SetEntityActive("candlestick_floor_red_16", true);
SetEntityActive("candlestick_floor_red_17", true);
SetEntityActive("candlestick_floor_red_18", true);
SetEntityActive("candlestick_floor_red_19", true);
SetEntityActive("candlestick_floor_red_20", true);
SetEntityActive("candlestick_floor_red_21", true);
SetEntityActive("candlestick_floor_red_22", true);
SetEntityActive("candlestick_floor_red_23", true);
SetEntityActive("candlestick_floor_red_24", true);
SetEntityActive("candlestick_floor_red_25", true);
SetEntityActive("candlestick_floor_red_26", true);

SetEntityActive("candlestick_floor_red_27", true);

//DESTROY NORMAL LIGHT
SetEntityActive("candlestick_floor_23", false);
SetEntityActive("candlestick_floor_24", false);
SetEntityActive("candlestick_floor_25", false);
SetEntityActive("candlestick_floor_26", false);
SetEntityActive("candlestick_floor_27", false);
SetEntityActive("candlestick_floor_28", false);
SetEntityActive("candlestick_floor_29", false);
SetEntityActive("candlestick_floor_30", false);
SetEntityActive("candlestick_floor_31", false);
SetEntityActive("candlestick_floor_32", false);
SetEntityActive("candlestick_floor_33", false);
SetEntityActive("candlestick_floor_34", false);
SetEntityActive("candlestick_floor_35", false);
SetEntityActive("candlestick_floor_36", false);
SetEntityActive("candlestick_floor_37", false);
SetEntityActive("candlestick_floor_38", false);
SetEntityActive("candlestick_floor_39", false);
SetEntityActive("candlestick_floor_40", false);
SetEntityActive("candlestick_floor_41", false);
SetEntityActive("candlestick_floor_42", false);
SetEntityActive("candlestick_floor_43", false);
SetEntityActive("candlestick_floor_44", false);
SetEntityActive("candlestick_floor_45", false);
SetEntityActive("candlestick_floor_46", false);
SetEntityActive("candlestick_floor_47", false);

SetEntityActive("candlestick_floor_48", false);
SetEntityActive("candlestick_floor_49", false);
}


RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK - Your Computer - 05-25-2012

Wrong callback syntax.


RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK - Cranky Old Man - 05-25-2012

Should be this syntax instead:
void ActivateMonster3(string &in asParent, string &in asChild, int alState)
{
...
...
}


RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK - Putmalk - 05-25-2012

Clean up your code. This whole block of:

Code:
SetEntityActive("candlestick_floor_23", false);

SetEntityActive("candlestick_floor_24", false);

SetEntityActive("candlestick_floor_25", false);

SetEntityActive("candlestick_floor_26", false);

SetEntityActive("candlestick_floor_27", false);

SetEntityActive("candlestick_floor_28", false);

SetEntityActive("candlestick_floor_29", false);

SetEntityActive("candlestick_floor_30", false);

SetEntityActive("candlestick_floor_31", false);

SetEntityActive("candlestick_floor_32", false);

SetEntityActive("candlestick_floor_33", false);

SetEntityActive("candlestick_floor_34", false);

SetEntityActive("candlestick_floor_35", false);

SetEntityActive("candlestick_floor_36", false);

SetEntityActive("candlestick_floor_37", false);

SetEntityActive("candlestick_floor_38", false);

SetEntityActive("candlestick_floor_39", false);

SetEntityActive("candlestick_floor_40", false);

SetEntityActive("candlestick_floor_41", false);

SetEntityActive("candlestick_floor_42", false);

SetEntityActive("candlestick_floor_43", false);

SetEntityActive("candlestick_floor_44", false);

SetEntityActive("candlestick_floor_45", false);

SetEntityActive("candlestick_floor_46", false);

SetEntityActive("candlestick_floor_47", false);

SetEntityActive("candlestick_floor_48", false);

SetEntityActive("candlestick_floor_49", false);

can be simplifed to two lines of code:

Code:
for(int i=23;i<=49;i++)
   SetEntityActive("candlestick_floor_"+i, false);

Tada. Smile


RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK - Stepper321 - 05-25-2012

(05-25-2012, 06:41 PM)Putmalk Wrote: Clean up your code. This whole block of:

for(int i=23;i<=49;i++)


Tada. Smile

Okay, so i started learning coding for Java and c++, but i still don't have any idea what
for(int i=23;i<=49;i++) means and how it works. I need some full explanation of it Big Grin.


RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK - Your Computer - 05-25-2012

(05-25-2012, 08:25 PM)Stepper321 Wrote: Okay, so i started learning coding for Java and c++, but i still don't have any idea what
for(int i=23;i<=49;i++) means and how it works. I need some full explanation of it Big Grin.

http://www.frictionalgames.com/forum/thread-10798-post-112331.html#pid112331