Please or Register to create posts and topics.

How to make an Array?

Page 1 of 2Next

Hey there guys,

Is it possible to make an array call to specific outputs

e.g.
If Integer = 0, Then: Output 1
If Integer = 1, Then: Output 2
If Integer = 2, Then: Output 3

I've been playing around with logic_compare and math_counter. with counters working the best, the only problem is I have to have multiple counters and it would be so much easy if there was a function that did things like, If 'this' Then 'do that'.

Why do you need multiple math_counters? Can you explain in more detail precisely what you're trying to do?

The I/O system is pretty powerful, and I think using a math_counter and logic_compare would be the best way of making an "array". logic_compare is effectively "if value = X do this", you just have to setup each of those in it's Output.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

Basically I have a button,
Press it 1st time, a panel rotates 90degrees
Press it 2nd, the panel rotates back to original position
Press it 3rd, the panel rotates -90degrees
press it 4th, it rotates back to original and resets the pattern

Atm I'm using 1 math_counter to turn left, 1 to turn right 1 to turn centre.
I liked the idea of logic_compare but it only has equal to value, I guess if I change it's value constantly and compare value I could make it work.. I shall try this

edit: ok that won't work, it will still run the other outputs regardless as they are still equal to

Uh. Why don't you just have the math_counter add? Set the button to tell the math_counter to Add 1. Then have the math_counter use the "OutValue" Output to the logic_compare.

Read this if you haven't: math_counter at the VDC

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

Use logic_relays using each output on a separate relay (4 in total). Make the button trigger all the relays however have the last three disabled on start. On first press disable the first relay and enable the 2nd... second press disable second relay and enable third... etc.

That is how I would do it anyway, without too much confusion :)

?????????????????????????????TWP Releases | My Workshop
msleeper wrote:
Set the button to tell the math_counter to Add 1. Then have the math_counter use the "OutValue" Output to the logic_compare.

That would also work too xD

?????????????????????????????TWP Releases | My Workshop

That setup (with 4 separate logic_relays) is a lot more complicated than using a single logic_compare.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.
msleeper wrote:
That setup (with 4 separate logic_relays) is a lot more complicated than using a single logic_compare.

I didn't read your comment before posting. It is a better way, however my way is a completely different alternative.

Please keep in mind if you can't get the logic case to work ;)

?????????????????????????????TWP Releases | My Workshop

I experimented with the 4 separate logic_relay, it works, but when you introduce more than one panel to be rotated... it gets pretty complicated and confusing fast. I'll try math_counter Output now

For the love of god, don't use 4 logic_relays. :|

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.
Page 1 of 2Next