Home   Help Search Login Register  

Author Topic: how do you make a unit shoot where you want?  (Read 848 times)

0 Members and 2 Guests are viewing this topic.

headshot_snipe

  • Guest
how do you make a unit shoot where you want?
« on: 05 Jan 2004, 19:28:00 »
I created a small script which made two german soldiers(inv44) go into a pak36 (GST addon) and shoot:

Code: [Select]
_gunner = _this select 0
_commander = _this select 1
_pak = _this select 2

_gunner assignasgunner _pak
_commander assignascommander _pak
[_gunner,_commander] ordergetin true

#loop

_pak fire "GS_PAK36AP"

goto"loop"


It works fine, but i would like to know how to make it shoot where i want, like on a invisible H or something alike.

I tried to make the _gunner, _commander and _pak target the H but i still didn't get any results ( i used the dotarget command in my script) does anyone know how to make a unit shoot where you want? thx

Unnamed

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #1 on: 05 Jan 2004, 20:52:31 »
Try using the dowatch command instead, you can use either an object or its position.

Just make sure you give it enough time to get into position before you fire.
« Last Edit: 05 Jan 2004, 20:53:19 by Unnamed »

Quid Novi

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #2 on: 05 Jan 2004, 21:29:32 »
they don't like targeting game logics etc... try doing it with a normal unit out of a position, they will spin and go crazy...

try setting the azimut to whatever direction you want them to shoot at:

e.g:

Code: [Select]
gunnername setDir 000
makes the man look north  ;)

east = 090

south = 180

west = 270

gundernak

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #3 on: 05 Jan 2004, 21:50:45 »
they don't like targeting game logics etc...

I have just finished trying to make a unit fire at a game logic...

And it did not work, as Carpe Diem wrote...

Anyway I read many times on forum discussions that a unit CAN fire at a game logic...

So, what is that?? :-\

Quid Novi

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #4 on: 05 Jan 2004, 21:52:27 »
well... a long time ago i had a script that made T-80's fire shells at random gamelogics (would change all the time) into a forest.... maybe there is a difference between shells and bullets in terms of ofp  ::)

headshot_snipe

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #5 on: 06 Jan 2004, 07:55:05 »
Thx for your replies,
The pak is a fixed gun, and dowatch does not work because the soldier is inside it. I'll try the azimut command this time, and i'll tell you the results.
thx again

[EDIT]

azimut doesn't work, i guess its the same reason (the unit being inside the artilery)
its wierd, because when the gunner enters the artilery then he tilts the canon to the left all the time, any idea why? and i tried the azimut on normal unit, it makes them change position but then they go back to the direction they had at the start :(

any idea? and what was that script with the tank and the game logic Carpe Diem, could i have a look? thx
« Last Edit: 06 Jan 2004, 08:15:27 by headshot_snipe »

Unnamed

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #6 on: 06 Jan 2004, 09:59:29 »
Quote
The pak is a fixed gun, and dowatch does not work because the soldier is inside it

All guns based on vehicles work this way, assuming the addon maker allows them to move.

Here is an example mission I made using DoWatch to aim the Pak at a flag on a hill. Use radio Alpha to aim the gun and radio Bravo to fire.

Pak36 DoWatch Example

By varying the Z coordinate of the position passed to DoWatch, like I did in radio Alpha. You can create indirect artillery fire.

Quote
the gunner enters the artilery then he tilts the canon to the left all the time, any idea why?

The gunner is trying to turn to formation, the same way tanks do.

Again, you can use the dowatch command to stop this ;)
« Last Edit: 06 Jan 2004, 10:01:25 by Unnamed »

headshot_snipe

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #7 on: 06 Jan 2004, 12:25:10 »
thx a lot   8),

 i'll try it when i get home

[EDIT]

i just looked at the script, what does the FlagPos Set [2,15] do?

thx
« Last Edit: 06 Jan 2004, 15:04:12 by headshot_snipe »

Unnamed

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #8 on: 06 Jan 2004, 22:15:40 »
FlagPos is a global variable that contains the [X,Y,Z] position as an array, the Set command allows you to change a given value in an array.

I was just setting the third (0..1..2) element in the array to the value of 15.

headshot_snipe

  • Guest
Re:how do you make a unit shoot where you want?
« Reply #9 on: 07 Jan 2004, 09:20:08 »
understood

thx a lot