Jump to content
Nixx57

Controlled by AI

Recommended Posts

Hello,

 

I search the command (if it exists), to give the control of the player to ia​. Especially when some player become AFK on the server. in short, I want a "Sleep Mode", a script that the player or admin can execute.

The only scripts that I found are "selectplayer" "selectnoplayer" but that's not what I'm looking. If it does not exist, is it possible to create it?

 

​thank you

 

P.S : sorry for bad english â€‹

​

Share this post


Link to post
Share on other sites

There is no command availible to my knowledge on how to do that. However, you could spawn down an AI at the players position, give it all the items and such from what the player has and make it join the group the player was in. Then you could attach the player to the AI and make them invisible so they basically will see the AI in third or first person. Add a key or mouse event handler for input and once there is input, get rid of AI and put player back in game, visible and whatnot. I can point you to reference commands to do these things if you need.

Share this post


Link to post
Share on other sites

Yes, being a beginner in scripting it would help me a lot thank you, I'm not even sure of success

Share this post


Link to post
Share on other sites

You will need

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

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

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

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

https://community.bistudio.com/wiki/BIS_fnc_saveInventory- and of course the loadInventory on same page

https://community.bistudio.com/wiki/group- and a few of the commands listed on that page as well

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

This is very possible to do. Would be a good script to struggle and learn with to learn how to script in Arma. I wish you luck and happy coding!

There is only one small quirk that can happen. When a player is hidden, they still have collision applied to them. I think there is a command to disable collision, but I'm sure you can worry about that later. Also, be sure to have a plan for when and if the AI dies or gets wounded (is have player get same damage as AI, and have to respawn if AI is dead, or not punish player and put them back as they were at AI last pos)

Share this post


Link to post
Share on other sites

Thank you very much, I'll try it

Share this post


Link to post
Share on other sites

 Finally, it's a bit too hard for me. I am still a beginner who modifies existing script. You think that there is someone who would be interested in this project? There's there a heavy workload?

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

×