Logic problems

Chro

L1: Registered
Mar 26, 2008
20
3
I'm trying to put some logic into my map and its not going so well.

I have a math_counter that just counts up to 2 based on being in different parts of the map. For 0 and 2 i can just use onmax and onmin to fire out commands but when it is at 1 i have problems. So my round about solution is that the math_counter does an "outvalue" to a logic compare which fills the "setvalue" position. (To my knowledge "outvalue" keeps sending its current value to the logic compare)

The compare has an inital value of 0 and compare value of 1. It's outputs are "OnEqualTo" and then fires an output.

The onequalto never fires.

In my head this works but in hammer... no so well.
 

Lord Ned

L420: High Member
Feb 11, 2008
421
174
Maps. They are not logical.
Anyways.
Try Ontrue?
Or OnFalse? Never used logic_compare.

Okay yeah I have. And now my bsp won't compile. :c. (Terminal map error, not the LC's fault.)
 

Chro

L1: Registered
Mar 26, 2008
20
3
Theres no ontrue or onfalse on logic compare. I get onequalto, ongreaterthan, onlessthan, onnotequalto.

If theres another way to do a simple 'if then' statement im all for it.
 

Spacemonkeynz

L5: Dapper Member
Jan 31, 2008
234
52
Theres no ontrue or onfalse on logic compare. I get onequalto, ongreaterthan, onlessthan, onnotequalto.

If theres another way to do a simple 'if then' statement im all for it.

it would be awesome if you could use vb script right in hammer.

That's what I would like to see, an entity, where you can define your own inputs, outputs and code. That would be great.
 

Chro

L1: Registered
Mar 26, 2008
20
3
oh jesus, if i could script in this game id make some pretty cool maps. Half the problem with making maps is doing it in such round about ways. But im pretty sure i figured it out, hard to test being on two spots with a bot efficiently but it seems to work with him.

I'll read up on logic cases anyways because they seem something that may be up my alley soon.
 

Pseudo

L6: Sharp Member
Jan 26, 2008
319
150
logic_compare doesn't automatically compare its values when it receives a SetValue. To set the value and then compare, use SetValueCompare instead. To force a compare at any time, send a Compare input.

Also, math_counter doesn't continuously send OutValue. OutValue is fired only when the math_counter's value changes. But I don't think that's your problem.

logic_case does seem better suited to your situation. You could set the keyvalues Case01 to 0, Case02 to 1, Case03 to 2. When the logic_case receives "1" as an InValue input, it would match Case02's value and the output OnCase02 would be fired.
 

Chro

L1: Registered
Mar 26, 2008
20
3
yea, i just switched over to logic_case and alot of the funky problems i had are gone. Seems to work well now. I'll post the map once i finish it, i have a feeling the new idea of cp i have will take a while to balance. Some of you will probably figure out what im doing with this.
 

Foreverkul

L4: Comfortable Member
Apr 12, 2008
157
14
I think the logic_case would work best, then you only need to send the onValue output to it from the counter an have the rest of the commands executed by the logic_case instead of onMin and max