Forum Jump :

Author Message


Posts: 16
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-10-27 09:21        
     
Hello everyone. Here comes my first post ever here. Yikes.

I am making a simple hostage freeing feature in my coop mission. The idea is that the hostage can be either found or if not, a countdown trigger makes the task available in any case. I have solved all the problems regarding it until now. During alpha testing with my friends we realized that the action added in the hostage's init is available to every player separately in time and place.

There seems to be two problems which are basically the same:

1. How to make countdown trigger global?
AND
2. How to make addAction global?

The code in trigger:

journalist addAction ["Free the journalist", "free = 1"]

I did some research on this, but I didn't find any solution for a feature simple as mine. Apparently a function BIS_fnc_MP has been used, but some folks say it has been outdated by the new remoteExec command. I have no idea how to use the latter in this context.

In addition to this I would like to ask about making tasks global for the playable side, but it can wait.

EDIT: To be a little more exact, it seemed as though the countdown trigger executes it's activation commands in different time with every player. I assume this, because the radio chatter and change in tasks occur in different time for every player. Also, if the players come across the hostage by themselves, the Free the journalist action is available no matter if someone has already activated it.

This post was edited by coolrobot (2016-10-27 09:31, 361 days ago)


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#2 Posted at 2016-10-27 10:09        
     
I don't know how you have your trigger set up, but my guess is that the timeout time randomizes differently on each players computer. What you can do is make the trigger server only (should be a checkbox for it), and then run add the action with remoteExec. It whould look like this:
[journalist, ["Free the journalist", {free = 1}]] remoteExec ["addAction", 0, true];

The "free" variable in the addAction looks like a bad way to free the hostage though. Where do you use that variable?

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 16
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2016-10-27 17:17        
     
# 654wak654 : I don't know how you have your trigger set up, but my guess is that the timeout time randomizes differently on each players computer. What you can do is make the trigger server only (should be a checkbox for it), and then run add the action with remoteExec. It whould look like this:
[journalist, ["Free the journalist", {free = 1}]] remoteExec ["addAction", 0, true];

The "free" variable in the addAction looks like a bad way to free the hostage though. Where do you use that variable?

Thank you, the server only check in the trigger options will surely solve that one problem.

The "free" variable is being used in another trigger which then commands the following:

journalist setCaptive false;
journalist playmovenow "acts_executionvictim_unbow";
[journalist] remoteExec ["removeallActions", 0, true];
journalist enableAI "MOVE";
[journalist] joinsilent player;
hint "The journalist is in our custody. Order a pick up for him.";
chopper = 1

What do you think about it? I would love to hear any advice.


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#4 Posted at 2016-10-27 22:53        
     
Hi,
If your journalist is an AI, not belonging to any group of any player, it's a unit owned by server. This can be fine.
You don't have to remoteExec the addaction if the code is in the unit init field.
On the other hand, you can avoid to multiplicate triggers using the addaction condition parameter. See BIKI.
Usually you don't need anything else. Condition can be a check for distance, or what you want.
If you use a variable like free (free = 1), I don't know why, because you can write the script instead, keep on mind this little code (free = 1) is available for the local computer only. Each time you need to synchronize a variable on each clients, you need to publicVariable them, as far as you change its value in a local computer:
free = 1;
publicVariable "free";

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 16
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2016-10-30 18:03        
     
Thank you Pierre MGI.

I made some changes so that now the Free the journalist action runs a script called journalist.sqf. The script does the following:

journalist setCaptive false;
journalist playmovenow "acts_executionvictim_unbow";
removeAllActions journalist;
journalist enableAI "MOVE";
[journalist] joinsilent player;
hint "The journalist is in our custody. Order a pick up for him.";
_nil = leader spetsnazteam execvm "helievac.sqf";

Do you think this would work properly, like globally?


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#6 Posted at 2016-10-30 18:30        
     
In MP, in a trigger, server only, try:

[journalist, ["Free the journalist", {
journalist setCaptive false;
journalist playmovenow "acts_executionvictim_unbow";
removeAllActions journalist;
journalist enableAI "MOVE";
[journalist] joinsilent player;
hint "The journalist is in our custody. Order a pick up for him.";
_nil = (leader spetsnazteam) execvm "helievac.sqf";
}]] remoteExec ["addAction", [0,-2] select isDedicated, true];

I guess some problems with the playmovenow and hint, but test that and tell what's wrong. It seems very difficult to remoteExec an animation. Above my skill.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 16
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2016-10-30 21:50        
     
# Pierre MGI : I guess some problems with the playmovenow and hint, but test that and tell what's wrong.

We played the mission through once. Multiple problems occurred. Number one was that the journalist had several Free the journalist actions in the menu. Weird. I assume this is because the countdown trigger is still working locally. Also not everyone received the radio chatter and someone lost all the tasks except the new journalist task. Both the task and the action becomes active either when the countdown ends or when the player finds the journalist.

EDIT: Also the team leader didn't see the fog which should be around for everyone. Perhaps personal video settings intervened?


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#8 Posted at 2016-10-31 12:09        
     
Can you try this in the hostages init? Think it'll do the job.

this addAction ["Free the journalist", {
    {
        journalist setCaptive false;
        journalist playMoveNow "acts_executionvictim_unbow";
        journalist enableAI "MOVE";
        [journalist] joinSilent player;
    } remoteExec ["call", journalist];
    {
        removeAllActions journalist;
        hint "The journalist is in our custody. Order a pick up for him.";
    } remoteExec ["call", [0, -2] select isDedicated, true];
    (leader spetsnazteam) execvm "helievac.sqf";
}];

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 16
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name:

 
#9 Posted at 2016-10-31 17:30        
     
# 654wak654 : Can you try this in the hostages init? Think it'll do the job.

Will try. What exactly happens here:

remoteExec ["call", [0, -2] select isDedicated, true];


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#10 Posted at 2016-10-31 18:30        
     
Just a SP / MP mission compatibility with addAction, which doesn't work on dedicated server. remoteExec enabling all clients + hosted (if any) to run the code, true for JIP.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#11 Posted at 2016-10-31 18:41        
     
Exactly what happens there is, we make the code to the left side of the remoteExec run on either every machine, or (every machine - dedicated server) if there is a dedicated server. The true at the end makes the code run for jip players, so that the "free hostage" action is removed, and the hint is shown.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage