Please or Register to create posts and topics.

Mathcounters Can't count?

I got multiple trigger attached to a mathcounter

there is enabling and disabling involved to prevent them from getting triggered when i don't need them to be, but when they are enabled, the mathcounter activates when only a single trigger is hit rather than the allocated number of triggers needed.

DAFUQ?!

Just when I think I understand the system, it changes on me.

You must minus from the math_counter once you 'endTouch' it otherwise it will not minus from the counter(I assume you have a number of triggers which add to the counter and OnHitMax the counter does the event).

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

i actually did that, still effing up. Im just gonna replace the triggers with hidden floor buttons, see if that effects it.

You would not beleive how many times i have had to redo an entire concept due to lack of forsight on how all this is works. This map is gonna be pretty huge

Just when I think I understand the system, it changes on me.
Fracture wrote:
i actually did that, still effing up. Im just gonna replace the triggers with hidden floor buttons, see if that effects it.

You would not beleive how many times i have had to redo an entire concept due to lack of forsight on how all this is works. This map is gonna be pretty huge

Hidden floor buttons seems like a bad idea to me. Can you upload a vmf with just the logic you're trying to use?

Usually you'll have:
math counter:
initial value: 0
Max value: 2
OnHitMax <<do stuff>>
OnChangedFromMax <<stop doing stuff>>

button:
Onpressed: math_counter; add; 1
Onunpressed: math_counter; subtract 1 or math_counter; add; -1

trigger_multiple:
OnStartTouch: math_counter; add; 1
OnEndTouch: math_counter; subtract 1/add-1

Make sure the reset interval for the trigger_multiple is also good.

If you can't get it to work with the counter, try this alternative method:

Create a logic_branch for each trigger and set the following outputs on the trigger:
- OnStartTouch: logic_branch; SetValue; 1
- OnEndTouchAll: logic_branch; SetValue; 0

Then create one logic_branch_listener with references to all logic_branch entities involved. Give it the following outputs:
- OnAllTrue: do stuff...
- OnAllFalse: stop doing stuff...
- OnMixed: also stop doing stuff...

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

I finally got it to work like IPfreaky said it should. The problem was the trigger input wasn't correct.

Now i got a new error that popped up for the first time for no apparent reason. I have a movelinear as an elevator, i used it several times to test it out along with many elevators under the same design. But all of a sudden an error spammed saying Calculators entities(player and movelinear) At that moment my jump was stunted and i couldnt fire portals anymore

and i only got this error on the one movelinear out of them all

Just when I think I understand the system, it changes on me.

Movelinear can be very buggy. If it is a multi-stop lift I would use a func_tracktrain and if it is a 2 stop lift I would use a func_door.

Generally I think that any platform moving upwards (at least in Portal 2) will stop the player from jumping anyway. In Portal 1 I think you could gain momentum if you jump just before the lift stops (this is the same for HL2dm and CS:S)

I believe that error appears when (apparently) a movement is invalid. If the platform is moving incredibly fast, you could create a heap of these errors.

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

damn. i will look up that func_door thing

EDIT: i think the damn file has been corrupted, i removed the whole elevator and i still cant fire portals at all within the area. WTF?!

Just when I think I understand the system, it changes on me.