Home   Help Search Login Register  

Author Topic: scalar?!?!  (Read 609 times)

0 Members and 1 Guest are viewing this topic.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
scalar?!?!
« on: 23 Aug 2004, 15:36:08 »
as you can see in the script below, I have tried 3 different ways to define _aaa,_bbb and _ccc, but the sidechat alsways returns "a is scalar,B is scalar, c is scalar"
What does this mean?  How can I get a NUMBER to be displayed?
Code: [Select]
_f1=getpos fortress1 select 0
_f2=getpos fortress1 select 1
#start
_aaa=_f1 - getpos player select 0
_bbb=getpos player select 1 - _f2
_ccc=((getpos player select 2) - (getpos fortress1 select 2))

player sidechat format ["a is %1, b is %2, c is %3",abs _aaa,abs _bbb,abs _ccc]
~1
goto "start"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:scalar?!?!
« Reply #1 on: 23 Aug 2004, 18:03:16 »
A Scalar is a number.  The alternative is a Vector that has both size and direction.  It looks like _aaa, _bbb and _ccc are not defined

There is nothing wrong that I can see with the sidechat instruction.   Is fortress1 defined?

Try displaying _f1 and _f2 and see what you get.

« Last Edit: 23 Aug 2004, 18:10:29 by THobson »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:scalar?!?!
« Reply #2 on: 23 Aug 2004, 18:10:41 »
What happens if you lose all the getpos stuff and set _aaa to a value?  (Just for testing purposes.)     What do you get if you lose the abs commands?
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:scalar?!?!
« Reply #3 on: 23 Aug 2004, 18:11:46 »
I tried that and it worked.  The abs command does not seem to be the problem
« Last Edit: 23 Aug 2004, 18:15:52 by THobson »

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:scalar?!?!
« Reply #4 on: 23 Aug 2004, 22:41:23 »
What does GetPos fortress1 return?
It's a wild guess, but try renaming fortress1 to something that isn't an object class name.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:scalar?!?!
« Reply #5 on: 24 Aug 2004, 03:24:50 »
Actually all of you contributed to the solution!  Thanks a bunch, here is the new code:
Code: [Select]
_f1=getpos ftrs select 0
_f2=getpos ftrs select 1
_f3=getpos ftrs select 2
#start
player sidechat format ["fortress location is %1,%2 and %3",_f1,_f2,_f3]
~1
_aaa=(_f1) - (getpos player select 0)
_bbb=(getpos player select 1) - (_f2)
_ccc=((getpos player select 2) - (getpos ftrs select 2))

player globalchat format ["a is %1, b is %2, c is %3",abs _aaa,abs _bbb,abs _ccc]
~1
goto "start"
 I think the main key was naming fortress1, since it returned scalar bool array blah blah blah  without a name.

  I would have liked to use the distance command, but as I understand it, it would give me the slant range of 2 objects at different heights and locations and what I really needed to build this script for is to get the ALTITUDE ONLY (select2) difference.  Now I can continue with the rest of the script, thanks to everyone for your help ;D