Jump to content
KaanE

Altis Life 5.0 Action Error

Recommended Posts

Error Log:

Quote

 0:35:33 Error in expression <tVariable["playerSurrender",false,true];_unit setVariable["missingOrgan",false,t>
 0:35:33   Error position: <_unit setVariable["missingOrgan",false,t>
 0:35:33   Error Undefined variable in expression: _unit

Setupactions.sqf:

Quote

// take them organs
 life_actions = life_actions + [player addAction["Take Organ",life_fnc_takeOrgans,"",0,false,false,"",'!isNull cursorTarget && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && alive cursorTarget && cursorTarget distance player < 3.5 && !(cursorTarget getVariable ["missingOrgan",FALSE]) && !(player getVariable "Escorting") && !(player getVariable "hasOrgan") && !(player getVariable "transporting") && animationState cursorTarget == "Incapacitated"']];

Thank you...

Edited by KaanE

Share this post


Link to post
Share on other sites

Try this action as it's a little more up to date now:

 life_actions pushBack (player addAction["Take Organ",life_fnc_takeOrgans,"",0,false,false,"",'!isNull cursorObject && {cursorObject isKindOf "Man"} && {(isPlayer cursorObject)} && {alive cursorObject} && {cursorObject distance player < 3.5} && {!(cursorObject getVariable ["missingOrgan",FALSE])} && {!(player getVariable "Escorting")} && {!(player getVariable "hasOrgan")} && {!(player getVariable "transporting")} && {animationState cursorObject isEqualTo "Incapacitated"}']);

But the error itself seems to be with the actual script you ran and not the action. Pastebin your "fn_takeOrgans.sqf".

Edited by imthatguyhere
  • Like 1

Share this post


Link to post
Share on other sites

I try 

Error:

 0:04:52 Error in expression < cursorObject isEqualTo "Incapacitated"'}]);life_actions=life_actions+[player ad>
 0:04:52   Error position: <}]);life_actions=life_actions+[player ad>
 0:04:52   Error Missing ]
 0:04:52 File core\fn_setupActions.sqf [life_fnc_setupActions], line 2
 0:04:52 Error in expression < cursorObject isEqualTo "Incapacitated"'}]);life_actions=life_actions+[player ad>
 0:04:52   Error position: <}]);life_actions=life_actions+[player ad>
 0:04:52   Error Missing ]
 0:04:52 File core\fn_setupActions.sqf [life_fnc_setupActions], line 2

Share this post


Link to post
Share on other sites
18 hours ago, KaanE said:

I try 

Error:

 0:04:52 Error in expression < cursorObject isEqualTo "Incapacitated"'}]);life_actions=life_actions+[player ad>
 0:04:52   Error position: <}]);life_actions=life_actions+[player ad>
 0:04:52   Error Missing ]
 0:04:52 File core\fn_setupActions.sqf [life_fnc_setupActions], line 2
 0:04:52 Error in expression < cursorObject isEqualTo "Incapacitated"'}]);life_actions=life_actions+[player ad>
 0:04:52   Error position: <}]);life_actions=life_actions+[player ad>
 0:04:52   Error Missing ]
 0:04:52 File core\fn_setupActions.sqf [life_fnc_setupActions], line 2

There was a bracket out of place slightly, I fixed it in an edit. But as said:

On 2/19/2019 at 9:47 AM, imthatguyhere said:

But the error itself seems to be with the actual script you ran and not the action. Pastebin your "fn_takeOrgans.sqf".

 

Share this post


Link to post
Share on other sites

But as I said:

On 2/22/2019 at 10:37 AM, imthatguyhere said:

But as I said:

On 2/19/2019 at 9:47 AM, imthatguyhere said:

But the error itself seems to be with the actual script you ran and not the action. Pastebin your "fn_takeOrgans.sqf".

Please stop ignoring that and:

Pastebin your "fn_takeOrgans.sqf".

Share this post


Link to post
Share on other sites
17 hours ago, KaanE said:

Since the script uses an addaction, it already passes the target, you don't need the cursorTarget. It seems like the cursorTarget was failing even though the action worked as it said "_unit" was undefined.

Try this:

params [
    ["_target",objNull,[objNull]],
    ["_caller",objNull,[objNull]],
    ["_actionID",-1,[5]]
];

if (isNull _target) exitWith {}; //if unit is null, than NO
if ((_target getVariable ["missingOrgan", false])) exitWith {}; //must not be missing organ already
if ((player getVariable ["hasOrgan", false])) exitWith {}; //thief must not have already robbed an organ within last 5 minutes
if !(animationState _target isEqualTo "Incapacitated") exitWith {}; //victim must be knocked out
if (player isEqualTo _target) exitWith {}; //if the thief is the cursor target(dafuq) than NO
if !(isPlayer _target) exitWith {}; //iff the cursor target is not a player than NO
if (life_inv_kidney >= 2) exitWith {hint "1den fazla böbrek taşıyamazsın!"}; //if you already have 2 kidneys, then go sell them already, no stockpiling
if !([true, "kidney", 1] call life_fnc_handleInv) exitWith {hint "Üstünüzde yer kalmamış!"}; //if no room for kidney, you cannot take their kidney, duh, waste not want not

life_action_inUse = true; //sets action to true as to prevent kidney spammming!!!!!!!!
player setVariable["hasOrgan", true, true]; //sets variable on thief, so as not to consistently take organs, set to 5 minute cooldown
player playMove "AinvPknlMstpSnonWnonDnon_medic"; //makes the thief do an animation as to seem like they are doing surgery
sleep 3;//length of action, had weird results with any higher - obv not realistic, but whatever
_target setVariable["missingOrgan", true, true]; //sets the missing organ variable so effects can take place
life_action_inUse = false; //once variables are set, and actions stop, then you can use scrolly wheely
[player] remoteExec ["life_fnc_hasOrgan", _target]; //this then calls the fn_hasOrgan.sqf on the thief

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...