Home   Help Search Login Register  

Author Topic: Million $ question--What is _X  (Read 1286 times)

0 Members and 1 Guest are viewing this topic.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Million $ question--What is _X
« on: 03 Mar 2003, 09:37:56 »
well,
Ive tried and stumped so far.

OK so we all know we can get the _x distance right?

? ("_goodunit distance _x <= 40" count _bad_group > 0): goto "where_ever"

And we can check if its known about.

("_goodunit knowsabout  _x > 0.25" count _bad_group >0) : goto :where_ever"

Or we can check if _x is alive or probably more useful --if its not alive

("not (alive _x )" count _bad_group >0) : goto :where_ever"

HECK we can even string em all together which is very useful

? ("_goodunit distance _x <= 40 and alive_x and _goodunit knowsabout _x > 0.25" count _bad_group > 0): goto "where_ever"



 So how can we find out what _x is?:joystick:


I know you can do the counttype thing but I need it so I can fit it into the combination shown above. If counttype can be used in the string of checks (without a loop) plz let me know. ???

 if we can figure out whether _x is infantry or armour and slip it into that combination of knows about, distance and whether or or its alive then OMG that would be such a powerful script check.

We wouldnt have to have sub arrays of the enemy for infantry and armour.

WE wouldnt have to alter the sub arrays and checking which is alive, which can fire etc.

Hell it must be possible.

Actually, I think u can also check if _x can fire so why cant I find out what _x is. :-\


Comments o plz comments

BTW Im aware I could just create a sub array of just infantry from the  enemy global list IE _enemy = eastunits

 and then sift through the _enemy array and find all the "soldiers"

and then create the sub array _infantry.

 This works fine IF you dont have any create unit scripts or spawns.

Thats the issue--creating units makes it all turn to poos.

But I noticed if u only make a single local array  IE: _enemy = trigger list (eastunits) then all the above mentioned _X querries still work fine--even with respawned camcreated units.  

Sub arrays like the _infantry array need updating by removing the dead guys and adding them again when u creat unit them.

The script im working on works using this method  f amending the arrays in loops but that REALLY ALTERS performance causeI have fast loops that cant be slowed down (and yet require an array update within them.)

What I have done is put counters these fast loops so that the _infantry sub arrays are only updated after so many loops but it still drains the system.

Any way, if we can find out what _x is then itll Bye bye to all those friggin loops

Zay out
« Last Edit: 03 Mar 2003, 09:59:10 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Million $ question--What is _X
« Reply #1 on: 03 Mar 2003, 12:32:46 »
Ok some asked me wot actually is the question? lol so soz if it aint clear its complicated i know

OK main issue---------IS _x man or machine?





its for the trench warefare script  Im making so the mission maker doesnt have to worry about placing any triggers and such.

Basically Im having an issue with created units messing up my script cause I rely on the AI:

1-- knowing about _x
2--distance to _x
3--is _x alive

all at same time

? ("_crew1 distance _x <= 40 and alive_x and _crew1 knowsabout _x > 0.25 " count _infantry > 0): goto  "Holly_poos_Batman"

all above done by using   "_x ------ count _infantry >0"

but because  _infantry is a sub array of the total _enemy array it goes to poos with respawned units


HOWEVER------ If I dont make a sub array of _infantry and only run the above 3 checks on the _enemy array (which was made by _enemy = eastunits from a trigger list) then I dont have the problem. see below


? ("_crew1 distance _x <= 40 and alive_x and _crew1 knowsabout _x > 0.25 " count _enemy > 0): goto "Holly_poos_Batman"




The _enemy units die, they respawn and the above three checks continue to work fine.

NOW downside of that is----- because I havent made an _infantry array now I dont know if _x in the _enemy array is tank or soldier.

So if I decide to go down that track of not making a seperate _infantry array then Ill have to add a FOURTH check of "is _x infantry or machine"


? ("_crew1 distance _x <= 40 and alive_x and _crew1 knowsabout _x > 0.25 and man counttype [_x] > 0 " count _enemy > 0):goto "Holly_poos_Batman"


The first 3 work but not the  "man counttype"


This cause AI do diff things when over run by infantry as opposed to tanks.

Hope that makes sense.

Now if I can apply the FOURTH check of WHAT IS _X at the same time as the other above 3 checks all with the _enemy array (which includes all the armour and infantry) then problem is solved.


Hope thats made it a bit clearer

The script works at the moment but relies on each AI checking and altering its own local arrays of infantry and armour.

This sucks the CPU big time.

But it actually works quite well. im happy to post it to solve this issue but its HELLA complicated and full of rubbish code that im still playing with.

Zay out ;D
 
« Last Edit: 03 Mar 2003, 13:08:52 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Million $ question--What is _X
« Reply #2 on: 03 Mar 2003, 13:46:00 »
this may just be a typo in your post, but have you tried adding quotes

"man" countType [_x]

and why do you need [ ] round the _x when you don't have it for the others?  

'scuse my ignorance, syntax is not my strongpoint at the best of times and once there's an array involved, I've had it.

« Last Edit: 03 Mar 2003, 13:50:11 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Million $ question--What is _X
« Reply #3 on: 03 Mar 2003, 13:53:09 »
AWWWWWWW MAC :P

u beat me to it. I was just about to let a whoopee "I solved it!!"

well cheers for coming back and yup that right, actually I put {man} no diff me thinks.

counttype [_x] rather than  counttype _x ? Cause countype needs an array so u could put counttype _group (but of course I dont want a whole group) or  counttype [_group select 0]  (but if you did that youd have to know which in the group to select right?) or in this case the item _x get  selected for us by the count _enemy at the end ;D

so its  counttype [_x].  ;D

Well no more sub arrays , no more loops, no more adding and subtracting units from local arrays (cross fingers) now.

Bugger it Ill do it any how WHOOOOPPPPEEE

 ;D
« Last Edit: 03 Mar 2003, 14:13:35 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Million $ question--What is _X
« Reply #4 on: 03 Mar 2003, 13:56:32 »
OOOOOPPS NAH cant be "man" its gotta be {man}


WHOOOPPPEEEEEEE
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Million $ question--What is _X
« Reply #5 on: 03 Mar 2003, 13:59:53 »
 ;DOMG cant stop grinning, this has saved so much bullshit code it aint funny! ;D

  :booty:WHOOOOPPPPEEEEE :cheers:
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Million $ question--What is _X
« Reply #6 on: 03 Mar 2003, 14:12:00 »
meens u dont need ma help nymore ?

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Million $ question--What is _X
« Reply #7 on: 03 Mar 2003, 14:39:28 »
Quote
OOOOOPPS NAH cant be "man" its gotta be {man}
huh?

Isn't that the same thing?
Not all is lost.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Million $ question--What is _X
« Reply #8 on: 03 Mar 2003, 14:46:32 »
Nope not in this case --definately cant be "man"

causes an error

{man} works fine ;D

correct working syntax:

? ("_crew1 distance _x <= 40 and alive _x and  _crew1 knowsabout _x > 0.25 and {man} counttype [_x] > 0 " count _enemy > 0):goto "Holly_poos_Batman"




Zay out
« Last Edit: 03 Mar 2003, 14:53:42 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Million $ question--What is _X
« Reply #9 on: 03 Mar 2003, 14:53:41 »
"" = {} except sometimes

OFP at its very best  ;D

Glad you got it working m8


Edit:  duh-oh. of course ... the other commands all take object, not array.

*would hang head in shame except was first almost to solve question*
« Last Edit: 03 Mar 2003, 14:56:59 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Million $ question--What is _X
« Reply #10 on: 03 Mar 2003, 14:57:09 »
ah yes ok..  :P so maybe you can't have " " inside a " " in ofp  :D
Not all is lost.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Million $ question--What is _X
« Reply #11 on: 03 Mar 2003, 14:59:52 »
@ MAC LOL :booty:
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"