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
Script Help Collapse
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#11
RE: Collapse

(10-28-2011, 03:16 PM)devin413 Wrote: rofl >.> i nerver make an f behind it Big Grin


it worked?

10-28-2011, 03:27 PM
Find
devin413 Offline
Member

Posts: 175
Threads: 7
Joined: Jul 2011
Reputation: 3
#12
RE: Collapse

(10-28-2011, 03:27 PM)flamez3 Wrote:
(10-28-2011, 03:16 PM)devin413 Wrote: rofl >.> i nerver make an f behind it Big Grin


it worked?
ämm yes Big Grin

Boris Game Studios: Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt

10-28-2011, 06:08 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#13
RE: Collapse

Thanks folks it's working now Big Grin
I have added the sound and the shaking camera.
This is how it looks now:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
    PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
          return;
    }
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void OnEnter()
{
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
}

void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{SetEntityActive("cave_in_1", true);
StartScreenShake(0.5, 2, 1, 2);
PlaySoundAtEntity("Cave_in", "04_rock_break.snt", "Player", 0, true);
}

If I come across another problem, I will post it right here in this topic.
Thanks for the great help and tips! Angel
10-28-2011, 06:18 PM
Find
devin413 Offline
Member

Posts: 175
Threads: 7
Joined: Jul 2011
Reputation: 3
#14
RE: Collapse

yehh ok i will be have an eye on it Big Grin

Boris Game Studios: Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt

10-28-2011, 06:22 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#15
RE: Collapse

Hello,

I am now a bit further. Everything will cave in correctly. Now I added a monster. The monster does its work perfectly, but now I want it to exist forever, until the player enters the hidden room. So the patroll nodes will keep looping forever. If you don't find the hidden room, you will keep having the chance you will come across the monster and it will kill you.
Here you will see the code I made.
In short, what do I want?
1) The monsters starts at "PathNodeArea_1".
2) When the monster gets at "PathNodeArea_25", he will start over at "PathNodeArea_1". nr. 25 is next to point 1, so he can walk from point 25 to 1 easily.

That's all Smile

EDIT:
I've edited it a bit, and it seems the monster now keeps following his waypoint, untill I reach the secret room.


//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
    PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
          return;
    }
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void OnEnter()
{
AddEntityCollideCallback("Player", "Hallwaysleepingrooms_Monstersound", "Grunt_Sound", true, 1);
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
AddEntityCollideCallback("Player", "Monster_sleepingrooms", "Grunt_Sleepingrooms", true, 1);
AddEntityCollideCallback("Player", "Monster_Disappear", "Monster_Fadetodust", true, 1);
} ///Deze is voor het monster///

void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{SetEntityActive("cave_in_1", true);
StartScreenShake(0.3, 2, 1, 2);
PlaySoundAtEntity("Cave_in", "04_rock_break.snt", "Player", 0, true);
PlayMusic("00_event_gallery.ogg", false, 1, 0, 9, true);
}

////////////////////////////////////////////////////
/// Monster in slaapkamer

void Grunt_Sleepingrooms(string &in asParent, string &in asChild, int alState)
{    SetEntityActive("Grunt_Sleepingrooms", true);
{for (int i = 1; i <6; i++)
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_1", 2, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_7", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_8", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_9", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_10", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_11", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_12", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_13", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_14", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_15", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_16", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_17", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_18", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_19", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_20", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_21", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_22", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_23", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_24", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_25", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_26", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_6", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_7", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_8", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_9", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_10", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_11", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_12", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_13", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_14", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_15", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_16", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_17", 4, "");}
PlayMusic("search_grunt.ogg", true, 2, 0, 1, true);
}

////////////////////////////////////////////
///Grunt geluid begin slaapkamers

void Grunt_Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Brute_Wake_up", "amb_idle_whimp.snt", "Player", 0, false);
}

////////////////////////////////////////////
///Grunt Verdwijnt

void Monster_Fadetodust(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("Grunt_Sleepingrooms", true);
PlayMusic("02_amb_safe.ogg", false, 1, 0, 10, true);
}


(This post was last modified: 10-30-2011, 08:59 PM by Sauron The King.)
10-30-2011, 04:00 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#16
RE: Collapse

I've started a new topic here:
http://www.frictionalgames.com/forum/thread-11132.html
11-02-2011, 01:38 PM
Find




Users browsing this thread: 1 Guest(s)