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
Help me script this!!!
FreshKorruption Offline
Member

Posts: 94
Threads: 27
Joined: Oct 2011
Reputation: 1
#1
Help me script this!!!

Alright so here is the position I am in. I have it so when you pick up a key two monsters appear on each side of the room (I can do that). But when they appear, I want them to stand still and make the character spin towards one, then to the other, then spin around quickly towards the hallway. Basically, spin towards one enemy, the other, than turn around. I want to make it so they don't attack you until the player gains control again.

Custom Stories

-BrastaSauce

12-01-2011, 11:45 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Help me script this!!!

My best guess is to just deactivate triggers in the entities tab of the monster, (this makes him not re-act to anything). And when the player regains control activate new monsters that chase him (don't check the deactivate triggers).

12-02-2011, 01:30 AM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#3
RE: Help me script this!!!

Lets Name your stuff real quick

Charles1&Charles2(Left Side, they don't need these names)
Frank1&Frank2(Right Side)
Key1

Now for Charles1 and Frank1, do as Flamez3 said and check Deactivate Triggers, Then Make a Second (of the same Monster) in the same spot, but name it Charles2, or Frank2 (or whatever you want it to be called) and Make sure Deactivate triggers isn't checked. and make them inactive.

make A script box in the hallway where you want to look I named it Hall1 (in the script)

Now if you want to alter the speeds, and or Add Sounds, Etc then Go ahead, but this Should work.

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Key", "Scare1", true);
}

void Scare1(string &in asEntity)
{
    StartPlayerLookAt("Charles1", 5, 10, "");
    AddTimer("LookAtFrank1", 1.2, "LookAtFrank1");
    SetPlayerActive(false);
}

void LookAtFrank1(string &in asTimer)
{
    StartPlayerLookAt("Frank1", 5, 10, "");
    AddTimer("LookAtHall", .8, "LookAtHall");
}

void LookAtHall(string &in asTimer)
{
    StartPlayerLookAt("Hall1", 8, 10, "");
    AddTimer("GainControl" 0.2, "GainControl");
}

void GainControl(string &in asTimer)
{
    SetEntityActive("Charles1", false);
    SetEntityActive("Frank1", false);
    SetEntityActive("Charles2", true);
    SetEntityActive("Frank2", true);
    SetPlayerActive(true);
}

-Grey Fox





Current Project
Forgotten
12-02-2011, 03:33 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Help me script this!!!

(12-02-2011, 03:33 AM)GreyFox Wrote: Lets Name your stuff real quick

Charles1&Charles2(Left Side, they don't need these names)
Frank1&Frank2(Right Side)
Key1

Now for Charles1 and Frank1, do as Flamez3 said and check Deactivate Triggers, Then Make a Second (of the same Monster) in the same spot, but name it Charles2, or Frank2 (or whatever you want it to be called) and Make sure Deactivate triggers isn't checked. and make them inactive.

make A script box in the hallway where you want to look I named it Hall1 (in the script)

Now if you want to alter the speeds, and or Add Sounds, Etc then Go ahead, but this Should work.

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Key", "Scare1", true);
}

void Scare1(string &in asEntity)
{
    StartPlayerLookAt("Charles1", 5, 10, "");
    AddTimer("LookAtFrank1", 1.2, "LookAtFrank1");
    SetPlayerActive(false);
}

void LookAtFrank1(string &in asTimer)
{
    StartPlayerLookAt("Frank1", 5, 10, "");
    AddTimer("LookAtHall", .8, "LookAtHall");
}

void LookAtHall(string &in asTimer)
{
    StartPlayerLookAt("Hall1", 8, 10, "");
    AddTimer("GainControl" 0.2, "GainControl");
}

void GainControl(string &in asTimer)
{
    SetEntityActive("Charles1", false);
    SetEntityActive("Frank1", false);
    SetEntityActive("Charles2", true);
    SetEntityActive("Frank2", true);
    SetPlayerActive(true);
}

-Grey Fox
You put it alot better than I did Smile


12-02-2011, 06:33 AM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#5
RE: Help me script this!!!

I had the Time, Lol and wanted to do it.

I'm better at scripting if someone kinda directs me what they want (IE working with a team.)


-Grey Fox

Current Project
Forgotten
12-02-2011, 12:39 PM
Find
FreshKorruption Offline
Member

Posts: 94
Threads: 27
Joined: Oct 2011
Reputation: 1
#6
RE: Help me script this!!!

(12-02-2011, 03:33 AM)GreyFox Wrote: Lets Name your stuff real quick

Charles1&Charles2(Left Side, they don't need these names)
Frank1&Frank2(Right Side)
Key1

Now for Charles1 and Frank1, do as Flamez3 said and check Deactivate Triggers, Then Make a Second (of the same Monster) in the same spot, but name it Charles2, or Frank2 (or whatever you want it to be called) and Make sure Deactivate triggers isn't checked. and make them inactive.

make A script box in the hallway where you want to look I named it Hall1 (in the script)

Now if you want to alter the speeds, and or Add Sounds, Etc then Go ahead, but this Should work.

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Key", "Scare1", true);
}

void Scare1(string &in asEntity)
{
    StartPlayerLookAt("Charles1", 5, 10, "");
    AddTimer("LookAtFrank1", 1.2, "LookAtFrank1");
    SetPlayerActive(false);
}

void LookAtFrank1(string &in asTimer)
{
    StartPlayerLookAt("Frank1", 5, 10, "");
    AddTimer("LookAtHall", .8, "LookAtHall");
}

void LookAtHall(string &in asTimer)
{
    StartPlayerLookAt("Hall1", 8, 10, "");
    AddTimer("GainControl" 0.2, "GainControl");
}

void GainControl(string &in asTimer)
{
    SetEntityActive("Charles1", false);
    SetEntityActive("Frank1", false);
    SetEntityActive("Charles2", true);
    SetEntityActive("Frank2", true);
    SetPlayerActive(true);
}

-Grey Fox
Thanks it worked perfectly. My only issue is that it won't stop looking at hall1 after it looks at the grunts.



Custom Stories

-BrastaSauce

12-13-2011, 03:08 AM
Website Find
ggstarfoxxie Offline
Junior Member

Posts: 36
Threads: 9
Joined: Aug 2011
Reputation: 2
#7
RE: Help me script this!!!

Try this:

void GainControl(string &in asTimer)
{
SetEntityActive("Charles1", false);
SetEntityActive("Frank1", false);
SetEntityActive("Charles2", true);
SetEntityActive("Frank2", true);
SetPlayerActive(true);
StopPlayerLookAt();
}

12-13-2011, 04:26 AM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#8
RE: Help me script this!!!

My Bad, In my Mind I though I put that in there. Do what GGstarfoxxie said and it should be good.

Good Luck and Thanks Foxxie
-Grey Fox

Current Project
Forgotten
12-13-2011, 04:57 AM
Find




Users browsing this thread: 1 Guest(s)