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
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#2
RE: Scripting Help

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

only entites

SetENTITYactive.

[Image: 44917299.jpg]Dubstep <3
07-19-2011, 07:41 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#3
RE: Scripting Help

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

07-19-2011, 07:47 PM
Website Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#4
RE: Scripting Help

Okay thanks Tanshaydar. I didn't know that.

[Image: 44917299.jpg]Dubstep <3
07-19-2011, 07:50 PM
Find
Rapture Offline
Posting Freak

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

(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.

07-19-2011, 07:51 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#6
RE: Scripting Help

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

the same like your other AddEntityCollideCallback
07-19-2011, 07:58 PM
Find
Rapture Offline
Posting Freak

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

(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
07-19-2011, 08:08 PM
Find




Users browsing this thread: 2 Guest(s)