Home   Help Search Login Register  

Author Topic: count units trigger problems  (Read 587 times)

0 Members and 1 Guest are viewing this topic.

archtech

  • Guest
count units trigger problems
« on: 06 Dec 2002, 00:06:41 »
First off, thanks much to the dedicated posters here that share their wisdom with the OFP community.  I've been lurking here for quite awhile and have gleaned some very useful and helpful information about scripting and mission design.

I think I finally have a problem that I can't seem to solve by just searching on the boards and would like some help.

I'd like a couple of triggers… one to do a count of all soldiers within a rectangle at the beginning of the mission.  Based upon some lurking, I set this one up as:

Once
East activation
Present
"draw" the desired rectangle  
Condition: this
On Activation: countall= count (list this)  

So far so good, it seems.  I believe that the trigger is counting everybody alive on the east side one time and saving it as "countall"… right?

Okay, now I'd like another trigger to use the "countall" total I made above and compare it to the current total.  When the number becomes less than the "countall" (like by someone killing a Russkie), I'd like the trigger to activate… so I put it in the "Condition" field, right?  Here's what I did for this trigger:

Once
East activation
Present
Same rectangle as above
Condition: countall < count (list this)  
On Activation: [all sorts of stuff]
Plus alarm effects, etc.

With this trigger, I get an error "Type Bool, expected Object"  I guess my syntax for the Condition must be bad, because I certainly want a True/False to be returned and when it turns up True I want the trigger to activate.

What am I doing wrong?!

Thanks a bunch, and sorry if it's something totally boneheaded I've done.

Brian

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:count units trigger problems
« Reply #1 on: 06 Dec 2002, 00:58:55 »
Your code looks good.  Try giving each of your triggers a name, and then replacing this with the respective trigger's name.  Maybe that'll fix it.
Ranger

archtech

  • Guest
Re:count units trigger problems
« Reply #2 on: 06 Dec 2002, 01:28:58 »
That did it!  Apparently all of the this entries may have been confusing the game, who knows.  But it works!  I definately have to bone up on my Trigger knowledge.

Thanks, Ranger!  You da man!

Brian

p.s. not real sure how to mark this thread as solved.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:count units trigger problems
« Reply #3 on: 06 Dec 2002, 12:24:25 »
on top o' your thread, there's a number of buttons, like "quote", "solve", "modify". Just click the lil' ol' "solved" button and you'll be fine :D

Oh, and welcome to the forums ;)


Wolfrug out.
"When 900 years YOU reach, look as good you will not!"