Hey, title has the bulk of the question.
What I'm trying to do is make an elevator that starts at a certain floor at map start, then randomly chooses a floor from the stops available and operates autonomously.
The only part I need help with is the randomization part. I think I would use a func_logic, but I don't know where to go from there.
Thanks.
Assuming you used [url=http://developer.valvesoftware.com/wiki/Multi-stop_elevators]this tutorial[/url] for your elevator, just find an entity to change the CompareValue of the Logic_Compare entity at a regular interval or however you want to set it up.
I don't know what entity that'd be, I'm not that familiar with logical entities in Source, but it shouldn't be difficult.
Thanks, does anyone have any idea what that entity may be?
Make a laser that has 5 targets (assuming you have 5 floors).
Give all the targets the same name.
Put a sheet of glass in front of each laser.
Make the glass have a short respawn time, and target the respective floor on break.
[QUOTE=Don Punch;28584734]Make a laser that has 5 targets (assuming you have 5 floors).
Give all the targets the same name.
Put a sheet of glass in front of each laser.
Make the glass have a short respawn time, and target the respective floor on break.[/QUOTE]
I'm sorry, I may not know how to do this, but that just sounds retarded.
[QUOTE=Don Punch;28584734]Make a laser that has 5 targets (assuming you have 5 floors).
Give all the targets the same name.
Put a sheet of glass in front of each laser.
Make the glass have a short respawn time, and target the respective floor on break.[/QUOTE]
that's one of the worst ideas i have ever heard.
[QUOTE=Framperton;28584590]Thanks, does anyone have any idea what that entity may be?[/QUOTE]
There has to be an entity that outputs a random number within a range. Just set it to be activated at a timed interval or activated when a button is pressed.
Use a logic_case ([url]http://developer.valvesoftware.com/wiki/Logic_case[/url]), add each floor to a case, and input PickRandom from whatever you are using.
[QUOTE=Framperton;28584798]I'm sorry, I may not know how to do this, but that just sounds retarded.[/QUOTE]
Hey, thats how we had to do it in goldsource. Never had a need to have a random number generator in source.
If it's an elevator, use a func_movelinear to save on entities
[QUOTE=Don Punch;28611938]Hey, thats how we had to do it in goldsource. Never had a need to have a random number generator in source.[/QUOTE]
And a logic_case is what is used in source.
OK, so here is what I have:
I chose to use a func_tracktrain named elevator test
I've got 5 floors, so 5 path_tracks named path_track_01 through path_track_05
and I have the logic_case named floorrandomizer.
I have all the names for the path_tracks listed as cases, with the input from the func_tracktrain of:
onstart -> floorrandomizer -> pickrandom.
Also, on a related note is there a way around the odd shadows cast on the elevator if it emerges from an area with different lighting than that it is entering?
Is this is the correct way its supposed to be set up?
I currently have it on top of a button that each time it is pressed, the elevator goes up one floor.
This was just a test, the button serving as a generator that would turn the elevator on before the logic_case took over and started sending it to random floors.
would it look like this?:
logic_case, loaded with path_track names starts disabled
On button pressed, logic_case is enabled and starts sending the elevator to random floors?
So... Is this correct?
Well, how about you try that set-up and see if it works?
Oh, and to fix your light problem. Turn the elevator into a model.
So what would be a good model converter for a brush based elevator?
propper?
[editline]17th March 2011[/editline]
When I try to compile the propper model I get this:
** Executing...
** Command: propper.exe
** Parameters: -game "c:\program files (x86)\steam\steamapps\flashgit89\half-life 2 deathmatch\hl2mp" "c:\program files (x86)\steam\steamapps\flashgit89\sourcesdk\bin\orangebox\bin\128x128elevator
"
Propper 0.24 by crazycarl. Adapted from vbsp.exe by Valve Software. (Oct 25 2010)
8 threads
materialPath: c:\program files (x86)\steam\steamapps\flashgit89\half-life 2 deathmatch\hl2mp\materials
Error opening c:\program files (x86)\steam\steamapps\flashgit89\sourcesdk\bin\orangebox\bin\128x128elevator
.vmf: File c:\program files (x86)\steam\steamapps\flashgit89\sourcesdk\bin\orangebox\bin\128x128elevator
.vmf, line 1: Invalid argument.
I'm following the installation and execution instructions to the letter, and its still messing up. The crazycarl link is dead, and I'm using version .24 from the valve wiki.
Any help?
[editline]17th March 2011[/editline]
[QUOTE=SweetSwifter;28651752]Well, how about you try that set-up and see if it works?
Oh, and to fix your light problem. Turn the elevator into a model.[/QUOTE]
Didn't work :(
There is no way to have the logic_case start disabled.
I currently have the cases loaded in, and whatever case it chooses, it is supposed to send it forward.
I don't think I have a proper way to initialize the randomization.
Anyone have a solution for this? Beuler?
Don't double post, there are [editline] tags for a reason.
Yeah, Thought it was going to mere with my main post.
Do you have anything useful to add?
What did you do for the command line in expert compile for propper?
It's actually pretty simple to do this. You set your func_tracktrain to a path_track and have that path_track fire to a logic_case with the input PickRandomShuffle. The logic_case should have two outputs:
OnCase01 > "your func_tracktrain" > Stop
Oncase02 > "your func_tracktrain" StartForward
Your elevator will cause each path_track to fire the output each time, when OnCase02 is chosen then the elevator will not stop. When OnCase01 is chosen the elevator will stop.
[QUOTE=Firegod522;28671851]What did you do for the command line in expert compile for propper?[/QUOTE]
My parameter is:
-game $gamedir $path\$file
and my command is propper.exe
so the Compile/run command is effectively: propper.exe -game $gamedir $path\$file
[editline]18th March 2011[/editline]
OH BUT WAIT! If you set all three as cases for path_tracks then it would work, right? RIGHT?!
[QUOTE=Monomiro;28671883]It's actually pretty simple to do this. You set your func_tracktrain to a path_track and have that path_track fire to a logic_case with the input PickRandomShuffle. The logic_case should have two outputs:
OnCase01 > "your func_tracktrain" > Stop
Oncase02 > "your func_tracktrain" StartForward
Your elevator will cause each path_track to fire the output each time, when OnCase02 is chosen then the elevator will not stop. When OnCase01 is chosen the elevator will stop.[/QUOTE]
Well that would still cause a problem when the tracktrain got to the top, as the only options would be
Oncase02> StartForward
and
Oncase02> StartBackward
Causing it to bounce back and forth between the highest and second highest floors, right?
That's a good point, I think the StartBackward output will tell it to go through the path_tracks in reverse order. I assume it would fire those outputs again which could result in the path_track going straight back up after leaving the top floor. I'll edit a better method into the post in a second.
EDIT:
Alright, for the top path_track you'd fire an input telling it to go backwards and for the logic_case rather than telling it to send a StartForward input, tell it to send a Resume input, and keep the other output (Stop) the same. Rather than moving in a specific direction the train will move in whatever direction it was moving before it stopped.
No the StartBackward output will only bring it to the next node where it will await instruction.
Anyway, if you add the stop, backwards and forwards to all stops except the top and bottom stops, would that work?
Nope, it didn't.
[QUOTE=Framperton;28672458]No the StartBackward output will only bring it to the next node where it will await instruction.
Anyway, if you add the stop, backwards and forwards to all stops except the top and bottom stops, would that work?[/QUOTE]
Read my above post. Are you sure the startbackwards input makes the train stop at the next track?
Not entirely sure.
I'll give it a try, although this method removes some of the randomness to the tracktrain's movement, since the only real deciders of direction would be the bottom and top ones, and that no matter what floor it stops at it will still go in the same direction.
I'll check it out.
No, the method you suggested didn't work, unless I set it up improperly.
It doesn't move now. Also, Wouldn't each stop be a problem for it? What would get it moving again?
Try this:
[url]http://dl.dropbox.com/u/11013411/lift_example.vmf[/url]
Compile it and see if that is what you are after ( May take a little while for the randomisation to kick in, can be adjusted if you play with the timings).
It's far from perfect but it gets the principle across. Study it! There's not a lot to it to be fair, but I'll explain below briefly.
What I do is every time something passes a point on the path_track, I trigger a relay which tells the train to stop and then resume in a few seconds. By toggling those relays between an enabled and disabled state (done in my logic_case) and triggering the toggle outputs in a random time span (using a logic timer) then the train will stop randomly along the line (However again, I haven't taken the time to align everything perfectly - something I put together in a few minutes and I'm sure there is a better way of doing it).
Hope this helps!!!
Sorry, you need to Log In to post a reply to this thread.