Home   Help Search Login Register  

Author Topic: sniper in a window  (Read 515 times)

0 Members and 2 Guests are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
sniper in a window
« on: 16 Dec 2004, 07:27:43 »
hello,

is there a way to put a sniper so he is looking out the window and can shoot out it too.
i cant figure out how to get him so he starts inside the window.

can the same be done for an MG, maby have it mounted on the window sill for increased AIM.

thanks

pazuzu

  • Guest
Re:sniper in a window
« Reply #1 on: 16 Dec 2004, 09:00:17 »
Put this in the init of sniper or MG:

this setUnitPos "up"; this setCombatMode "red"; this setBehaviour "safe"; this setSpeedMode "limited"; this disableAI "move"; this setpos [getpos this select 0, getpos this select 1, (getpos this select 2) +7]

You'll have to adjust the height according to the building you put him in & fool around positioning him.


Hope it helps...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:sniper in a window
« Reply #2 on: 16 Dec 2004, 10:06:45 »
pazuzu's method will work.     There are other ways of doing it, depending on the window.    Search the forum, this came up the other day.

Remember that urban combat is one of the game's weaknesses.     AI loons and see and shoot through walls sometimes, and human players can't.    Which isn't fun.
Plenty of reviewed ArmA missions for you to play

IO Warrior

  • Guest
Re:sniper in a window
« Reply #3 on: 16 Dec 2004, 21:54:42 »
you can also set him in position with a few commands that will spare you from that tedious placing him manually.

Every building has a number of positions inside the building that can be referenced by buildingPos [building, 1] command that returns the position array of that position in world coordinates. Usualy there are about 20 positions in a building (depending on the size of the building) and they refer to doors, stairs, windows, tables and chairs.

1. check the buildings id in mission editor by turning on "Show Id". Let us assume that the building you are using has a id of 10000.
2. in the units init field write:
Code: [Select]
this setpos buildingPos[object 10000, 1]
This will place him probably standing just outside the front door.
Code: [Select]
this setpos buildingPos[object 10000, 2]
This again, probably just inside it.

Cycling trough the id you can fast find the position you are looking for.

When you have it you could combine this method with pazuzu's example getting this:
Code: [Select]
this setpos buildingPos[object 10000, 2]; this setUnitPos "up"; this setCombatMode "red"; this setBehaviour "safe"; this setSpeedMode "limited"; this disableAI "move";

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:sniper in a window
« Reply #4 on: 17 Dec 2004, 00:10:57 »
thanks
it helps alot