# Logic problems

Discussion in 'Mapping Questions & Discussion' started by Chro, May 11, 2008.

1. ### ChroL1: Registered

Messages:
20
Positive Ratings:
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.

2. ### Lord NedL7: Fancy Member

Messages:
421
Positive Ratings:
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.)

3. ### ChroL1: Registered

Messages:
20
Positive Ratings:
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.

4. ### Lord NedL7: Fancy Member

Messages:
421
Positive Ratings:
174

5. ### SpacemonkeynzL5: Dapper Member

Messages:
234
Positive Ratings:
52

or a not_another_logic_entity?

6. ### SpacemonkeynzL5: Dapper Member

Messages:
234
Positive Ratings:
52
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.

7. ### ChroL1: Registered

Messages:
20
Positive Ratings:
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.

8. ### PseudoL6: Sharp Member

Messages:
319
Positive Ratings:
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.

9. ### ChroL1: Registered

Messages:
20
Positive Ratings:
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.

10. ### ForeverkulL4: Comfortable Member

Messages:
157
Positive Ratings:
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