Calculating with instance variables?

Avatar
262LetsPlay
51 Posts
Posted May 25, 2012
I have the path_track entity "@mesys_elevator_path_$floor" "$floor" is a variable. Now I weant to do as next stop target this variable +1. I thought about something like that: "@mesys_elevator_path_($floor)+1". Does this one work or does that work at all?
Advertisement
Registered users don’t see ads! Register now!
Avatar
Lpfreaky90
2,842 Posts
Posted May 25, 2012
Replied 1 hour later
I'm afraid this won't work.
What you could do is use a math_counter and a logic_case.
Use the number of the math_counter to trigger that case, and add a corresponding path track to that case :smile:
Avatar
262LetsPlay
51 Posts
Posted May 25, 2012
Replied 6 minutes later
This should be an extenable elevator system, you put those instances on top of each other and say them which floor they should be. The path connction betwenn the instances and the communication were supposed to be automatic than, but I will just add another variable, which has to be defined as ($floor)+1. I think mappers can add 1 to another number :biggrin:
Avatar
Lpfreaky90
2,842 Posts
Posted May 25, 2012
Replied 14 minutes later
I have no idea what you are attempting to say:

Quote:
This should be an extendable elevator system, you put those instances on top of each other and say them which floor they should be. The path connection between the instances and the communication were supposed to be automatic than, but I will just add another variable, which has to be defined as ($floor)+1. I think mappers can add 1 to another number

okay, typo's fixed, but still no clue.
You want to place elevators on top of each other? so you can say to what floor they should go?

You can just use the PTI elevator or use a path_track with a move_to_pathnode input. What does your elevator do? I honestly don't get it.

Avatar
262LetsPlay
51 Posts
Posted May 26, 2012
Replied 11 hours later
I have 3 or more floors and want to connect them with an elevator, which works like an elevator in real life. In the instance for an elevator station are the outer doors, call buttons and the path_track. The Name of the path_track is "@mesys_elevator_path_$floor" The Next path_track should be "@mesys_elevator_path_($floor+1)", so the path_track from the next floor is picked automatically.
Example: $floor is 0. Than the path_track is named "@mesys_elevator_path_0". As a result from the calculation the Next Path Track should be: "@mesys_elevator_path_1" Got it now?
Avatar
Lpfreaky90
2,842 Posts
Posted May 26, 2012
Replied 4 minutes later
yes, got it now:

Much simpler solution add 3 buttons in your elevator, one for floor 1 one for 2 and one for 3. (much like a real elevator.

Floor one button:
OnPressed movetopathnode floor_1

floor two button:
OnPressed movetopathnode floor_2

Floor three button
OnPressed movetopathnode floor_3

Then you can have buttons on the exterior as well with exactly the same inputs.
That should be a lot easier!

Avatar
262LetsPlay
51 Posts
Posted May 26, 2012
Replied 5 minutes later
I am Talking about the keyvalue "Next Stop Target" from the entity "path_track". This has nothing to do with the elevator control. Even with your soloution I need a path, don't I?
Advertisement
Registered users don’t see ads! Register now!
Avatar
Lpfreaky90
2,842 Posts
Posted May 26, 2012
Replied 9 minutes later
Yes, you need to add 3 path_tracks, give them all a proper name and just use the movetopathnode input for your train. instead of next stop target.