Jump to content

Recommended Posts

I am trying to make an animation for an execution, for some reason, when I try to execute a sequence of animations, it gives me an error and just plays the last one, here is my code:
 

shooter switchMove "Acts_Executioner_Kill";
shooty switchMove "Acts_ExecutionVictim_Kill";
sleep 1.733;
shooty switchMove "Acts_ExecutionVictim_Kill_End";
sleep 2.7;
shooty switchMove "Acts_ExecutionVictim_KillTerminal";

Shooter being the executioner, and shooty being the victim. What it does now for some reason, it just starts playing Acts_execution_KillTerminal emote without anything above
And gives me "Error generic error in expression"

Share this post


Link to post
Share on other sites
On 7/10/2021 at 6:41 PM, sarogahtyp said:

Show the complete error message copy/pasted from .rpt file!

 

Edit:

https://community.bistudio.com/wiki/Crash_Files#Location

 

But I guess there could be an invisible character on the position of the hashtag (or maybe the < sign) in the error message.

20:16:22 Suspending not allowed in this context
20:16:22 Error in expression <witchMove "Acts_ExecutionVictim_Kill"; 
sleep 1.733; 
shooty switchMove "Acts_Ex>
20:16:22   Error position: <sleep 1.733; 
shooty switchMove "Acts_Ex>
20:16:22   Error Generic error in expression
20:16:22 Suspending not allowed in this context
20:16:22 Error in expression <hMove "Acts_ExecutionVictim_Kill_End"; 
sleep 2.7; 
shooty switchMove "Acts_Exec>
20:16:22   Error position: <sleep 2.7; 
shooty switchMove "Acts_Exec>
20:16:22   Error Generic error in expression

Here is how rpt file looks like

Share this post


Link to post
Share on other sites
Quote

Suspending not allowed in this context

this is the important information...

 

You are using a suspension method (sleep in this case) in an unscheduled environment. This is not allowed as you can read in the biki entry of Scheduler.

 

Therefore you have to ensure that your code runs scheduled. You can achieve that with a simple spawn:

private _dummy = [] spawn 
{
 shooter switchMove "Acts_Executioner_Kill";
 shooty switchMove "Acts_ExecutionVictim_Kill";
 sleep 1.733;
 shooty switchMove "Acts_ExecutionVictim_Kill_End";
 sleep 2.7;
 shooty switchMove "Acts_ExecutionVictim_KillTerminal";
};

 

  • Like 1

Share this post


Link to post
Share on other sites
On 7/11/2021 at 8:27 PM, sarogahtyp said:

this is the important information...

 

You are using a suspension method (sleep in this case) in an unscheduled environment. This is not allowed as you can read in the biki entry of Scheduler.

 

Therefore you have to ensure that your code runs scheduled. You can achieve that with a simple spawn:


private _dummy = [] spawn 
{
 shooter switchMove "Acts_Executioner_Kill";
 shooty switchMove "Acts_ExecutionVictim_Kill";
 sleep 1.733;
 shooty switchMove "Acts_ExecutionVictim_Kill_End";
 sleep 2.7;
 shooty switchMove "Acts_ExecutionVictim_KillTerminal";
};

 

Thanks it worked, any idea how to add sound to that?
Like:
 

private _dummy = [] spawn 
{
 shooter switchMove "Acts_Executioner_Kill";
 shooty switchMove "Acts_ExecutionVictim_Kill";
 sleep 1.733;
 playSound3D [getMissionPath "sound\exeshot.ogg", shooter, false, getPosASL _this, 5, 1, 0];
 shooty switchMove "Acts_ExecutionVictim_Kill_End";
 sleep 2.7;
 shooty switchMove "Acts_ExecutionVictim_KillTerminal";
};

Gives me generic error

Share this post


Link to post
Share on other sites

try to learn from what you read and restart here:

 

 

Share this post


Link to post
Share on other sites
40 minutes ago, marki980908 said:

 


private _dummy = [] spawn 
{
 shooter switchMove "Acts_Executioner_Kill";
 shooty switchMove "Acts_ExecutionVictim_Kill";
 sleep 1.733;
 playSound3D [getMissionPath "sound\exeshot.ogg", shooter, false, getPosASL _this, 5, 1, 0];
 shooty switchMove "Acts_ExecutionVictim_Kill_End";
 sleep 2.7;
 shooty switchMove "Acts_ExecutionVictim_KillTerminal";
};

 

 

getposASL _this? ....  _this is what?

  • Like 1

Share this post


Link to post
Share on other sites
On 7/16/2021 at 6:30 PM, pierremgi said:

 

getposASL _this? ....  _this is what?

Thanks, but I have solved it, I noticed it maybe 30 seconds after I started looking into logs. Thanks anyway, it worked perfectly, that code above does a pretty nice execution with sound and stuff, if you have ogg file

Share this post


Link to post
Share on other sites
On 7/16/2021 at 7:48 AM, marki980908 said:

Thanks it worked, any idea how to add sound to that?

This will work for the sound.  Its for the in-game .45 pistol.

_s = "a3\sounds_f\arsenal\weapons\pistols\4-five\4-five_01.wss"; 
_unit = shooty; 
playSound3D [_s,_unit, false, getPosASL _unit, 1.5];

 

Share this post


Link to post
Share on other sites
On 7/19/2021 at 6:30 PM, johnnyboy said:

This will work for the sound.  Its for the in-game .45 pistol.


_s = "a3\sounds_f\arsenal\weapons\pistols\4-five\4-five_01.wss"; 
_unit = shooty; 
playSound3D [_s,_unit, false, getPosASL _unit, 1.5];

 

I had a custom sound file, but yours is even better thanks!

  • Like 1

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

×