Jump to content
empleat100

editing trigger - on activation error: missing ;

Recommended Posts

I am trying to get working cas effect module: 

 

 

When i paste this line in trigger to on activation window: cas = _group createUnit ["ModuleCAS_F",_pos , [], 0, ""]; 

I get error: missing ";". 

I have no idea what is wrong, i tried to google this, but it finds nothing. I get this error a lot.

Any ideas what is wrong ?

Share this post


Link to post
Share on other sites

If this is the full code in your triggers on activation box, then your code does not know what _group and _pos is. 

These are local variables an must be defined within your code or passed into it.

Basically that code does not know what group you want to assigne it to and where you want to spawn it. 

Share this post


Link to post
Share on other sites

I forgot to enter name of my module instead of CAS: cas = _group createUnit ["ModuleCAS_F",_pos , [], 0, ""];

But now i am getting error: global variable at local scope, while i am not using _ 

And no it is not my code, i don't know what to set for position. Because in this video is just said to connect cas module with trigger and paste that line.

Share this post


Link to post
Share on other sites
2 hours ago, empleat100 said:

I forgot to enter name of my module instead of CAS: cas = _group createUnit ["ModuleCAS_F",_pos , [], 0, ""];

But now i am getting error: global variable at local scope, while i am not using _ 

And no it is not my code, i don't know what to set for position. Because in this video is just said to connect cas module with trigger and paste that line.

in triggers (correct me if im wrong) you cannot use local variables(variables starting with _) so _group and _pos are going to give you errors

  • Like 1

Share this post


Link to post
Share on other sites

Problem it doesn't work even without underscores: cas = group createUnit ["ModuleCAS1_F",pos , [], 0,""];

 

Share this post


Link to post
Share on other sites
2 hours ago, empleat100 said:

Problem it doesn't work even without underscores: cas = group createUnit ["ModuleCAS1_F",pos , [], 0,""];

 

group is not a variable. you need to create a group for the unit to be in, such as myGroup = createGroup east; and then use myGroup. same thing with pos, have you defined pos?

  • Like 1

Share this post


Link to post
Share on other sites

Strange that guy has it like that and it is working and i don't think he has set anything aside.

 

I found out you can call it with radio, which can be specified under trigger. 

But sometimes i would like to time it out when i enter trigger zone. So just create group like you said in init.sqf,  my cas module already has position, but i didn't find specific command pos. Which syntax is for that - "pos [x, y]" ? So i just put [x, y] after pos command ? I don't know why i need position, given it is synced with trigger.

Share this post


Link to post
Share on other sites
On 9/28/2019 at 12:43 PM, empleat100 said:

Strange that guy has it like that and it is working and i don't think he has set anything aside.

 

I found out you can call it with radio, which can be specified under trigger. 

But sometimes i would like to time it out when i enter trigger zone. So just create group like you said in init.sqf,  my cas module already has position, but i didn't find specific command pos. Which syntax is for that - "pos [x, y]" ? So i just put [x, y] after pos command ? I don't know why i need position, given it is synced with trigger.

because it needs to know where to create the unit and it needs a position. you can get the position of the trigger if thats what you want? if not you can simply place down some markers and use getMarkerPos "markerName" where you see _pos. i would recommend you simply create a function that you can call for this for simplicity and so you dont have to deal with global variables where they are not needed

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

×