Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACE_Explosives_fnc_scriptedExplosive #3621

Closed
C0RAX opened this issue Mar 24, 2016 · 6 comments
Closed

ACE_Explosives_fnc_scriptedExplosive #3621

C0RAX opened this issue Mar 24, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@C0RAX
Copy link

C0RAX commented Mar 24, 2016

Arma 3 Version: x.xx (stable / rc / dev)
CBA Version: 2.x.x (stable / dev + commit hash)
ACE3 Version: 3.x.x (stable / dev + commit hash)

Mods:

  • CBA_A3
  • ACE
  • RHS
  • UOMODS
  • UOMAPS
  • UOMAPSCUP
  • ACRE

Description:

  • when using "call ACE_Explosives_fnc_scriptedExplosive;" as described on the aCE3wiki the function gives an error(Error Undefined variable in expression: _dettime) line 6.

full script code:
"_ied = _this select 0;

        waitUntil {
                sleep 0.5;
                {((_x distance _ied < 10)) and (side _x == west) } count allUnits > 0;
            };
            [[_ied],1] call ACE_Explosives_fnc_scriptedExplosive;

"

Steps to reproduce:

  • place "ACE_IEDUrbanBig_Range"
  • the placed ied has "null = [this] execVM "scripts\ied.sqf";" in the init field.
  • uses above script code in ied.sqf
  • approach ied till triggered

Where did the issue occur?

  • Editor (Singleplayer)

Placed Modules:

  • none

RPT log file:

@commy2
Copy link
Contributor

commy2 commented Mar 24, 2016

The function is meant to be executed in unscheduled environment.

Try replacing:
[[_ied],1] call ACE_Explosives_fnc_scriptedExplosive;
with:
[ACE_Explosives_fnc_scriptedExplosive, [[_ied],1]] call CBA_fnc_directCall;

@commy2 commy2 self-assigned this Mar 24, 2016
@C0RAX
Copy link
Author

C0RAX commented Mar 24, 2016

Works great, thank you for the prompt response.

would ask for this to be added and documented in the wiki as it's not immediately clear that it wont work in a scheduled environment.

@C0RAX C0RAX closed this as completed Mar 24, 2016
@nicolasbadano
Copy link
Contributor

@C0RAX, scheduled environment is plain unreliable because, depending on the load your mission is having, the executed code may be interrupted at any moment. That's why ACE runs 95% of it's code in non-scheduled environment.

Best practice would be to always call ACE API on non-sched (and the same for ACRE, TFAR, etc). You are right we should document that.

@bux
Copy link
Member

bux commented Mar 24, 2016

@esteldunedain I think @C0RAX is referring to this wiki page:
http://ace3mod.com/wiki/missionmaker/useful-functions.html

Yeah, it should be documented there or a better example should be used there.

@jonpas jonpas added this to the 3.6.0 milestone Mar 29, 2016
@jonpas
Copy link
Member

jonpas commented Mar 29, 2016

Reopening for #3633

@jonpas jonpas reopened this Mar 29, 2016
commy2 added a commit that referenced this issue Mar 29, 2016
make FUNC(scriptedExplosive) work in scheduled env, ref #3621
@commy2
Copy link
Contributor

commy2 commented Mar 29, 2016

fixed in #3633

@commy2 commy2 closed this as completed Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants