Please or Register to create posts and topics.

Instances and random spawns

PreviousPage 2 of 2

I haven't fully analyzed the how Source scripting works, so I will ask for help once more.

If you look to the map again [attachment], I added a new parameter for the shuffle W - Wall/dead end. These dead ends will be different from each other and 3 of them will be objective dead ends. Lets say there are buttons in those dead ends, to complete the map, a player has to activate them.

Now to scripting, I need an extra script for the "dead end" shuffle as there are 4 different angles for them, meaning the basic shuffle wouldn't work for them if I wanted to shuffle them all as some would be facing the wrong direction. From what I read, I need GetAngles and SetAngles (or just SetAngles if I play around with its names). I think there are few ways around this, but don't know which is the best course of action.

Map concapt: S - Start, R - room, H - hallway, W - dead end.

You could do that using just entities. Put the button wherever you want. Then at each dead-end put another copy of the button where you want it to appear. Change the classname to point_template, and it'll be positioned correctly for you. Put the name of the real button in all the teleports. Then make a logic_case, and for each teleport add a different case output to trigger the Telepor input. Then just send the logic_case a PickRandom input onMapSpawn.

My stuff:
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]
TeamSpen210 wrote:
You could do that using just entities. Put the button wherever you want. Then at each dead-end put another copy of the button where you want it to appear. Change the classname to point_template, and it'll be positioned correctly for you. Put the name of the real button in all the teleports. Then make a logic_case, and for each teleport add a different case output to trigger the Telepor input. Then just send the logic_case a PickRandom input onMapSpawn.

The thing is, I want some of the dead-ends to be more detailed, some would have specific mechanics (like 2 dead-ends are connected by linked portals) and one of the dead-ends is the actual exit (find the 2 switches and the exit). Plus logic_case only has 16 spaces and there is 23 dead-ends.

While looking and playing around with the scripts, I think it is possible to do it with scripts, but encountering errors and don't fully know what is the problem.

You are correct about GetAngles and SetAngles. These two functions are for retrieving and setting the angles of an object, respectively.

GetAngles returns a vector (just like GetOrigin) that contains the pitch, yaw and roll components.
SetAngles is a little bit different: it expects three parameters, one for each of the pitch, yaw and roll components.

For example, you can transfer the orientation of one entity to another like so:

Code: Select all
local angles = first_entity.GetAngles()
second_entity.SetAngles(angles.x, angles.y, angles.z)

I have updated my script to also look at the orientation of each entity, and maintain those orientations for each position, after swapping the entities. If you don't feel like messing around with GetAngles and SetAngles yourself, then feel free to use this script.

Spoiler
Sorry, only logged-in users can see spoilers.

shuffle_ents V2 Change notes

Spoiler
Sorry, only logged-in users can see spoilers.

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

Well most of my is map is complete and now I started to tweak with the script you gaved me.
Though I keep getting this error:

AN ERROR HAS OCCURED [the index 'GetName' does not exist]

CALLSTACK
*FUNCTION [shuffle()] shuffle_ents.nut line [60]
*FUNCTION [main()] InputRunScript line [1]

The script doesn't pick up the names, from what I understand and changing names doesn't fully work. Could this be that it doesn't fully pick up instances names (which is probably the case), because well... they just become the world.

Edit: This is becoming a major problem, didn't expected to run into this wall. Is there even a possibility to move instances? point_template doesn't work on it, output SetParent as well.
A painful procedure I see is to make everything to a brush so that it would have names and than move it around, but that may cause some lighting issues as brushes aren't keen on having good lighting.

Any suggestions anyone?

This problem really bursted my bubble as basically I have to throw the instance idea to the trash bin (more or less) and have to find different alternatives.

What I have tried:
Tried making everything movable in the instance, making world brushes to func_brushes and changing some props. The script than started to work, but the lighting is quite horrible (especially as func_brushes lighting likes to turn 90 degrees for some reason).
Other solution was using Propper, making the rooms world brushes to a prop. The lighting is a lot different from making it into a func_brush, but it hardly catches any, it is just plain lighting. Though that what I expected after turning it into a prop...

Would be nice to hear some extra suggestions from other mappers.

PreviousPage 2 of 2