Frictional Games Forum (read-only)
Scripting 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Scripting Help (/thread-9249.html)



Scripting Help - Rapture - 07-19-2011

Hi, I'm new to scripting so I've been mostly copying, pastying and guessing at what goes where. I think my scripting is not working at the parameters for a function called "RosePetals". I'm not sure what to put in it.
Code:
void RosePetal()
{
    SetEntityInteractionDisabled("carpet_moveable_1", false);
    StartPlayerLookAt("RosePetals", 5.0f, 5.0f, "");
    CreateParticleSystemAtEntity("RosePetals", "ps_rose_petals_loop.ps", "RosePetals", false);
    AddDebugMessage("Petals Are gonna Fall!", false);    
}

Basically I have a entity that is disabled
Code:
    AddEntityCollideCallback("Player", "LookToSafety", "RosePetal", true, 1);

So when I first enter the area where the monsters will spawn up, it will activate the area just back in the room.
Code:
void MonsterFunction1(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("LookToSafety", true);

    SetEntityActive("servant_grunt_2", true);
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 1.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_3", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_4", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_5", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_6", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_7", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_8", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_9", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_54", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_55", 0.0f, "");
    
    SetEntityActive("servant_grunt_3", true);
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_10", 1.0f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_11", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_12", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_13", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_14", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_15", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_8", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_9", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_54", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_55", 0.00f, "");

    AddDebugMessage("Monsters Work", false);
}
So basically I want my area called RosePetal to work. Here is the entire script. Anyone that can help would be awesome! Smile

Is their any way to upload the map? It won't let me since it doesn't support the file extension.
Code:
void OnStart()
{
    SetEntityInteractionDisabled("carpet_moveable_1", true);

    AddUseItemCallback("", "key_study_1", "prison_1", "UnlockDoor", true);

    AddEntityCollideCallback("Player", "StartMonsters", "MonsterFunction1", true, 1);
    AddEntityCollideCallback("Player", "MonsterMove", "MonsterFunction2", true, 1);
    AddEntityCollideCallback("Player", "LookToSafety", "RosePetal", true, 1);
}

void Intro()
{

}

void OnEnter()
{    

}


void MonsterFunction1(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("LookToSafety", true);

    SetEntityActive("servant_grunt_2", true);
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 1.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_3", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_4", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_5", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_6", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_7", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_8", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_9", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_54", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_55", 0.0f, "");
    
    SetEntityActive("servant_grunt_3", true);
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_10", 1.0f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_11", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_12", 0.0f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_13", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_14", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_15", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_8", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_9", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_54", 0.00f, "");
    AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_55", 0.00f, "");

    AddDebugMessage("Monsters Work", false);
}

void RosePetal()
{
    SetEntityInteractionDisabled("carpet_moveable_1", false);
    StartPlayerLookAt("RosePetals", 5.0f, 5.0f, "");
    CreateParticleSystemAtEntity("RosePetals", "ps_rose_petals_loop.ps", "RosePetals", false);
    AddDebugMessage("Petals Are gonna Fall!", false);    
}


void MonsterFunction2(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("enemy_suitor_1", true);
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_26", 1.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_16", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_17", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_18", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_19", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_20", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_21", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_22", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_23", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_24", 0.0f, "");
    AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_25", 0.0f, "");
}

void KeyStart(string &in entity, string &in type)
{
    PlayMusic("10_puzzle02.ogg", false, 0.7, 0.1, 10, false);
    SetEntityActive("servant_grunt_9", true);
    AddEnemyPatrolNode("servant_grunt_9", "PathNodeArea_55", 0.0f, "");
}

void UnlockDoor(string &in entity, string &in type)
{
    SetSwingDoorLocked("prison_1", false, true);
    PlaySoundAtEntity("unlocksound", "unlock_door.snt", "Player", 0.0f, false);
    GiveSanityBoostSmall();
    RemoveItem("key_study_1");
}



RE: Scripting Help - xtron - 07-19-2011

Hmm...I think that Areas can't be active/deactivated by script.

only entites

SetENTITYactive.


RE: Scripting Help - Tanshaydar - 07-19-2011

Areas can be activated and deactivated. I use it a lot.


RE: Scripting Help - xtron - 07-19-2011

Okay thanks Tanshaydar. I didn't know that.


RE: Scripting Help - Rapture - 07-19-2011

(07-19-2011, 07:50 PM)xtron Wrote: Okay thanks Tanshaydar. I didn't know that.
Ya same. But what the parameters, I don't know what to put in the () to make it work.




RE: Scripting Help - MrCookieh - 07-19-2011

string &in asParent, string &in asChild, int alState

the same like your other AddEntityCollideCallback


RE: Scripting Help - Rapture - 07-19-2011

(07-19-2011, 07:58 PM)MrCookieh Wrote: string &in asParent, string &in asChild, int alState

the same like your other AddEntityCollideCallback
Sweet, Thank you! Big Grin