Jump to content
Sign in to follow this  
AKMARK5000

GENERIC ERROR IN EXPRESSION

Recommended Posts

I'm working on one of my first missions on TANOA.  So, I'm sorta new to ARMA 3 Editing.  I'm at the stage where I'm placing down the enemy AI.  To make them stay standing when attacked,  I'm entering the following code into the attributes init box of the enemy AI...    

 

this setUnitPos "UP"   

 

The above is the correct syntax, right?  When I play the scenario from the editor I get a general expression error...

 

RQP1kku.png

 

I checked all the AL for scripting mistakes but everything seems typed-in ok.  Also, I exported to my MPmissions and gave hosted the .pbo on my LAN... no error.  

 

I know I might not get an outright solution but ...any ideas as to why I get the error in the editor?

Share this post


Link to post
Share on other sites

I'm just a noob scripter, but do you need this "call{ ... }" part at all? Using "this setUnitPos "UP";" should do fine?

  • Like 1

Share this post


Link to post
Share on other sites

Curious about that too, are there any guides/websites that suggest doing this?

 

It does not work since "this" is a magic variable, only working in some special cases.

Also it's being used inside another scope caused by the call command with no input parameters.

So you could either do this:

this call {_this setUnitPos "UP"};

Which is nonsensical since this does the same:

this setUnitPos "UP";

as long as both are inside the objects init field.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

I had call {... } included itself a few weeks ago into some trigger on activation codes. I went through and removed them all but i didn't know why it happened and it hasn't happened since. I thought it might've been CBA but i can't back that up with any confidence. 

Share this post


Link to post
Share on other sites

Oh, yeah. I remember that. Noticed it too in my mission. Was thinking it came from CBA as well, after I disabled it. Not 100% sure, though, and not really feeling motivated to test that again.

Share this post


Link to post
Share on other sites

I solved it! ... I think.

 

For each unit (there were only 20), I went into the attributes and enabled the "playable" option box... told ya I was a noob.  Anyway, I tried it again... no more error.  

 

Thanks for the ideas.

Share this post


Link to post
Share on other sites

Wait, you turned the enemy ai to "playable"? That means the player character can take control of them at any time.

Share this post


Link to post
Share on other sites
3 hours ago, lexx said:

Wait, you turned the enemy ai to "playable"? That means the player character can take control of them at any time.

 

 

Is that wrong? ....it got rid of the error... but I see your point.   It changes the concept of my map... I'll untick the "playable" option for the enemy and see if the error comes back... later I'll do this because I have a few medical appointments today.

Share this post


Link to post
Share on other sites
On 8/1/2017 at 9:49 AM, Lucullus said:

I can reproduce the error only in the context of a group.


^^ the only correct explanation of the problem. OP put the command in init of the group and not the unit. And call {this setUnitPos "UP"} works just fine, because this exists in every child scope until the end of init execution

  • Like 2

Share this post


Link to post
Share on other sites
8 hours ago, killzone_kid said:


^^ the only correct explanation of the problem. OP put the command in init of the group and not the unit. And call {this setUnitPos "UP"} works just fine, because this exists in every child scope until the end of init execution

 

Ok, so I unticked "playable" option.... and ungrouped them... problem resolved and solved... thanks to all for the help.

 

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  

×