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 Modify Room on Script Area?
Mipz Offline
Junior Member

Posts: 3
Threads: 2
Joined: May 2014
Reputation: 0
#1
Modify Room on Script Area?

Firstly, I'm new to the editor so maybe I'm overlooking one of the uses of the functions listed in the library.

What I want to happen:
When a player enters the script area, a room somewhere on the map is essentially "swapped" out with a different room. That way when they go back to the original room, they realize that it's actually completely different.Here's a graphical example if I'm not clear.

My proposed ideas:
Option one:
Create two rooms, make one active and the other inactive. Stack them on top of each other. When the player hits the script area, make the active become inactive and the inactive become active. This also requires making the walls entities somehow (no idea how :[), and is generally a LOT of work.

Option two:
Create Player Start areas inside of a doorframe, have the player teleport to the new start area when he enters the script area. Again, here's a diagram if I'm unclear. The problem with this method is that I'm worried it'll give the player a slight flicker as it alters his position.
05-09-2014, 05:43 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Modify Room on Script Area?

Use option 2! Smile It saves you from having to create walls which can be made visible/invisible.

PHP Code: (Select All)
void TeleportPlayer(stringasStartPosName); 
Instantly teleports the player to the target StartPos.

IIRC, if you put the PlayerStart box not necessarily in the floor, but slightly above and within the script area, the player won't easily notice. FlawlessHappiness did this very well in our Many Hands project. I have never done it before myself, but he should be able to provide a really good insight. While I'm certain he'll come across this thread when he is online next (should be within the next few hours), feel free to drop him a personal message. I think he would be more than happy to help!

An alternate sequence you could do is perhaps make the screen fade out for an event, then when the player comes to, they may look like they are within the same environment, but is actually in the new area Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 05-09-2014, 07:22 AM by Romulator.)
05-09-2014, 07:20 AM
Find
Mipz Offline
Junior Member

Posts: 3
Threads: 2
Joined: May 2014
Reputation: 0
#3
RE: Modify Room on Script Area?

(05-09-2014, 07:20 AM)Romulator Wrote: Use option 2! Smile It saves you from having to create walls which can be made visible/invisible.

PHP Code: (Select All)
void TeleportPlayer(stringasStartPosName); 
Instantly teleports the player to the target StartPos.

IIRC, if you put the PlayerStart box not necessarily in the floor, but slightly above and within the script area, the player won't easily notice. FlawlessHappiness did this very well in our Many Hands project. I have never done it before myself, but he should be able to provide a really good insight. While I'm certain he'll come across this thread when he is online next (should be within the next few hours), feel free to drop him a personal message. I think he would be more than happy to help!

An alternate sequence you could do is perhaps make the screen fade out for an event, then when the player comes to, they may look like they are within the same environment, but is actually in the new area Smile

I'd be interested in knowing how he handled option two. Currently I have a camera shake event, but it the way the player changes direction is quite noticeable. I wonder if there's a way to preserve direction?

Either way, hopefully I'll hear from him!
Thanks!
05-09-2014, 07:28 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Modify Room on Script Area?

The small blue arrow in the PlayerStartArea should be the direction the player will be facing, but when teleporting, this could be interupted.

Is the room you want to change very drastic? It is possible to use Option 1. If you can get past all the work it takes to do it, it will probably give you a smoother result. If there's a lot to change, I don't recommend it, but if it's something minor (or relatively minor), then I could see myself using it.

Making static walls into entities is very simple. Open the Model Editor and impore the mesh for it, then add a collision box with 0 mass over the whole thing and export as type Object, subtype Static in User Defined Variables.

(This post was last modified: 05-09-2014, 09:19 AM by Mudbill.)
05-09-2014, 09:19 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Modify Room on Script Area?

Option 1 is very simple and not hard to do!

I've done it before. Want a video about it?
https://www.youtube.com/watch?v=TZWmo5avrUg

Copy the wall model into a new folder.
Copy a random ent-file into that folder.
Edit the ent to make it open the wall file.
Open the wall file in the model-editor.
Give it the correct boxes.
Save it.
Remember to rename it into something else.
?????????
Profit

Trying is the first step to success.
05-09-2014, 10:02 AM
Find




Users browsing this thread: 3 Guest(s)