Home   Help Search Login Register  

Author Topic: moving a unit by getPos more accurate?  (Read 1052 times)

0 Members and 1 Guest are viewing this topic.

gundernak

  • Guest
moving a unit by getPos more accurate?
« on: 11 Sep 2003, 23:47:12 »
Hi everyone,

I would like to move a soldier as close as possible to a vehicle (a Scud Launcher) by getPos.

But getPos command do not define accurate enough the position of the vehicle.

It defines to the vehicle's left side about two steps from the left of the Scud. It does not define to the middle center of the Scud. Therefore if the soldier arrives to the scud from the right side it reaches the side of the vehicle as close as possible, because he want to move toward to the left side. If the soldier arrives from the left side he stops at about two steps from the vehicle

What should I add to the getPos command to move the soldier exactly to the scud as close as possible. He should step one or more step towards to the vehicle's center.
 
I hope I am clear...(my english... ::))

thanks in advance

Andris

_Ross_

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #1 on: 12 Sep 2003, 05:36:58 »
Idea

trigger 1
?(my condition):mysoldier assignasdriver myscud

trigger 2
?(mysoldier distance myscud < 4):mysoldier stop true

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moving a unit by getPos more accurate?
« Reply #2 on: 12 Sep 2003, 11:15:54 »
What you want is something of the form

loon1 setpos [(getpos scud1 select 0) + a, (getpos scud1 select 1) + b, getpos scud1 select 2]

where a and b are the offsets.   select 0 and select 1 and east-west and north-south (can never remember which way round) and select 2 is up-down.    Syntax not guaranteed.  You'll have to experiment a bit to get what you want.

Alternatively, building on _Ross_'s idea, you could perhaps do this

loon1 moveincargo scud1
unassignvehicle loon1

That will move him directly into the scud and then make him get out, so he will be directly outside the vehicle.

assignasdriver will only assign him to the vehicle, he won't actually move towards it.   You'll have to add

[loon1] ordergetin true

to make him move towards the scud.
Plenty of reviewed ArmA missions for you to play

gundernak

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #3 on: 12 Sep 2003, 13:00:35 »
Thanks the hints,

I have to mention that I have tried a lot with assignAsDriver - orderGetIn form, but if there is someone in the vehicle's driver seat the assignAsDriver - orderGetIn command simply ignored and not executed.

So I have to achieve that the assignAsDriver with an orderGetIn works as well even an other unit is in the vehicle. I tried this too...By using leaveVehicle or unassignVehicle. But both of these commands move the actual driver out of the vehicle. But such an effect is not allowed in a mission, because if an enemy soldier is in the driver seat, he will moved out by my command or trigger, and it is obviously nonsense.

So is it possible than after leaveVehicle or unassignVehicle the unit will not get out actually?! (- I could not imagine)

Is it seems I have to try with setPos and getPos form you written above?


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moving a unit by getPos more accurate?
« Reply #4 on: 12 Sep 2003, 13:34:41 »
try assignascargo or assignasgunner or assignascommander
Plenty of reviewed ArmA missions for you to play

gundernak

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #5 on: 12 Sep 2003, 14:04:35 »
I tried this as well.

It does not depend on using assignAscargo or comm or gunner, the enemy unit sitting in vehicle always disembarks.
 :-\

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moving a unit by getPos more accurate?
« Reply #6 on: 12 Sep 2003, 14:21:00 »
Ah ..... why do you want to move him like this anyway?   What's the background?    Maybe we can think of a more elegant solution.
Plenty of reviewed ArmA missions for you to play

gundernak

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #7 on: 12 Sep 2003, 20:10:03 »
Actually the soldier is an engineer on the story.

He should move to the scud to fix it, he plays an anim medicToCombat and he fixes the scud by setDammage. I set a trigger activated by the player's radio.

If he does not move close enough to the vehicle the anim is not believable. He moves his hand in the air too far from the scud.


KyleSarnik

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #8 on: 13 Sep 2003, 01:29:07 »
erm why not use a waypoint... If hes not close enough just move the waypoint past the scud a little until its just right...

gundernak

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #9 on: 13 Sep 2003, 01:50:16 »
Ok erm..::)

Waypoints can not work....because the enemy scud is in motion. The team's task to stop the scud and eliminate the escort. So the scud will be at that point where they attack it and make it stop.

more little info:
If they got the scud, sometimes the vehicle suffers such an ammount of dammage when the vehicle unable to move. That is why I have made a repair team(called by radio), to fix the vehicle in this case...just the d**n animation does not fit....

I have to tell you this as well -  the getPos combinated with offsets also does not work..I am sorry but it is true. I have experimeted a lot.

If you believe you set a good combination and you turn a little bit of the vehicle angle, the getPos moves the soldier another place

or

If you believe your values is ok (say -1) and you change it to 2, then you change back to the original -1 the effect is not the same as before altought the values are the same....  :o

so it is more difficult - I am getting to believe it is not worth to try.

anyway thanks

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moving a unit by getPos more accurate?
« Reply #10 on: 13 Sep 2003, 01:50:29 »
Waypoint is good.   Alternatively you could use a wee script:-

#loop
engineer1 doMove getpos scud1
~5
? engineer1 distance scud1 > 2: goto "loop"
engineer1 animation yadda yadda yadda
exit

Not guaranteed, this is just a sketch rather than a complete script.    

I wouldn't use either setpos or assignascargo in this case.  Neither give a believable outcome if the player is watching.
Plenty of reviewed ArmA missions for you to play

gundernak

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #11 on: 13 Sep 2003, 02:24:51 »
I have tried the script

The effect is the same the engineer stops before he reach the vehicle.

I gues the loop does not take effect because the loop allways gets the same command and even the first command is neither good...

guys, I am not sure about this problem to be solved, does it fit to this forum's possibilities or I have to learn much more to solve this all by myself alone???

You should tell me, because I do not want to bother you with this...


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:moving a unit by getPos more accurate?
« Reply #12 on: 13 Sep 2003, 10:10:27 »
Maybe you just have to live with it.    Try playing with setpos a bit more, maybe combine it with do move so that you only setpos him the last little bit.
Plenty of reviewed ArmA missions for you to play

max_killer_payne

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #13 on: 13 Sep 2003, 10:17:10 »
I think Macguba is along the right lines. Try this:

man domove getpos scud
goto "detect"

#detect
?(man distance scud < 4) : goto "close"
goto "detect"

#close
man stop true
man playMove "Blah"
~10
exit

(There have been a few of problems with the stop command, for me. Sometimes it doesent work,  so its not guaranteed)



gundernak

  • Guest
Re:moving a unit by getPos more accurate?
« Reply #14 on: 13 Sep 2003, 14:58:24 »
OK! SOLVED!

thanks the hints anyway!

getPos with offset is working now...

solution was too simple...

A commandMove with getPos to scud is enough, and after the engineer is close to the scud he steps forward a few step based on his! position...after comes the anim by another trigger

this script is enough:

#move

Eng commandMove getPos Scud01
 
? Eng distance Scud01 < 7: Eng doMove (getpos Eng select 0) + 4

exit

distance value '7' is for:

if it is lesser the next refine getPos sometimes will be ignored, if Eng arrives from the south end of the scud , because he does not reach this distance from that side (getPos Jeep01 defines about two steps from the vehicle's first door).

offset value '4' is for:

the engineer makes a few steps forward from there he is at the moment, and an offset '4' is enough to get the closest position as possible.

I tried it from so many kind of direction, with empty vehicle and with enemy in the vehicle

and the anim played believable!

thanks everyone

Andris