Home   Help Search Login Register  

Author Topic: sniper in the tower  (Read 1299 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
sniper in the tower
« on: 09 Jun 2006, 10:42:40 »
I put a sniper on the top of a tower.
But when the fight begin and sniper started sneak for godd position or what, he fall from the towe and injury/die.

I tried write a script/trigger...
The tower is 15m high.

I inserted a trigger - condition: (getPos sniper select 2) < 15
activation: sniper setPos (snipposx, snipposy,15)

of course, the trigger is repeating. And snipposx, y was detected in the begining of the mission.

But doesn't work.
I printed the (getPos sniper select 2) value to the screen and I found, this value is 0.0002356 and not 15.
Ok I undersand the basic level is the top of the tower and the sniper are on basic level, but the trigger also doesn't triggered, but 0.00023 < 15.

Right! Can you help me? Any other idea, how can I stay the sniper in the tower?
Fix bayonet!

Snuffles

  • Guest
Re: sniper in the tower
« Reply #1 on: 09 Jun 2006, 10:50:38 »
its actually pretty simple, to keep the sniper from falling off the tower, simply put dostop this in the units initialization line, and the unit will not move from that position unless ordered otherwise.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: sniper in the tower
« Reply #2 on: 09 Jun 2006, 12:32:52 »
it's not quite that simple. when the sniper spots an enemy, more often than not he'll go prone, making him fall out.

in the sniper's init field, put

Code: [Select]
dostop this; this setunitpos "up"
the sniper will now stay in the tower, and will also remain standing. all this is assuming he's not part of another group, in which case he'll try to return to formation eventually depending on what the leader tells him to do.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: sniper in the tower
« Reply #3 on: 09 Jun 2006, 12:58:45 »
I do this.

Create the sniper, select his formation as "None"; that bit is important if he's gonna be part of a group.
In his Init write:

This SetUnitPos "Up"; This DisableAI "Move"; This SetPos [(GetPos This Select 0), (GetPos This Select 1), 15]

James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re: sniper in the tower
« Reply #4 on: 09 Jun 2006, 13:57:16 »
The only thing about disableAI "Move" is that he won't move his feet at all. Which means his field of fire is limited to about 45 degrees of where he was pointing in the first place. You just have to be aware that he won't spin around and engage enemies behind him like this, though having said that, Its what I would use as well....

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: sniper in the tower
« Reply #5 on: 09 Jun 2006, 14:55:21 »
I can't use setUnitPos "up", because I used the setUnitPos "down".
If he is down, he can shoot with higher accuracy and the player can detect him harder.
The sniper is an individual guy (not in group) (but he reveal the player from script). He only move if he want (not a "return to formation"). But he moving a little bit when he targeting, and sometimes he falling down...

The solution of doStop don't solve my 'targeting move & fall' problem?

I try that disableAI "Move" and scripting the direction.
Fix bayonet!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: sniper in the tower
« Reply #6 on: 09 Jun 2006, 18:52:18 »
disableAI "Move" prevents the unit to turn around unless he has already targeted an enemy. That is, the unit will not turn to adquire targets, but will turn to keep firing against current target if needed.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: sniper in the tower
« Reply #7 on: 12 Jun 2006, 09:29:29 »
I tried your ideas, and finally the doStop was enough. But I modifie my trigger: the condition:

((getPos sniper select 2) < 15) and ((getPos sniper select 2) > 1)

Because when the sniper in the tower, his Z coord are lower then 1, but when he started falling, his Z coord become 14, 13, ...

And it's works!!! :D
Fix bayonet!