Jump to content
Sign in to follow this  
Aodan

Code error on arma2 editor

Recommended Posts

When i try to create a code in the conditions or on act, in a trigger or unit, (I.E: !(alive T1) && !(alive T2) && etc etc....) it gives me something like this: "Type, Bool expected, nothing". Ummmm....What?! Please help and tell me what im doing wrong.

Share this post


Link to post
Share on other sites
When i try to create a code in the conditions or on act, in a trigger or unit, (I.E: !(alive T1) && !(alive T2) && etc etc....) it gives me something like this: "Type, Bool expected, nothing". Ummmm....What?! Please help and tell me what im doing wrong.

Hi,

For the Trigger try:

? !alive T1 and !alive T2 etc

Don't think you can do this in a Units ini though

Share this post


Link to post
Share on other sites

Yes i know, but even when i do that, it tells me "Type bool, expect nothing. is that its way of telling you "You messed up"?

Share this post


Link to post
Share on other sites
Yes i know, but even when i do that, it tells me "Type bool, expect nothing. is that its way of telling you "You messed up"?

HI, Aodan

Sorry it was my error, just leave out the "?"

!alive T1 and !alive T2

And yes its telling you that you have made an error in your code.

Also, you cannot use it in a Units ini.

Share this post


Link to post
Share on other sites

First:

a condition like: !(alive T1) && !(alive T2) && etc.

has to go into the condition field of a trigger (or waypoint).

Second: Are you sure there is only one thing named T1?

Or did you probably use T1 = false (or true) somewhere else or

did you put 'T1' or so into a condition field of another trigger?

The error message says that there is a boolean which is some

kind of condition that you can turn on or off by making it true or

false. So then the message tells you that !(alive 'a boolean') is more

than expected.

Therefore i do believe that you somewhere in your mission used one

of the T1 T2 etc. names already and thus the error appears.

If you can't find out try a simple test mission to get that part done

seperately so you can concentrate your effort only onto that one.

Start with one unit to get destroyed, name it: T1

create a trigger: size 0/0 - condition: !alive T1

onActivation: hint "horray he's got doomed"

Now start preview, kill that unit and watch the hint text appear.

Go back to editor, add a second unit, name it T2

and change the condition of the trigger from: !alive T1

into: "alive _x" count [T1,T2] == 0

And if you want to add more units just go on by naming them correctly

and adding them into the array in the trigger's condition field:

into: "alive _x" count [T1,T2,etc,etc] == 0

Now if that doesn't work for you too i can only guess your trying to

use this for something like a static object instead of a unit.

~S~ CD

Share this post


Link to post
Share on other sites

Thanks alot! it works perfectly now, and i know now that i must really suck at typing it out because i get that error almost every time! but now i know what ive down wrong. thanks!

---------- Post added at 06:58 PM ---------- Previous post was at 06:42 PM ----------

I guess the Arma2 community is alot more helpful than Flashpoint, all i got there was "Screw you"

Share this post


Link to post
Share on other sites

Actually i'm comming from Flashpoint and am just starting my way back in

with ArmA 2 (skipped ArmA 1 after a month or two trying to like it) so you might

have only met the wrong people at the wrong time. ;)

~S~ CD

Share this post


Link to post
Share on other sites

Wait, do i include the " in "alive _x"?

---------- Post added at 07:11 PM ---------- Previous post was at 07:10 PM ----------

Hmmm.... i see. yeah i guess so. flash point wasnt as glitchy as arma (or so i think), but i didnt think it had a very "dedicated" support community.

---------- Post added at 07:13 PM ---------- Previous post was at 07:11 PM ----------

Also, its saying "string, un expected code". another typing error on my part maybe?

Share this post


Link to post
Share on other sites

I don't quite understand what you mean with " in "alive _x".

Looke there's more ways to check wether a couple of units

is alive or not.

Here are a two of them;

Condition: !alive T1 && !alive T2 && !alive T3

:now this way can afford a lot of unnecessary code

being repeated in case of more units

Condition: "alive _x" count [T1,T2,T3] == 0

:this condition checks if the result of counting the units

inside the mentioned array ([T1,T2,T3]) who are alive, is 0.

This is totally the other way around then asking for 'not alive'

but it requires way less code to type.

:edit - never mind - i figured out what confused you ;)

into: "alive _x" count [T1,T2] == 0

That should off course be only: "alive _x" count [T1,T2] == 0

:)

~S~ CD

Share this post


Link to post
Share on other sites

@Chris Death

I presume he means that "other" Flashpoint. :D

Because the community of the original FP was and still is very helpful - if you don't ask too obvious questions.

@Aodan

"alive _x" does not work in ArmA/ArmA2 anymore, instead you now must use {alive _x}.

Share this post


Link to post
Share on other sites

Hmmm.... its still giving me the string code error and the cursor is moving back to behind the "Count" in the code. im not sure whats wrong either,i've copied and pasted, and typed it out.

---------- Post added at 07:35 PM ---------- Previous post was at 07:33 PM ----------

:O it works! thank you so much everyone!

Share this post


Link to post
Share on other sites

huh - yeah there is that other Flashpoint too XD

Tanks for correcting me on the "" W0lle didn't encounter

that change yet since there's still so much to explore

in ArmA2.

Glad to see you solved that problem Aodan :)

~S~ CD

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×