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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finishing it off [SOLVED] THE STORY'S OUT!!!!!
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#1
Question  Finishing it off [SOLVED] THE STORY'S OUT!!!!!

Hey guys!
I'm almost done with my first custom story! There are only few things left to do, but I do need your help for it. My questions are:
1. Can you paste something to the ceiling (I can put it there, but once you enter the map, it immediately falls down) [SOLVED]
2. How do levers work (I need levers to activate certain events/unlock a door) [SOLVED]
3. What is the code for activating script areas (I need the areas to be activated since they need to activate their event on the player's way back) [SOLVED]
4. How does the StartPlayerLookAt work? (I need to make the player look at a monster) [SOLVED]
5. How do I make a monster ignore the player (the monster needs to follow its path, with the player only a few meters away) [SOLVED]

Please help Smile I'll be done afterwards... (well almost, I can do the final part myself... I think... >.> )

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-15-2011, 12:01 AM by Karai16.)
05-14-2011, 06:28 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: Finishing it off

1. Go to the entity's properties, and check the box that says "Static Physics".
2. http://www.frictionalgames.com/forum/thr...67004.html? A little about levers.
3. SetEntityActive("ScriptArea_1", true);

5. SetEnemyDisableTriggers(string& asName, bool abX);

05-14-2011, 06:50 PM
Find
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#3
RE: Finishing it off

(05-14-2011, 06:50 PM)Kyle Wrote: 1. Go to the entity's properties, and check the box that says "Static Physics".
2. http://www.frictionalgames.com/forum/thr...67004.html? A little about levers.
3. SetEntityActive("ScriptArea_1", true);

5. SetEnemyDisableTriggers(string& asName, bool abX);

I almost get all of it, but I still don't get the levers Sad

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
05-14-2011, 07:18 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#4
RE: Finishing it off

Here is an example map I made for how levers work.

You can rip the script apart and figure out how it all works.

http://www.megaupload.com/?d=IXUUH1K3

05-14-2011, 07:22 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#5
RE: Finishing it off

4. A startplayerlookat defines:
a. the entity or area looked at
b. the acceleration of the looking movement
c. the maximum speed of the looking movement

The player will continously look at the object until a StopPlayerLookat is called - which could be set off by a timer.

2. That is for a lever combo tutorial.
If you only want to pull 1 lever it is quite easy.
Then you simply use "Alstate" in the execution script.

If this is what you are looking for I can give you example scripts Smile

GL

[Image: mZiYnxe.png]


05-14-2011, 07:24 PM
Find
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#6
RE: Finishing it off

(05-14-2011, 07:24 PM)Acies Wrote: 4. A startplayerlookat defines:
a. the entity or area looked at
b. the acceleration of the looking movement
c. the maximum speed of the looking movement

The player will continously look at the object until a StopPlayerLookat is called - which could be set off by a timer.

2. That is for a lever combo tutorial.
If you only want to pull 1 lever it is quite easy.
Then you simply use "Alstate" in the execution script.

If this is what you are looking for I can give you example scripts Smile

GL

Can you give me an example of a look at script including timer? and can you explain what the numbers and things in the timer do? Smile
(05-14-2011, 06:50 PM)Kyle Wrote: 1. Go to the entity's properties, and check the box that says "Static Physics".
2. http://www.frictionalgames.com/forum/thr...67004.html? A little about levers.
3. SetEntityActive("ScriptArea_1", true);

5. SetEnemyDisableTriggers(string& asName, bool abX);

I tried using your script for the levers. I don't get an error, but it's just that the levers don't get stuck, and they don't activate the event I told them to activate... Sad
Here is the code for the second lever
void L2(string &in asEntity, int alState)
{
    if (alState == 1)
    {
        if(GetLocalVarInt("Lev") == 2)
        {
            SetLocalVarInt("Lev", 3);
            SetEntityInteractionDisabled("lever_2", true);
            SetLeverStuckState("lever_2", 1, true);
            SetSwingDoorLocked("KeyStudyDoor", true, false);
            return;
        }
        else if (GetLocalVarInt("Lev") != 2)
        {
            SetLocalVarInt("Lev", 1);
            for (int i = 1; i > 0 && i < 5; i++)
            {
                SetEntityInteractionDisabled("lever_"+i, false);
            }
            for (int x = 1; x > 0 && x < 5; x++)
            {
                SetLeverInteractionDisablesStuck("lever_"+x, true);
            }
            return;
        }
    }
}

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-14-2011, 09:18 PM by Karai16.)
05-14-2011, 08:53 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#7
RE: Finishing it off

It should be:

OnStart()
{
     SetEntityConnectionStateChangeCallback("LeverName", "LevFunc");
}
void LevFunc(string &in asEntity, int alState)
{
     if (alState == 1)
     {
          SetSwingDoorLocked("DoorName", false, true);
          SetLeverStuckState("LeverName", 1, true);
     }
}

(This post was last modified: 05-14-2011, 09:29 PM by Kyle.)
05-14-2011, 09:27 PM
Find
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#8
RE: Finishing it off

Thank you so much, the levers are working Smile

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
05-14-2011, 09:46 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#9
RE: Finishing it off

From the scripts recollection thread:

StartPlayerLookAt(ScriptArea, viewacceleration, maxviewvelocity, onlook);
ScriptArea is the name of the area script you place in your map and where the player looks.
viewacceleration controls how fast the player looks.
maxviewvelocity controls the max speed the player looks.
onlook is a function you call when the player's view is centered on the target.
To stop the player from looking at a spot, call StopPlayerLookAt();
Example:
void TimerDoneLookAt(string &in asTimer)
{
  StopPlayerLookAt();
}

//When player starts the level, make him look at this spot.
void OnStart()
{
  // Function argument is empty since we don't want to call a function.
  StartPlayerLookAt("AreaLookAt", 2, 2, "");

  //Make the player look for 2.5 seconds
  AddTimer("donelook", 2.5f, "TimerDoneLookAt");
}
05-14-2011, 09:59 PM
Find
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#10
RE: Finishing it off

(05-14-2011, 09:59 PM)Roenlond Wrote: From the scripts recollection thread:

StartPlayerLookAt(ScriptArea, viewacceleration, maxviewvelocity, onlook);
ScriptArea is the name of the area script you place in your map and where the player looks.
viewacceleration controls how fast the player looks.
maxviewvelocity controls the max speed the player looks.
onlook is a function you call when the player's view is centered on the target.
To stop the player from looking at a spot, call StopPlayerLookAt();

void TimerDoneLookAt(string &in asTimer)
{
  StopPlayerLookAt();
}

//When player starts the level, make him look at this spot.
void OnStart()
{
  // Function argument is empty since we don't want to call a function.
  StartPlayerLookAt("AreaLookAt", 2, 2, "");

  //Make the player look for 2.5 seconds
  AddTimer("donelook", 2.5f, "TimerDoneLookAt");
}
Thanks, going to try and see if it works Smile
------
EDIT: it works! thank y'all a bunch! Maybe I can get my map done tonight!

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-14-2011, 10:42 PM by Karai16.)
05-14-2011, 10:25 PM
Find




Users browsing this thread: 2 Guest(s)