Frictional Games Forum (read-only)

Full Version: Finishing it off [SOLVED] THE STORY'S OUT!!!!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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... >.> )
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)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
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
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
(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
Code:
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;
        }
    }
}
It should be:

Code:
OnStart()
{
     SetEntityConnectionStateChangeCallback("LeverName", "LevFunc");
}
void LevFunc(string &in asEntity, int alState)
{
     if (alState == 1)
     {
          SetSwingDoorLocked("DoorName", false, true);
          SetLeverStuckState("LeverName", 1, true);
     }
}
Thank you so much, the levers are working Smile
From the scripts recollection thread:

Code:
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:
Code:
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)Roenlond Wrote: [ -> ]From the scripts recollection thread:

Code:
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!