Home   Help Search Login Register  

Author Topic: Ready...now !  (Read 468 times)

0 Members and 1 Guest are viewing this topic.

O Neil

  • Guest
Ready...now !
« on: 11 Feb 2003, 05:18:25 »
Hey

Sorry, I'm a good cut-scener, and I'm good at everything at school except for Maths and science (Major drag huh?).....but that's irrelevent.
Thing is, I have a bloody prob with putting things together.

So here's my Q (Finally, soz):

I was some guys to hide in the bush on either side of the "Track" (Left and right about 10 meters apart) and I want an enemy patrol to go through the middle.
How do I make it so that the ambushers (West) don't fire unitl the patrol is right in the middle of the ambush ?

I've tried varius things like this dotarget, addeventhandler and the other one (Which I can't remember) and they don't work.

O Neil

PS: I have 1.46. ;)
PPS: 0 = team
        X = time to attack


                            0                 0               0    0               0
==========================================================
-------------------------------------------X                                                    
==========================================================
       0                          0 0                         0                            0
« Last Edit: 11 Feb 2003, 05:20:35 by O Neil »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Ready...now !
« Reply #1 on: 11 Feb 2003, 07:13:44 »
have you tried a simple combatmode thingy?

set the ambushers    unitname setcombatmode "blue"

and when you want them to attack

                                  unitname setcombatmode "red"

So what you want to do is put a trigger in the middle (where the X is) which activates the combatmode "red"

I don't remember if the color codes are right, but you can check them from the command reference.
Not all is lost.

Silver Fox

  • Guest
Re:Ready...now !
« Reply #2 on: 11 Feb 2003, 10:41:42 »
Sounds like your learning quickly O Neil!

The simplist way  i can see of you doing the above would be to set the enemy as captive, you know.. setcaptive true and then when they reach a certain point just setcaptive false. Bye bye bad guy!

that should do the trick mate! Give it a go :-*

Cheers
           Silver ;D

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Ready...now !
« Reply #3 on: 11 Feb 2003, 19:39:06 »
hehe, moderators answering galore..ahem. :D

Considerations: if your ambush is spotted (for instance you run out and get yourself seen) you wouldn't want your men to just sit around in old combatmode blue and get slaughtered, or even worse, lie helplessly while setcaptivated soldiers run amok amongst them? So, what you need is an OR syntax. Let's say the trigger in the middle of the road is:

Activated By: East
Condition: "_x in thisList" count units e_group1 >0
on Activation: leader w_group1 SetCombatMode "YELLOW"; leader w_group1 setBehaviour "Combat"

euhm. So that as soon as at least one of the members of e_group1 are within the trigger radius (as long as they're east, that is ;)), the trigger activates. And it makes the leader (and thus the whole group) of w_group1 to go to "Open fire" and "Combat" modes. I would suggest Artaks solution with the combat mode "BLUE", it's easiest :thumbsup: Also make their Behaviour "Stealth" and they'll keep their heads down.

Anyhow, ahem. The easiest way to see if the other teams seen you (or, if not seen you, heard you) is by gauging their behaviour -> if the enemy team is in safe mode, it's damned easy to make a condition stating: (behaviour leader e_group1) !="safe". At least I think that's the syntax  :-\

so, add to the condition:

Condition: "_x in thisList" count units e_group1 >0 OR behaviour (leader e_group1) !="safe"

and, ta-da, if you're spotted/you shoot at him, the trigger will activate even if the ambush is spoiled...at least you won't lie around like vegetables ;D

Another way might be to use some kind of knowsAbout or somesuch. But I think the above would work the best. I think behaviour goes to "Combat" in most AI cases directly, so even if the enemy group is on Aware it might work... :toocool:

Alright. I'm getting inspired by you here Artak...must...write...scripts...

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