Mimic?

Avatar
SmashManiac
8 Posts
Posted May 30, 2009
I had an idea for a Portal map, but I wasn't sure if it the engine allowed it. So I installed the Source SDK and followed a couple of basic tutorials, and right now I don't even think I can achieve my idea without creating some crazy mod.

Here is the basic idea that I wanted to implement. At first glance it would look as if a mirror is present in the room, but the reflexion is slightly different, and switches activated in the reflexion of the mirror would open up doors on the other side. The trick would be to have a glass instead of a mirror with a 2nd Chell that would mimic everything the player does.

This idea sounded simple, but I stumbled on a lot of hurdles:
- I cannot find a Chell NPC entity. I could use a different NPC, but it would look awkward.
- Interaction between entities appear to be impossible beyond target recognition and preprogrammed events. What I need is to copy-paste some entities attributes values, and sometimes multiply them by -1.
- Even if I abandon the mirror idea and only use a mimic in an isolated room, I'm still unable to set the player as a parent. Even if I am allowed to do so, NPC entities do not seem to be able to go through portals.
- I have no idea how to make my 2nd set of portals appear where I want given the restrictions. I don't even think a 2nd portal gun can fire portals not linked to the player's generated portals.

Since I'm still not familiar with the development tools, can somebody confirm that it indeed impossible to overcome these hurdles without installing Visual Studio and having to create a relatively complex mod?

Advertisement
Registered users don’t see ads! Register now!
Avatar
penapappa
186 Posts
Posted May 30, 2009
Replied 20 minutes later
I would say that it's impossible, but hey, don't believe me.
Avatar
HMW
806 Posts
Posted May 30, 2009
Replied 7 hours later
That sounds pretty impossible. It would require extensive custom coding and unfortunately, the source code for the Portal client DLLs is not publicly available, like it is for other Source games. So even if you were familiar with Source engine coding, you can't make the necessary changes to Portal.
Avatar
SmashManiac
8 Posts
Posted May 30, 2009
Replied 3 hours later
So even a mod wouldn't work? That's kinda disappointing for something that would normally be so simple to program.

I guess that I have to completely remove the actor that would mimic the moves as a visual indicator, and forget about controlling a 2nd set of portals based on the position of the player's portals. :sad:

Mmmm... :idea:

Actually, I could still do it, but the feeling would be completely different. For example, if in my 1st room I put a door and a box, and behind the glass a button and a door, I think people would understand the concept.

Avatar
Stormrain
80 Posts
Posted May 30, 2009
Replied 9 hours later

I think there is a way to make NPC's go through portals, remember seeing a tutorial to make Gman walk though one, don't know how well it works though, never tried it.

http://www.youtube.com/watch?v=k6JUUOH9O78 shows that it is possible, and the uploader of the video credits this site for the info about it, I just can't figure out where. Hope that helps a bit.

Avatar
hanging_rope
435 Posts
Posted May 31, 2009
Replied 1 hour later

Stormrain wrote:
I think there is a way to make NPC's go through portals, remember seeing a tutorial to make Gman walk though one

It can only do prescripted things, so it will be the same every time.
There is no chell npc because she wasn't originally intended as an NPC.
I've also wanted to figure out if you can parent things to the player, so If anyone knows, can they answer please.

Avatar
HMW
806 Posts
Posted May 31, 2009
Replied 5 hours later

hanging_rope wrote:
I've also wanted to figure out if you can parent things to the player, so If anyone knows, can they answer please.

You can, but when the player looks up or down, the parented object doesn't go with it. (Perhaps you have to do SetParentAttachment as well, but I haven't tried that.)
Because you can't set a targetname on the player, you have to use a trigger that sends the objects to be attached a SetParent signal with !activator as the target. (!Activator being the player who just walked through the trigger.)

Avatar
SmashManiac
8 Posts
Posted May 31, 2009
Replied 12 hours later

HMW wrote:
Because you can't set a targetname on the player, you have to use a trigger that sends the objects to be attached a SetParent signal with !activator as the target. (!Activator being the player who just walked through the trigger.)

This could give interesting results! Thanks for the tip HMW! :biggrin:

Avatar
msleeper
4,136 Posts
Admin
Posted Jun 02, 2009
Replied 1 day later

SmashManiac wrote:
This idea sounded simple, but I stumbled on a lot of hurdles:
- I cannot find a Chell NPC entity. I could use a different NPC, but it would look awkward.
- Interaction between entities appear to be impossible beyond target recognition and preprogrammed events. What I need is to copy-paste some entities attributes values, and sometimes multiply them by -1.
- Even if I abandon the mirror idea and only use a mimic in an isolated room, I'm still unable to set the player as a parent. Even if I am allowed to do so, NPC entities do not seem to be able to go through portals.
- I have no idea how to make my 2nd set of portals appear where I want given the restrictions. I don't even think a 2nd portal gun can fire portals not linked to the player's generated portals.

There is no NPC for Chell. She exists only as a third person model for the player, that's it.

Explain more about what you mean/what you're trying to do. Maths are indeed possible but the more complicated you get the more entities are involved.

You can use !player as the targetname for various I/O to specify the player. There's a few more of these special targets but I won't go into them and confuse you. Also, NPCs don't go through portals. Check the wiki, there's a mega hack to make them do it but they kinda suck at it and freak out a little.

You can create pre-placed portals with multiple pairs, using the Pair ID in the prop_portal I believe. I don't think you can make the Portalgun create different paired portals.

Avatar
HMW
806 Posts
Posted Jun 02, 2009
Replied 10 hours later

msleeper wrote:
You can use !player as the targetname for various I/O to specify the player.

D'OH!! I totally forgot about that! Sorry :redface:
Here's the full list of special names, in case anyone is interested.

msleeper wrote:
You can create pre-placed portals with multiple pairs, using the Pair ID in the prop_portal I believe. I don't think you can make the Portalgun create different paired portals.

That's right. The portal gun always produces portals with ID 0.

Also, watch out for putting to many portals close together and/or able to see each other. This is a very effective frame rate killer.

Avatar
SmashManiac
8 Posts
Posted Jun 07, 2009
Replied 5 days later
Thanks for the list of special names!

Well here is my original idea in more mathematical details.

Basically I wanted 2 rooms side-by-side, with a sheet of glass on the Y axis, which would act as the axis of symmetry. So if the player places a blue portal at coordinates (5,2,1), a blue portal of ID 1 would appear at coordinates (-5, 2, 1). It would be the same for all entities, including the player, picked up boxes, etc. Puzzles would have revolved around the differences between the 2 rooms, and then would gradually become more complex.

Doing such a thing is probably impossible, but I was wondering how close I could get to this original idea.

Avatar
HMW
806 Posts
Posted Jun 08, 2009
Replied 18 hours later
That sounds pretty complicated, especially keeping all the props synchronised between both halves of the room. And I have no idea how it could be possible to make the alternate portals match up with the original ones.

Just out of curiosity: what would happen when the player carries a box into an area that is solid in the mirror image? (see drawing) Would it cause an anomaly in the fabric of space which would lead to the entire universe being sucked through a dime-sized hole?

(As per your description, the two rooms are NOT mirror images of each other :smile:

Avatar
SmashManiac
8 Posts
Posted Jun 10, 2009
Replied 2 days later
Very good point, I already considered the problem.

To avoid undesired desync issues, I was thinking of having collision and portal surfaces identical on both sides. To achieve that, there would be several invisible objects.

Avatar
HMW
806 Posts
Posted Jun 10, 2009
Replied 58 minutes later
Well, you could always keep both rooms the same and only change 'non-colliding' things, like the indicator lines.
Avatar
Siiig
98 Posts
Posted Jun 11, 2009
Replied 9 hours later

http://www.crazymonkeygames.com/Visible.html

Like that, right?

Advertisement
Registered users don’t see ads! Register now!
Avatar
SmashManiac
8 Posts
Posted Jun 22, 2009
Replied 11 days later
Exactly! :biggrin: