The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting Help
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#1
Wink  Scripting Help

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.
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
    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.
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.
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");
}
(This post was last modified: 07-19-2011, 08:08 PM by Rapture.)
07-19-2011, 07:38 PM
Find


Messages In This Thread
Scripting Help - by Rapture - 07-19-2011, 07:38 PM
RE: Scripting Help - by xtron - 07-19-2011, 07:41 PM
RE: Scripting Help - by Tanshaydar - 07-19-2011, 07:47 PM
RE: Scripting Help - by xtron - 07-19-2011, 07:50 PM
RE: Scripting Help - by Rapture - 07-19-2011, 07:51 PM
RE: Scripting Help - by MrCookieh - 07-19-2011, 07:58 PM
RE: Scripting Help - by Rapture - 07-19-2011, 08:08 PM



Users browsing this thread: 1 Guest(s)