Notices

More logic questions  Thread Tools Reply
Old 07-14-2012, 11:10 AM   #1
Riever
L2: Member
 
Riever is offline
Posts: 86
Thanks: 23
Thanked: 0

Default More logic questions


Dear all,

Although I am still stuck on my previous problems ( http://forums.tf2maps.net/showthread.php?t=19697 ) I wonder if someone can help with the following.

I have two math counters (1 and 2) and each store 0-6.

At a particular point in the game I want 2 capture points (A and B) to be enabled depending on the values in the counters.

If counter 1 and counter 2 are both less than 5 activate Cap Point A
If counter 1 and counter 2 are both equal to or greater than 5 activate Cap Point B

If counter 1 is < 5 and counter 2 is =>5 activate A to be capped by blue and B to be capped by red.

If counter 2 is =>5 and counter 2 is <5 activate A to be capped by red and B to be capped by blue.

It that wasn't complex enough the counters are tested elsewhere by using get_value and so I cannot use this to start above tests as I only want them to run at one point in the map.

I've played around with duplicated counters and logic_cases and just ended up with non-working spaghetti.

So could anyone please suggest a way to even start on this.

I live in hope...
 
Reply With Quote
Advertisement
 
Advertisement
Advertisement Sponsored links

Old 07-15-2012, 11:58 AM   #2
A Boojum Snark
Toraipoddodezain Mazahabado
 
A Boojum Snark's Avatar
 
A Boojum Snark is offline
Posts: 4,311
Thanks: 112
Thanked: 4,501

Default More logic questions


You will need one additional math_counter, four logic_branch, and three logic_case.

logic_case
names: case_one & case_two
case04: 4
case05: 5

logic_branch
names:
• branch_one_uptofive
• branch_one_downtofour
• branch_two_uptofive
• branch_two_downtofour
intitial value: 0, assuming your two counters start at 0. If not, and you aren't sure how to set them, let me know.

math_counter
name: counter_total

logic_case
name: case_counterstate
case01: 1
case02: 2
case03: 3
case04: 0
(when dealing with numbers like this, I prefer to put zero at the end so the rest match up to the key and output)


Set up the following outputs:

Source EntityOutputTarget EntityInputParameter
counter_oneOutValuecase_oneInValue 
     
counter_twoOutValuecase_twoInValue 
     
case_oneOnCase04branch_one_uptofiveSetValue1
case_oneOnCase04branch_one_downtofourTest 
case_oneOnCase05branch_one_uptofiveTest 
case_oneOnCase05branch_one_downtofourSetValue1
     
case_twoOnCase04branch_two_uptofiveSetValue1
case_twoOnCase04branch_two_downtofourTest 
case_twoOnCase05branch_two_uptofiveTest 
case_twoOnCase05branch_two_downtofourSetValue1
     
branch_one_uptofiveOnTrue!selfSetValue0
branch_one_uptofiveOnTruecounter_totalAdd1
     
branch_one_downtofourOnTrue!selfSetValue0
branch_one_downtofourOnTruecounter_totalSubtract1
     
branch_two_uptofiveOnTrue!selfSetValue0
branch_two_uptofiveOnTruecounter_totalAdd2
     
branch_two_downtofourOnTrue!selfSetValue0
branch_two_downtofourOnTruecounter_totalSubtract2
     
counter_totalOutValuecase_counterstateInValue 

Keeping track of four states (two things with "on/off") is easy enough, but this got more complicated because your on and off is actually 7 different states. When counter one is "on" (5 or more) it counts as a value of 1 in counter_total. When counter two is on, it counts as 2. This provides us with four unique values for the four states you want to use.

The mess of logic_branch stuff was required to ensure the total count only changes when going in the right direction. We want to add when going from 4 to 5, but not when going from 6 to 5. Likewise when going to 4.

Finally, the outputs for case_counterstate:
OnCase01: value of 1, (1+0) counter_one is above four. Use this for A red, B blu.
OnCase02: value of 2, (0+2) counter_two is above four. Use this for A blu, B red.
OnCase03: value of 3, (1+2) both are above four. Use this for B active.
OnCase04: value of 0, (0+0) both are below five. Use this for A active.

__________________
(>^_^)>---[] Mapper Kirby says you must get:
Ultimate Mapping Resource Pack! UPDATED for Steampipe!

 
Reply With Quote
The Following User Says Thank You to A Boojum Snark For This Useful Post:
Sponsored links
Advertisement
 
Advertisement
Advertisement

Reply

Previous Thread Next Thread
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 10:28 AM.