playMaker

Author Topic: Need some help with this elevator system... been stuck for 5 weeks!  (Read 5107 times)

Chaoss

  • Playmaker Newbie
  • *
  • Posts: 7
I've tried many, many, many different solutions but I always come up short and just can't seem to figure it out.

I'm trying to develop a simplified elevator system. There is a lobby with 4 'real' floors, but I want there to be an infinite number of theoretical floors. What really happens is the elevator loops through floors 3 and 4 (once the elevator reaches the 4th floor it will teleport back to the 3rd). I have a global variable that needs to increase each time the elevator reaches the next floor, and decrease when going down. When the elevator is stopped on a theoretical floor it stops and lets the player out on the 3rd floor (the 4th is an exact clone of the 3rd, so the user doesn't see the 'switch' when I teleport the elevator). However the player thinks they are on a much higher floor.

When the user stands inside a trigger zone (placed near the buttons) and presses Fire1 (left mouse button) they press the 'go up' button. If they stand in the same trigger and press Fire 2 they go down, unless they are on floor 1, in which case nothing happens except the doors closing. If the user presses either Fire1 or Fire2 while inside the trigger the elevator needs to stop on the next floor (whether going up or down). Floors 1 and 2 are different (a lobby) so those cannot be looped, and act as the base floors.

Please someone help me or give me some clues. I seem to be hopelessly stuck. Every solution I think I come up with falls through and doesn't work. I've asked on the Unity forums but people don't seem to know how to do it (I think most of them are artists or idea people)

FYI: I am using Playmaker

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #1 on: September 07, 2013, 01:56:00 AM »
Hi there, please see attached scene. The FSM should do exactly as you describe. You set the number of floors you want via the maxFloors variable (available in inspector) and you can travel up and down to that number looping through floors 3 and 4 to simulate a bigger building.

Left mouse button goes up, and right goes down. The floor you are currently on is displayed in a label at top left corner.

There's probably better ways you can do it, but this should get you on your way. Hope it helps :)

Screenshot of FSM:
« Last Edit: September 07, 2013, 05:51:57 AM by uberwolfe »

Chaoss

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #2 on: September 07, 2013, 08:50:32 AM »
Hi there, please see attached scene. The FSM should do exactly as you describe. You set the number of floors you want via the maxFloors variable (available in inspector) and you can travel up and down to that number looping through floors 3 and 4 to simulate a bigger building.

Left mouse button goes up, and right goes down. The floor you are currently on is displayed in a label at top left corner.

There's probably better ways you can do it, but this should get you on your way. Hope it helps :)

Screenshot of FSM:


Cheers, I'll have a go at implementing it a bit later today and get back to you later. :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #3 on: September 09, 2013, 01:38:56 AM »
Hi,

 Quick Note on sharing scenes:

Don't attach the .unity file, it's generally never working. Instead, do the following:

1: select the scene
2: go to the Unity Menu: Assets/Export Package
3: MAKE SURE you unselect the file "PlayMaker.dll" you are not allowed to redistribute this one file
4: Create a fresh project ( or a dummy one), and make sure that the package you created works. Sometimes you'll find that you need to manually add custom actions typically.
5: share the package.

Thanks

 Jean

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #4 on: September 09, 2013, 04:20:39 AM »
Ok... I will do that next time.

This scene works fine in any new project, all you have to do is import Playmaker.

I did test it before I made it available.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #5 on: September 09, 2013, 05:14:30 AM »
Hi,

 Yes, in some case it works :)

bye,

 Jean

Chaoss

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #6 on: September 10, 2013, 01:07:32 PM »
I've had absolutely NO luck with this unfortunately, I've been at it for a few more days and made no progress on getting it implemented. Here is my project so far (with the architecture removed and just the basics left in.

The elevator needs to keep doing unless the down or up button is pressed in which case it will stop on the required floor.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #7 on: September 10, 2013, 01:13:27 PM »
Looks like you are using some global variables since there are more than a few errors from missing fields.

PlayMaker>Tools>Export Globals
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Chaoss

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #8 on: September 10, 2013, 03:41:48 PM »
Looks like you are using some global variables since there are more than a few errors from missing fields.

PlayMaker>Tools>Export Globals

http://www.sendspace.com/file/tx79e1

Chaoss

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #9 on: September 11, 2013, 01:06:32 PM »
BUMP

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need some help with this elevator system... been stuck for 5 weeks!
« Reply #10 on: September 13, 2013, 03:14:32 AM »
Hi,

 ok, let's sort this. Could you draft a proper consise description of how the lift should behave? I'll then make a working sample.

bye,

 Jean