Home   Help Search Login Register  

Author Topic: What am I doing wrong? PART 2562  (Read 911 times)

0 Members and 1 Guest are viewing this topic.

Offline Peter_Bullet

  • Members
  • *
  • "The evil that men do lives on and on"
What am I doing wrong? PART 2562
« on: 26 Sep 2004, 16:02:03 »
This is the first time I post "What am I doing wrong" -topic

_group = _this select 0
_UGRP = units _group
_count = count _UGRP
TitleText [Format["Count: %1", _count],"Plain Down"]

the above is a simple example to give you the idea. I pass an existing group to the script, but it prints like "Count: 00fffx scalar bool array", instead of a number! So what's wrong with this, or is the problem my computer?

Below is the real purpose where I need the count command:

_unitsLeft = _this select 0
_countType = _this select 1
_Parameters = _this select 2
_Script = _this select 3
_group1 = _this select 4
_group2 = _this select 5

?(_countType == 1): goto "CountByOneGroup"
?(_countType == 2): goto "CountByAllGroups"

#CountByAll
_GrpUnits1 = units _group1
_count1 = count _GrpUnits1
_GrpUnits2 = units _group2
_count2 = count _GrpUnits2
~6
?((_count1)+(_count2) =< _UnitsLeft): Goto "Concequences"
goto "CountByAll"

#CountByOneGroup
_GrpUnits1 = units _group1
_count1 = count _GrpUnits1
_GrpUnits2 = units _group2
_count2 = count _GrpUnits2
~6
?(_count1)< _unitsLeft: goto "Concequences"
?(_count2)< _unitsLeft: goto "Concequences"
goto "CountByOneGroup"

#CountByAllGroups

_GrpUnits1 = units _group1
_count1 = count _GrpUnits1
_GrpUnits2 = units _group2
_count2 = count _GrpUnits2

~6
?(_count1 < _unitsLeft and _count2 < _unitsLeft): goto "Concequences"
goto "CountByAllGroups"

#Concequences

_parameters exec _script

exit


the Idea is that when the casualties grow high enough, another group will be flewn in by a chopper (another script...)  ;)

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:What am I doing wrong? PART 2562
« Reply #1 on: 26 Sep 2004, 16:23:35 »
Try:

_group = [_this] select 0
_UGRP = units _group
_count = count _UGRP
TitleText [Format["Count: %1", _count],"Plain Down"]



Planck
I know a little about a lot, and a lot about a little.

Offline Peter_Bullet

  • Members
  • *
  • "The evil that men do lives on and on"
Re:What am I doing wrong? PART 2562
« Reply #2 on: 26 Sep 2004, 17:39:11 »
It didn't work but thanks... :)

How ever I tried it again the old way, and it worked... There might be something wrong with XP, I think... :(

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:What am I doing wrong? PART 2562
« Reply #3 on: 26 Sep 2004, 18:20:25 »
I actually tried the version I posted and it works fine on my machine.

It returned .....  Count: 9

It was a group of 9.....so it worked fine here.


Planck
I know a little about a lot, and a lot about a little.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:What am I doing wrong? PART 2562
« Reply #4 on: 26 Sep 2004, 18:57:34 »
You get that error message when the the variable, in this case _count, is not defined properly.    I'm with Planck, it looks right. .... I suspect there is a stupid little typo or something somewhere.   And make sure you are calling the script correctly with the name of an existing group.
Plenty of reviewed ArmA missions for you to play

Offline Peter_Bullet

  • Members
  • *
  • "The evil that men do lives on and on"
Re:What am I doing wrong? PART 2562
« Reply #5 on: 27 Sep 2004, 09:19:37 »
I checked it for typos... And the group does exist! The weird part is, that the upper script works, the below one doesn't... :(

But thanks quys! :)

Offline Peter_Bullet

  • Members
  • *
  • "The evil that men do lives on and on"
Re:What am I doing wrong? PART 2562
« Reply #6 on: 27 Sep 2004, 09:52:45 »
FUCK ME!  ;D

There was no typo, only one thing I didn't know!

I defined the group and executed the script in the same line (init line of the group leader), and that way it doesn't seem to work! ;)
« Last Edit: 27 Sep 2004, 16:19:08 by Epeli »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:What am I doing wrong? PART 2562
« Reply #7 on: 27 Sep 2004, 11:56:58 »
I didn't know that either, but it is the sort of thing that happens with init lines.
Plenty of reviewed ArmA missions for you to play

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:What am I doing wrong? PART 2562
« Reply #8 on: 27 Sep 2004, 19:38:02 »
Emmmmmm.........When I tried it on my machine I also defined the group and ran the script from the leaders init line.

All worked beautifully.


Planck
I know a little about a lot, and a lot about a little.