Home   Help Search Login Register  

Author Topic: velocity, and scripts  (Read 1601 times)

0 Members and 2 Guests are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
velocity, and scripts
« on: 26 Feb 2005, 06:00:32 »
?! _speed = [0,0,0] : goto "loop"

why does that line in my script bring up error,

o and speed is

_speed = velocity _man

and man is

_man = _this select 0

thanks penguin

UNN

  • Guest
Re:velocity, and scripts
« Reply #1 on: 26 Feb 2005, 06:09:33 »
You cant make a direct comparison with arrays, so you cant say array1==array2.

But there is a shorcut, you can subtract one lot of array elemts from another, so:

Code: [Select]
Count (_Speed-[0,0,0])
Will return 0 if the object your testing is not moving.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #2 on: 26 Feb 2005, 07:15:33 »
thx

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #3 on: 26 Feb 2005, 07:19:40 »
hmm still geting an uknown operator error,

im using

Count (_Speed-[0,0,0]) : goto "loop"


the # is here

Count (_Speed-[0,0,0])|#| : goto "loop"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:velocity, and scripts
« Reply #4 on: 26 Feb 2005, 07:56:11 »
I think, to do what you are trying to do the construct should be something like:

if ({_x == 0} count  _speed == 3) then {whatever}

This might get rid of the error, but will not really do what you want because the array elements returned by velocity are real numbers not integers.  The chance of them being exactly 0 is very small indeed and cannot be relied on.  Why not use:

_speed = speed man
if (_speed <0.1) then {whatever}

If you must use velocity then try:

_speed = velocity man
if ({abs(_x) < 0.1} count  _speed == 3) then {whatever}

« Last Edit: 26 Feb 2005, 08:37:51 by THobson »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #5 on: 26 Feb 2005, 09:03:51 »
*smacks head against computer screen*

how stupid of me, "speed"

i wasted alot of time when all i had to use was speed, not set velocity.

thank you

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #6 on: 26 Feb 2005, 09:30:13 »
ok but how do u get a script to wait at a certain point until somthing has happend,

like say i wanted a script to set dammage 1 one guy say m1

then make another guy m2 go prone "setunitpos"


then wait until a third guy m3 has started moving using speed.

and once the third guy has started moving the script will setdammage 1, one last man, m4

how and what would that look like


and it needs to be with out using loops

but if its not posible without loops then how with loops

thanks

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:velocity, and scripts
« Reply #7 on: 26 Feb 2005, 11:13:00 »
As long as their are no enemy around then a doStop command sounds like it will do what you need.
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:velocity, and scripts
« Reply #8 on: 26 Feb 2005, 11:54:50 »
you could try putting the following in your script:

@(speed m3 > 0.1)
« Last Edit: 27 Feb 2005, 09:30:55 by THobson »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #9 on: 26 Feb 2005, 20:17:18 »
ya, umm, isnt do stop for units, it wouldnt make a script wait???


say i were to script that simple example i gave, what would that look like

Quote
say i wanted a script to set dammage 1 one guy say m1

then make another guy m2 go prone "setunitpos"


then wait until a third guy m3 has started moving using speed.

and once the third guy has started moving the script will setdammage 1, one last man, m4


thanks

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:velocity, and scripts
« Reply #10 on: 26 Feb 2005, 20:53:40 »
Sorry yes I misread your post.
Plenty of reviewed ArmA missions for you to play

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #11 on: 27 Feb 2005, 02:05:02 »
lol yes,
but how would it be done,

if i must i will post the entire script but i would rather not as theres alot of stealers around here and i want to submit it

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:velocity, and scripts
« Reply #12 on: 27 Feb 2005, 08:49:30 »
Did my suggestion at #8 above not work?

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #13 on: 27 Feb 2005, 22:16:50 »
im not sure how to implement that

thanks

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:velocity, and scripts
« Reply #14 on: 27 Feb 2005, 23:27:07 »
You put it in your script and you script will stop at that point until the speed of m3 is > 0.1  When that becomes true the script will continue to run.