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 Moving Walls
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#1
Moving Walls

Idea is to move two walls upward after pressing a button, then have them close after the player moves past them. A secret passage, if you will.

I tried using propimpulse, just to see if it would work, but it didn't. I've seen people move walls upward watching custom stories, but I've watched so many I don't remember which custom stories this kind of thing was in.

I can't find this anywhere on the forum. Any help would be seriously appreciated!

03-01-2014, 06:24 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Moving Walls

The entity file has to be changed to a MoveObject in the model editor. Then there's a script to have it move, but I can't remember it off the top of my head... I'm sure someone can fill for that part.
03-01-2014, 08:43 AM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#3
RE: Moving Walls

(03-01-2014, 08:43 AM)Statyk Wrote: The entity file has to be changed to a MoveObject in the model editor. Then there's a script to have it move, but I can't remember it off the top of my head... I'm sure someone can fill for that part.

I haven't touched Model Editor once. But trying to load walls into the model editor doesn't seem to be possible. It doesn't show up when trying to open, and opening it by other means causes the editor to crash after it says it can't find other folders.

03-01-2014, 10:01 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: Moving Walls

SetEntityConnectionStateChangeCallback("YOURLEVER", "StartMovingtheSecretDoor");//This is for a Lever
SetEntityPlayerInteractCallback("YOURBUTTON", "StartMovingtheSecretDoor", true);// This is for a Button
Spoiler below!

Quote:---
Quote:void StartMovingtheSecretDoor(string &in asEntity)//This is for a Button
{
SetMoveObjectState("YOUR_SECRETWALL_1", 1.0f);
SetMoveObjectState("YOUR_SECRETWALL_2", 1.0f);
SetEntityInteractionDisabled( "YOURBUTTON", true ); //This will set your Button so, that you can NOT interact with it anymore.
GiveSanityBoostSmall();
PlayGuiSound("quest_completed", 0.6f);//Adds a complete sound
}

void StartMovingtheSecretDoor(string &in asEntity, int alState) //This is for a Lever
{
if (alState == 1)
{
SetMoveObjectState("YOUR_SECRETWALL_1", 1.0f);
SetMoveObjectState("YOUR_SECRETWALL_2", 1.0f);
SetLeverStuckState("YOURLEVER", 1, true); //This will set your lever stuck
GiveSanityBoostSmall();
PlayGuiSound("quest_completed", 0.6f);//Adds a complete sound
}
}

-------
Then make a scriptarea called ClosePassage

AddEntityCollideCallback("Player", "ClosePassage", "Nowclosesecretpassage", true, 1);

Spoiler below!
Quote:void Nowclosesecretpassage(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("YOUR_SECRETWALL_1", 0);
SetMoveObjectState("YOUR_SECRETWALL_2", 0);
}


This is for a both Lever and Button.
Some times you need to put a .ogg behind the musicfile. Just a reminder.
Hope this helps.
(This post was last modified: 03-01-2014, 02:56 PM by DnALANGE.)
03-01-2014, 02:20 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: Moving Walls

When you use the Model Editor, you must use Import Mesh, not Open if you haven't made the entity for it yet. Open uses .ent, Import uses .dae.

Import the mesh, then add a collision box. Set the type to something like Object > Static in the Edit menu on User Defined Variables. Need clearer instructions?

(This post was last modified: 03-01-2014, 07:20 PM by Mudbill.)
03-01-2014, 07:20 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#6
RE: Moving Walls

(03-01-2014, 07:20 PM)Mudbill Wrote: When you use the Model Editor, you must use Import Mesh, not Open if you haven't made the entity for it yet. Open uses .ent, Import uses .dae.

Import the mesh, then add a collision box. Set the type to something like Object > Static in the Edit menu on User Defined Variables. Need clearer instructions?

The post is called : Script Help Moving Walls
-
With all the respect, but i''m not sure if the guy needs this { models }
Anyway, this is an extra feature for him to get his custom walls to work as well..
Good job Mud*
(This post was last modified: 03-01-2014, 07:29 PM by DnALANGE.)
03-01-2014, 07:28 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#7
RE: Moving Walls

Ah, yes of course. The type needs to be MoveObject.

I'm assuming he wants an existant wall model, like the mansion wall, to be possible to move upwards like a secret entrance. Firstly it must be an entity and not a static object, and this is how you'd make one; using the Model Editor.

03-01-2014, 08:20 PM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#8
RE: Moving Walls

(03-01-2014, 07:28 PM)DnALANGE Wrote:
(03-01-2014, 07:20 PM)Mudbill Wrote: When you use the Model Editor, you must use Import Mesh, not Open if you haven't made the entity for it yet. Open uses .ent, Import uses .dae.

Import the mesh, then add a collision box. Set the type to something like Object > Static in the Edit menu on User Defined Variables. Need clearer instructions?

The post is called : Script Help Moving Walls
-
With all the respect, but i''m not sure if the guy needs this { models }
Anyway, this is an extra feature for him to get his custom walls to work as well..
Good job Mud*

(03-01-2014, 08:20 PM)Mudbill Wrote: Ah, yes of course. The type needs to be MoveObject.

I'm assuming he wants an existant wall model, like the mansion wall, to be possible to move upwards like a secret entrance. Firstly it must be an entity and not a static object, and this is how you'd make one; using the Model Editor.

I'm a she. LMFAO.

Thanks guys. Big Grin

(This post was last modified: 03-02-2014, 12:12 AM by MsHannerBananer.)
03-02-2014, 12:11 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#9
RE: Moving Walls

Oh my, sorry about that xO

Good luck with your project though! :v

03-02-2014, 12:41 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#10
RE: Moving Walls

IS it solved?
Did you use one of our scipts?
Just curious..
Otherwise make it SOLVED!
03-02-2014, 03:01 AM
Find




Users browsing this thread: 1 Guest(s)