Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Recommended Posts

I've been looking around and trying everything I can to no avail. There are tons of places where you can find out how to make AI sit but none that really tell the player. I want to spawn into my mission sitting on a camping chair. I called the camping chair,....well,....chair. LOL I just can't seem to find the script to place in the player init so he will be seated when starting the mission.

Thanks!

Share this post


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

I don't know what the anim names are for sitting though so you'd have to find them in the config viewer yourself or from someone else's input.

Open the functions viewer and for each dropdown on the left side choose...

  • ConfigFile
  • A3
  • Ambient

Then from the list the appears choose ambientAnimGetParams. In the right window you will now see a switch statement with all the anim types you can choose for BIS_fnc_ambientAnim and the animations it uses for each type e.g

case "SIT1": //<< BIS_fnc_ambientAnim anim type
	{
		_anims = ["HubSittingChairA_idle1","HubSittingChairA_idle2","HubSittingChairA_idle3","HubSittingChairA_move1"]; //<< animations used by type
		_attachOffset = -0.5;
		_attachSnap = 2;
		_noBackpack = true;
	};

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

So that I'm clear, I am porting this mission and I have no scripting knowledge. Here are the steps I've taken so far.

I have placed a chair close to my spawn point. (about 2 feet, +/-)

I have given that chair a variable name of "chair"

Here is the existing text that is in the player init

 

stext = format ["PILGRIMAGE\nby Rydygier",[]];this setvariable ["tpw_bleedout_nodeath",1];this moveinDriver RYD_JR_boat

 

I have looked here as this might be what I am looking for

https://community.bistudio.com/wiki/BIS_fnc_ambientAnim

I chose the example #2 but when I paste that in addition to the existing player init data I get an error that says

init:local variable in global space

 

I have also seen somewhere in my search a line of text that has a place where I can insert the name "chair" but I think it was a mod for making AI sit, found here.

http://www.armaholic.com/page.php?id=22145

 

If I add the data found in the BI Wiki, (example #2) am I simply missing a script text,....and will it work if it is entered correctly?

I just don't know enough to fiddle with it to make it work.

 

Thanks again!

Share this post


Link to post
Share on other sites

....

 

 

Edited by major-stiffy
Deleted ... Due to I got in OP's safe space

Share this post


Link to post
Share on other sites
Quote

init:local variable in global space

 

Instead of _unit place the actual name of the unit, you want to sit on the chair, for example RYD_JR_Alex. Or just this if you paste this code into init field of that unit. Note, that function uses in general same way, I talked about in the PM, but is much more robust and with some fancy additions. 

 

BTW nice function, wasn't awared about it. Tested this code:

 

[this,"SIT2"] call BIS_fnc_ambientAnim;

 

in the init field of the player positioned at the camping chair, and it works just fine, but player is stuck there. So you need later to use code like this:

 

player call BIS_fnc_ambientAnim__terminate;

 

to free him. 

 

 

Share this post


Link to post
Share on other sites

×