Jump to content

Recommended Posts

I would like to know how to script the functionality of sitting up from a chair when there's a target object (namely an enemy) for the initialization script in particular or otherwise if need be. Please state the specific steps required to complete these actions, because I'm new to scripting, and as much as I would like to learn how to do it, I simply don't have that much time to dedicate.

Share this post


Link to post
Share on other sites
47 minutes ago, Commander Salamander said:

 as much as I would like to learn how to do it, I simply don't have that much time to dedicate.

just my opinion:

If u would like to learn it then u would take the time to do so. You would ask specific problems while showing your scripting tries and you would get answers and maybe get working code for ur problems. Sure your progresse would be much slower than it would be with just copy/paste someone elses code. But the problem is that most guys which help in this forum have their own projects they are scripting on. And why should they take the time to script something for u if u r not willing to learn something?

You could try those link given by grumpy but I ve doubts that u ll get what u want there if u dont have a very interesting project where some guys like to get part of it or if u don't just pay for it.

Here in this forum u ve mostly to pay for help as well. Not with money but with showing ur interest...

As I said thats only my opinion and anyways sometimes some guys answer to those threads with a copy and paste code. Everyone does as he likes. Like me. I'm writing such nonsense instead of scripting on my own projects ;-)

  • Like 1

Share this post


Link to post
Share on other sites
16 hours ago, Grumpy Old Man said:

Dude, in all of your recent posts you state you don't have time to dedicate to scripting.

Since this forum is about scripting and editing discussions you're simply in the wrong place for such a request.

 

Better ask for someone to script for you there instead.

 

Cheers

Thank you for the transfer suggestion; I'll do that now.

Share this post


Link to post
Share on other sites
15 hours ago, sarogahtyp said:

just my opinion:

If u would like to learn it then u would take the time to do so. You would ask specific problems while showing your scripting tries and you would get answers and maybe get working code for ur problems. Sure your progresse would be much slower than it would be with just copy/paste someone elses code. But the problem is that most guys which help in this forum have their own projects they are scripting on. And why should they take the time to script something for u if u r not willing to learn something?

You could try those link given by grumpy but I ve doubts that u ll get what u want there if u dont have a very interesting project where some guys like to get part of it or if u don't just pay for it.

Here in this forum u ve mostly to pay for help as well. Not with money but with showing ur interest...

As I said thats only my opinion and anyways sometimes some guys answer to those threads with a copy and paste code. Everyone does as he likes. Like me. I'm writing such nonsense instead of scripting on my own projects ;-)

I understand your opinion, but I command & recruit the troops of, create the missions for, manage all the training of men in an entire unit. I'm willing to learn it, it's simply that I have so many other responsibilities that it would be difficult for me because I've went to other threads and didn't understand much of what was said because I don't understand much about scripting.

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

I already scripted this. I wanted to know how to enable the person sitting on the chair to stand up if there's an enemy contact so that he can engage said contact.

Share this post


Link to post
Share on other sites

Just read again the links. I took time, like some others to write notes/remarks for that.

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, pierremgi said:

Just read again the links. I took time, like some others to write notes/remarks for that.

Sorry about that. I was honestly quite exhausted at the end of the day yesterday, and my mind wasn't functioning at it's best. Thank you for the link to the scripts; I'll attempt to use as is or edit them for my purposes.

Share this post


Link to post
Share on other sites

I added a script ( [_unit,"STAND","FULL",{(player distance _this) < 5}] call BIS_fnc_ambientAnimCombat; ) to the soldier's initialization sitting in the chair who I wanted to be able to stand if he was to become aware of an enemy contact, but he did nothing when I spawned the contact in. Must I replace _unit with a reference to him, namely his initialization name, and/or do I need to replace the _this with the distance of how far away the contact is in meters?

Share this post


Link to post
Share on other sites
3 hours ago, Commander Salamander said:

I added a script ( [_unit,"STAND","FULL",{(player distance _this) < 5}] call BIS_fnc_ambientAnimCombat; ) to the soldier's initialization sitting in the chair who I wanted to be able to stand if he was to become aware of an enemy contact, but he did nothing when I spawned the contact in. Must I replace _unit with a reference to him, namely his initialization name, and/or do I need to replace the _this with the distance of how far away the contact is in meters?

 

Take a closer look at the input parameters of BIS_fnc_ambientAnimCombat.

The fourth parameter is the condition that frees the AI from the animation.

 

{(player distance _this) < 5}

Means the unit will only return to its normal state if the player is within 5 meters.

 

{behaviour _this isEqualTo "COMBAT"}

Could do what you want.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
20 hours ago, Grumpy Old Man said:

 

Take a closer look at the input parameters of BIS_fnc_ambientAnimCombat.

The fourth parameter is the condition that frees the AI from the animation.

 


{(player distance _this) < 5}

Means the unit will only return to its normal state if the player is within 5 meters.

 


{behaviour _this isEqualTo "COMBAT"}

Could do what you want.

 

Cheers

I added (to the initialization script):

{behaviour _this isEqualTo "COMBAT"}

The person sitting in the chair didn't do anything when the enemy contact was spawned within 5 meters of him.

Share this post


Link to post
Share on other sites

With bis_fnc_ambientAnimCombat, you don't need any condition to free the sat unit. This unit is able to shift in combat mode then quit the anim by its own. That's the main difference with bis_fnc_ambientAnim.

  • Like 1

Share this post


Link to post
Share on other sites
On 6/9/2017 at 11:37 PM, pierremgi said:

With bis_fnc_ambientAnimCombat, you don't need any condition to free the sat unit. This unit is able to shift in combat mode then quit the anim by its own. That's the main difference with bis_fnc_ambientAnim.

I understand, but I have the script for both functions, but yet the person who's sitting on the chair doesn't react to enemies in his vicinity.

[this,"SIT1", "ASIS", arrow1] call BIS_fnc_ambientAnim;
[_unit,"STAND","FULL",{(player distance _this) < 5}] call BIS_fnc_ambientAnimCombat;
{behaviour _this isEqualTo "COMBAT"}

I presume that some changes need to be made to the script that I pasted. The top line of script was copied from the video about sitting on a chair.

Share this post


Link to post
Share on other sites

You should read BIKI also.

[this,"STAND","FULL"] call BIS_fnc_ambientAnimCombat;

in the init field of first unit. You can add: (player distance _this) < 5 as added condition.

 

[this,"SIT2"] call BIS_fnc_ambientAnim;
0 = this spawn {waitUntil {behaviour _this == "combat"};
_this call BIS_fnc_ambientAnim__terminate;};

in the init field of the second one

 

Note: Here <this> is the global variable referring to the unit itself. That works in init fields of units. I don't know where your _unit is defined. Probably nowhere. So, that can't work without more script.

The behavior of units are working regardless with the animation. So, if an enemy is detected, the behavior will shift in combat mode. The ambient anim combat are made to quit automatically the animation, the simple ambient anim need the little script I wrote in this case.

 

  • Like 1

Share this post


Link to post
Share on other sites
On 6/13/2017 at 0:11 AM, pierremgi said:

You should read BIKI also.

[this,"STAND","FULL"] call BIS_fnc_ambientAnimCombat;

in the init field of first unit. You can add: (player distance _this) < 5 as added condition.

 

[this,"SIT2"] call BIS_fnc_ambientAnim;
0 = this spawn {waitUntil {behaviour _this == "combat"};
_this call BIS_fnc_ambientAnim__terminate;};

in the init field of the second one

 

Note: Here <this> is the global variable referring to the unit itself. That works in init fields of units. I don't know where your _unit is defined. Probably nowhere. So, that can't work without more script.

The behavior of units are working regardless with the animation. So, if an enemy is detected, the behavior will shift in combat mode. The ambient anim combat are made to quit automatically the animation, the simple ambient anim need the little script I wrote in this case.

 

What do you mean "the init field of the first unit" and the "init field of the second one"? I honestly don't understand that. I'm programming this for one unit, so that if an enemy unit reaches it's vicinity then it will stand up and engage.

Share this post


Link to post
Share on other sites
1 hour ago, Commander Salamander said:

What do you mean "the init field of the first unit" and the "init field of the second one"? I honestly don't understand that. I'm programming this for one unit, so that if an enemy unit reaches it's vicinity then it will stand up and engage.

Just 2 examples. I'm not in front your scenario. I imagined you placed two units, first stand, second sat.... Do what you want with one of the 2 functions. Don't mix them.

  • Like 1

Share this post


Link to post
Share on other sites

I used the second script, and the result was partially successful because the scripted unit engaged the contact that I spawned, but he was sitting in the ground with half of his body submerged beneath the surface instead of being sat on the chair. Is there any way that the unit could be kept sat in the chair, but he will still engage if there is an enemy contact?

Share this post


Link to post
Share on other sites

I presume that you've intentionally stopped responding to my messages? If so, then I'm not angry, but rather disappointed. I thought that we were soon to achieve what I wanted in my mission. If it's true, then an explanation at the very least must be given to some extent.

Share this post


Link to post
Share on other sites
2 hours ago, Commander Salamander said:

I presume that you've intentionally stopped responding to my messages? If so, then I'm not angry, but rather disappointed. I thought that we were soon to achieve what I wanted in my mission. If it's true, then an explanation at the very least must be given to some extent.

 

Nothing must be given. People are on this forum in their spare time, so are you I assume.

You stated that you didn't have much time to invest in mission making, still others helped out and invested their own time to help out.

Nothing to be disappointed about.

 

As with most things in life, if you want to achieve something you need to invest time and work to either gain skills or knowledge to do what you want.

You can skip this part but then you'd have to rely on others which I'm sure didn't intentionally stop responding.

 

What a bold assumption.

 

Cheers

Share this post


Link to post
Share on other sites

@ commander salamander. I just read last comments.

1. This is a public topic, not a private mail.

2. As far as my suggests and links i gave worked for me, I don't have anymore idea. I don't feel in charge of any other result  than what I wrote.

3. Always take time to "stick" step by step, at tutorials/scripts in vanilla before trying your own version. Usually, bad tutos or scripts are quickly commented by some others. I suggest you look again at the video. Perhaps your cyan pointer is not right placed on chair.

Share this post


Link to post
Share on other sites

I think I'll just avoid scripting as a unit leader considering that you need to dedicate so much time into developing your knowledge of scripting, which for a few functions simply isn't worth doing. Thank you for your effort, but all I came to realize is that it's complicated and gets me nowhere with just following the instruction. I just think that it's odd that I didn't receive any constructive comments for 8 days, but then when I ask why then I receive 3 consecutive comments in quick succession on the same day.. Why didn't you just say that you gave up? I would have understood that, but I just dislike it when people don't respond with the simplest comment and I assume that at least one of you saw my comment over the course of more than a week; therefore, you would have intentionally not responded because you saw the comment. I also didn't say I was angry at any of you, only disappointed because the result wasn't achieved. If you asked why I made this comment almost a month afterwards, my response would be it doesn't really matter because the actual purpose of the thread died when I asked that "bold" question.

Share this post


Link to post
Share on other sites
1 hour ago, Commander Salamander said:

I think I'll just avoid scripting as a unit leader considering that you need to dedicate so much time into developing your knowledge of scripting, which for a few functions simply isn't worth doing. Thank you for your effort, but all I came to realize is that it's complicated and gets me nowhere with just following the instruction. I just think that it's odd that I didn't receive any constructive comments for 8 days, but then when I ask why then I receive 3 consecutive comments in quick succession on the same day.. Why didn't you just say that you gave up? I would have understood that, but I just dislike it when people don't respond with the simplest comment and I assume that at least one of you saw my comment over the course of more than a week; therefore, you would have intentionally not responded because you saw the comment. I also didn't say I was angry at any of you, only disappointed because the result wasn't achieved. If you asked why I made this comment almost a month afterwards, my response would be it doesn't really matter because the actual purpose of the thread died when I asked that "bold" question.

 

Try your luck in the offer and editing section of the forum.

 

Cheers

Share this post


Link to post
Share on other sites

Only in the world of code is getting one's ass off a chair a monumental task -- both ingame and out.

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

×