Jump to content
Sign in to follow this  
Major Fubar

Watchtower lookout question

Recommended Posts

OK, I'm a bit of a ME n00b (still), so let me tell you waht I'm trying to do:

I want a soldier to start off in a watchtower, and during the mission I want him to be looking though his binocs and scanning the horizon (turning in a circle).

So how do I do this? I know how to get him in the tower, no probs. The major problem is that when he spots an enemy and tries to engage, he usually drops out of the tower. How do I make him stay in the exact same spot? And what are the commands to make him take out his binoculars and scan the horizon?

Cheers - Fubar

Share this post


Link to post
Share on other sites

Hmm tricky one..

You'll need to script it combining a few things..

_this SetUnitPos "UP" to stop him dropping down.

Then use SelectWeapon to making him get out his 'nocs..

Then you'd need to use DoTarget, you could have another unit offscreen like a chopper or plane flying across and he can target that and move slowly around while he has his 'nocs out..

Meh, maybe someone who has access to flashpoint at the moment can assist..

wink_o.gif

Share this post


Link to post
Share on other sites

If you take away all weapons except binocs from soldier and let him select binocs as weapon, he will put out the binocs and scan the horizon.

Share this post


Link to post
Share on other sites
Quote[/b] ] you could have another unit offscreen like a chopper or plane flying across and he can target that and move slowly around while he has his 'nocs out..

If you don't want the object in the game, create it as a Game Logic unit (from the editor). That way it's there, but, not.

Share this post


Link to post
Share on other sites

To prevent the soldier to run for cover or to fight (and fall from the tower), you can add this in its init line

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this disableAI "move"

Then he will stay on his tower for all the mission (it does not prevent the AI to open fire on an enemy)

But remember , there is no way to enable the AI to move again

Share this post


Link to post
Share on other sites

Just another suggestion here:

I'm pretty sure that a guard in a tower wouldn't carry his

weapon on his back, the more he would lean it onto the

inside wall of the guard tower.

Now this will be a good logically explanation, to remove

the weapon from that guy (will be a big help for yer binocs

action).

Now you can createVehicle a weaponholder + a weapon and

it's mags into that tower.

Once he's intended to use the gun, you can let him take it wink_o.gif

I'll post ya the: how to make the weaponholder + weapon

into the tower thingy later when i'm back home from work.

~S~ CD

Share this post


Link to post
Share on other sites

Well, I tried the above suggestions, and they didn't really work how I wanted it to - he kept putting away his binocs and pulling them out again.

Is there a parameter in the swithjmove or playmove that specifies how long the move lasts for?

I've currently got, in a trigger "this switchmove BinocHandGunStand". What do I need to put in to specify the length of the move?

Share this post


Link to post
Share on other sites

Could make a looping script

like

#loop

?!alive man1 : exit

man1 switchmove "ASDF"

~2

goto "loop"

Share this post


Link to post
Share on other sites

Isn't there a way to tell the unit to "Scan horizon" throught init or script?

You can order units to scan horizon during game play, so it should be a command for it in the command reference.

About the weapon not being hold by the unit.

Make sure you remove the weapons but the binos, I would create a trigger that its activated when enemy spoted, then order the unit to use the seatdown animation.

Add another triger activated the same way, right on the same place as the first trigger, but time this one with a difference of 1 to 2 or 3 seconds after the first triger.

Add amunition and weapons to the unit trought the triger and put it on SetUnitPos "UP".

That will do.

Because of the animation you will use, the seatdown one, from outside the tower will look like its doing something ellse than just seat down, like grabing a weapon for example.

Oh, you'll have to cancel the animation aswell, I forgot.

@CERO.

Share this post


Link to post
Share on other sites
Isn't there a way to tell the unit to "Scan horizon" throught init or script?

You can order units to scan horizon during game play, so it should be a command for it in the command reference.

That's exactly what I am looking for...

Share this post


Link to post
Share on other sites

Interesting thread,...

I saw this and this long time ago,

Maybe it could help...

PS :it's not a script, it's an addon

Share this post


Link to post
Share on other sites

Actually, I have a folder in my games folder...

Well, lets just say that in all the cluted up stuff that I have for OFP I comed across a txt file that I made a while ago.

I copied and pasted from OFPEC forums and saved as "Binoculars animation", so when I seen it I thought, Damm, I have used that before and it works really well!!

Well here you go.

Quote[/b] ]Binocular Animation

Had trouble making those guys use binocular in cutscenes for example?

Tried the switchmove/playmove with the binoc animations, but it didn't do

things as expected, (ie. they put the binoculars away in a flash)?

Well here's the solution...

binocs = false

#loop

soldier playmove "CombatToBinoc"

~0.01

?(!binocs): goto "loop"

exit

... and when binocs is set true, the loop ends. That simple!

That's what I used.

Add the setunitpos"up" to it, and it should do.

@CERO.

Share this post


Link to post
Share on other sites

Ok this should work.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_man = _this

_man exec "turn.sqs"

binocs = false

#loop

_man playmove "CombatToBinoc"

~0.01

?(!binocs): goto "loop"

exit

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;;turn.sqs

_man = _this

_MaxR = (getdir _man) + 90

_MaxL = (getdir _man) + 270

_GoL = true

_GoR = false

_X = _MaxR - 10

_Y = _MaxR + 10

_A = _MaxL + 10

_B = _MaxL - 10

#loop

~0.01

?(getdir _man > _X) && (getdir _man < _Y) && _goR : _goR = false; _goL = true

?(getdir _man < _A) && (getdir _man > _B) && _goL : _goL = false; _goR = true

?_GoR && !_GoL : _man setdir (getdir _man) + 0.5

?_GoL && !_GoR : _man setdir (getdir _man) - 0.5

?(!binocs): goto "loop"

exit

Edit: shoot just noticed something, if his dir is 360 or something, it'll just spin him, you have to make his dir 0.

Im working on a fix, it's cause if its 360 and

_MaxL = (getdir _man) + 270

it'll add 270 + 360, thats bad.

Yeah I get confused too easily with dirs, im gonna leave someone else to figure it out, thinking bout it gives me a headache sad_o.gif

Share this post


Link to post
Share on other sites

LOL, I just finded a way to do it without scripting.

Put this in the soldiers init line:

Quote[/b] ]this selectweapon"binocular";this setbehaviour "safe"

Then add a trigger the size of the units area of responsability activated by whoever is the bad guys present and add this on the "on activation" field:

Quote[/b] ] this setunitpos"up"

The select weapon binocular works nicely, it kips on looking throught them, but I don't know if it will allways do so.

I just tryed like for 7 times and it work.

When it sees the bad guys, the trigger don't give it chance to get down cos its telling it to stand up, and all it do is target and fire them units that he can see.

I been trying for the last 45 minutes with different combinations, using a waypoint, triggers, two of them, init, but finally this seems to work fine.

I haven't added the "Scan horizon" tipe of feel, it will scan a fixed area, but if you can tell him to watch a certain thing( Marker, Gamelogic, unit, whatever), and then watch something ellse it should do so.

@CERO.

Edit: Example mission, I don't know if that link its gonna work let me know, but I'll delete the file in a cuple of days, its from a freewebs site, you know what they like sad_o.gif

Share this post


Link to post
Share on other sites

Excellent guys! I will try these suggestions out as soon as I'm on my home PC...Thanks again! smile_o.gif

Share this post


Link to post
Share on other sites
To prevent the soldier to run for cover or to fight (and fall from the tower), you can add this in its init line

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this disableAI "move"

Then he will stay on his tower for all the mission (it does not prevent the AI to open fire on an enemy)

But remember , there is no way to enable the AI to move again

Sorry...I have to make a comment on this. First off, AI on guard tower, doesn't move around when placed on towers...at least I never seen it before!

Share this post


Link to post
Share on other sites

If he spots an enemy, he engages, which usually results in him moving and falling out of the tower...you can try it youself. Put a unit in a tower, than put an enemy within his line of sight...

Share this post


Link to post
Share on other sites

heya

this is a little bit off the topic, but still related to the guard towers.

my guy keeps standing underneath the tower. unless its one thats on the map originally. how do you make him stand in the box on an added tower?

i cant even work out how to make a radio object sit on a table object though - it also just sits underneath it.

sad_o.gifsad_o.gif

mick

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">man setpos [getpos man select 0, getpos man select 1, 10]

The 10 at the end is height in metres, play with it till you get the right height.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×