Welcome, Guest. Please login or register.

Author Topic: Sliding Puzzle  (Read 3795 times)

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Sliding Puzzle
« on: April 18, 2010, 02:25:30 PM »
After making my Sudoku puzzle (http://www.fpsbanana.com/prefabs/4620) I got the idea of making a sliding puzzle.

I haven't had much time to give it serious thought, but I was wondering if any of you had good ideas regarding how to go about moving a block to an empty space (whether its above, below, to the right or to the left of the block).

My idea would obviously involve logic_compares to check where an empty space is available but how to make the block move exactly to the empty spot is still a little fuzzy in my mind.

Any one have any good ideas?

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Re: Sliding Puzzle
« Reply #1 on: April 18, 2010, 02:40:58 PM »
point_teleport?

Jeez, don't even get me started on another entity system... I have real work to do here.

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: Sliding Puzzle
« Reply #2 on: April 18, 2010, 02:51:52 PM »
I want it to actually "slide"

Go ahead, you don't have to answer it. Someone else may have ideas.

Offline Absolute

  • Full Member
  • ***
  • Posts: 274
  • 1+1=10
    • View Profile
Re: Sliding Puzzle
« Reply #3 on: April 18, 2010, 03:56:36 PM »
func_physbox + trigger_push ?

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: Sliding Puzzle
« Reply #4 on: April 18, 2010, 04:30:34 PM »
I did the same thing for a map I was working on, sort of like you want to do:

Basically it was a block placed 4 times in the same spot, with a button on each side (4 buttons, 1 for each direction), when a button was pushed, the other 3 blocks were "killed" and the corresponding block slid and fell into its place (func_tracktrain), choosing a jail. So maybe you could do something involving func_tracktrains and logic_compares?

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: Sliding Puzzle
« Reply #5 on: April 18, 2010, 06:12:17 PM »
Yeah I was considering func_tracktrains

Offline FAJ

  • Flying Badger Man
  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,925
  • GAJ
    • View Profile
    • NY-Surf
Re: Sliding Puzzle
« Reply #6 on: April 19, 2010, 11:55:53 AM »
I dont know about the 'checking' system to make sure the block is allowed to move. But to have actual moving blocks, I would try having 4 movelinears (one for up, down, left and right). Set the block that you want to move as having the parent of the appropriate movelinear, open that mover, remove the parent, then close the mover.

Essentially parenting the block to its direction movelinear, then unparenting it, after the move.

This system seems like a whole lot of work for not that much pay-off. Some things are just not worthwhile in CS. Why bother? XD

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: Sliding Puzzle
« Reply #7 on: April 19, 2010, 12:14:03 PM »
I dont know about the 'checking' system to make sure the block is allowed to move. But to have actual moving blocks, I would try having 4 movelinears (one for up, down, left and right). Set the block that you want to move as having the parent of the appropriate movelinear, open that mover, remove the parent, then close the mover.

Essentially parenting the block to its direction movelinear, then unparenting it, after the move.

This system seems like a whole lot of work for not that much pay-off. Some things are just not worthwhile in CS. Why bother? XD
I agree, especially since 99% of the people who use it will have no idea what kind of work went into it, nor will they care about or appreciate it.

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: Sliding Puzzle
« Reply #8 on: April 19, 2010, 12:20:42 PM »
Oh sometimes I like to do things (if I get a crazy idea) to see if I can do it... just for the hell of it. Of course this only happens when I have a lot of extra time on my hands (between semesters etc) which doesn't happen often, but if it does happen I like to fuck around with hammer.

Besides this sort of stuff doesn't take up a lot of time. The extremely useless sudoku that I made when I had some extra time, took 2 evenings after work.

And that's a very interesting idea FAJ, didn't even consider anything like that.

Offline FAJ

  • Flying Badger Man
  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,925
  • GAJ
    • View Profile
    • NY-Surf
Re: Sliding Puzzle
« Reply #9 on: April 19, 2010, 12:36:38 PM »
I applaude experimenation in hammer. But I really wish that when mappers had extra time on their hands, and want to dick around in hammer, that they would work on surf gameplay!

I think there is a serious lack of creativity in surfing goings on, and all the clever mappers are busy making little doodads and dicking around XD

Offline Rapsodia

  • Sr. Member
  • ****
  • Posts: 545
    • View Profile
Re: Sliding Puzzle
« Reply #10 on: April 19, 2010, 10:45:36 PM »
With trigger_multiple, func_buttons, logic_branches, point_template, path_trains and func_tracktrains i think you could do it.

There are a 4x4 table for example. Each space with trigger_multiples and logic branches with the main value ( 0 = False ), excepting 1, the only space available.


First of all, the trigger multiple have to have selected the Flag "Everything". We will name it as trigger0, trigger1, trigger2...
Our triggers will have this output.
For trigger0:
      *Ontouching---->branch0---->set value---->0

For trigger1:
      *Ontouching---->branch1---->set value---->0

Etc...
You have in the empty square 1 point_template that will ForceSpawn two path_trains (path0 and path1, Origin and End), and 1 logic_branch (branch1) in True.

Now, you have your func_tracktrain, with origin in another path_train (path0) and it will go to path1 when you press the button E (Onpressed).

You touch the first square that you want to slide, it only can move to 1 direction.
    *OnPressed---->Logic_Branch1---->Test

Logic_branch1:
     *OnTrue---->func_tracktrain---->Move ( I don't remember the name of the action xD)
    
The func_tracktrain is starting to move, and it is leaving the first trigger_multiple (trigger0),making the branch0 True, and it is touching the second triger_multiple (trigger1), making the branch1 False.

With trigger_multiples you can spawn and kill the point_templates, which the will spawn the path_trains (Origin and End), which they have all the same name.

I really dont know if this will work, is fucking hard for me to try to explain this in english...i just want to show you what i want to do, and i hope you can understand it or just make and idea of what i am trying to do.

I will try this in hammer to see if it works. At least, i have tried it xD.

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: Sliding Puzzle
« Reply #11 on: April 20, 2010, 12:27:39 AM »
Yes I understand what you are trying to say don't worry.

Spawning and removing func_trains is an interesting idea that I have not considered. However I think spawning and removing may cause some problems with killing the parented blocks along with the train. I also like the move linear Idea a lot.

I guess experimentation will show which method is superior.

Great ideas, keep them coming \

Offline Exither.

  • Modders
  • Full Member
  • *
  • Posts: 385
    • View Profile
Re: Sliding Puzzle
« Reply #12 on: April 21, 2010, 01:31:31 PM »
sorry havent read everything so I dont know if someone said this already.

maybe you try something with "set parent"?

always a train for 1 slide (need uch trains xD)

the only problem is that this is inly possible one way (im right?)

yeah hope I could help you a bit xD

good luck with this \

Offline bravesurf

  • Sr. Member
  • ****
  • Posts: 484
  • Yarly!
    • View Profile
Re: Sliding Puzzle
« Reply #13 on: April 26, 2010, 07:09:42 PM »
i made one long time ago, but then i just shot the frames around :p
would probably be easier to make than that sudoku thing..

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: Sliding Puzzle
« Reply #14 on: April 26, 2010, 07:45:31 PM »
Oh cool, do you still have it?

Idk, the sudoku minigame didn't require many entities. Only thing it really required is entities to store the correct numbers, a logic compare and an entitiy to change the number on the brushes.

Offline bravesurf

  • Sr. Member
  • ****
  • Posts: 484
  • Yarly!
    • View Profile
Re: Sliding Puzzle
« Reply #15 on: April 27, 2010, 11:27:03 PM »
Oh cool, do you still have it?

Idk, the sudoku minigame didn't require many entities. Only thing it really required is entities to store the correct numbers, a logic compare and an entitiy to change the number on the brushes.
I do, but Steam decided to delete css and source sdk along with automatically update to the new UI. Awesomeness = nowhere to be found these days.
I'll upload the vmf when i get back in Hammer. I just used triggers with OnStartTouch and OnEndTouch adding and removing from a math_counter. Gave the triggers namefilters, and named the "slides" accordingly. It worked, but it took a shitload of bullets to get them all into the right place :p Would be a lot smoother with paths. I also tried with func_physbox and trigger_push but the push was too uncontrolable. the slides bounced together and eventually got stuck.

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: Sliding Puzzle
« Reply #16 on: April 28, 2010, 12:14:09 AM »
Oh haha, that doens't sound too stable lol