Jump to content
Sign in to follow this  
Necropaulo

From SelectRandom to Select

Recommended Posts

Hi everyone, today I've got a nice "conversion" problem. I'm using a script to allow me to chat with civilians, and everything's working perfectly, but for the purposes of a mission, I'd like to manage to convert the first part by removing the randomness. The first 5 conversations should only be played once each. I've tried playing with Select instead of SelectRandom but I haven't managed to change the syntax to make it work.

 

Does anyone have any ideas on how I can do this?

 

Below is the script I'm using:

 

intero.sqf :

Spoiler

if (missionNamespace getVariable "civil" )

 

    then {  _rNum = selectRandom [1,2,3,4,5];

 

if ( _rNum == 1 ) then { line1 = [name player, "Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je ne suis pas certains mais il me semble que l'US Army avait un avant poste au Château du Diable."];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero51", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["US",true,true];
{_x setMarkerAlpha 1} foreach ["US"];
};

 

if ( _rNum == 2 ) then  { line1 = [name player, "Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je me rappelle que durant la guerre civile des mercenaires s'étaient installés par ici, ION je crois bien."];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero52", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["ION",true,true];
{_x setMarkerAlpha 1} foreach ["ion"];
};

 

if ( _rNum == 3 ) then  { line1 = [name player, "Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je sais que la guerre est finie mais la base des forces chernarusse est encore bien active en ce moment !"];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero53", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["Cherna",true,true];
{_x setMarkerAlpha 1} foreach ["Rus"];
};

 

if ( _rNum == 4 ) then  { line1 = [name player, "4Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je sais que la guerre est finie mais la base des forces chernarusse est encore bien active en ce moment !"];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero53", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["boat",true,true];
{_x setMarkerAlpha 1} foreach ["boat2"];
};

 

if ( _rNum == 5 ) then  { line1 = [name player, "5Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je sais que la guerre est finie mais la base des forces chernarusse est encore bien active en ce moment !"];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero53", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["heli",true,true];
{_x setMarkerAlpha 1} foreach ["heli2"];
};
}


    else {  _rNum = selectRandom [1,2];

if ( _rNum == 1 ) then { line1 = [name player, "Bonjour, nous sommes là pour vérifier que tout va bien dans votre ville, avez-vous vu ou entendu quelque chose ?",u1];
line2 = ["Civil", "Bonjour, merci de vous soucier de nous, le climat actuel est tendu mais tout va bien par ici."];
line3 = [name player, "Merci à vous, bonne journée!",u1];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero1", true];
sleep 7;
playSound ["intero21", true];
sleep 7;
playSound ["intero3", true];};

 

if ( _rNum == 2 ) then  { line1 = [name player, "Bonjour, nous sommes là pour vérifier que tout va bien dans votre ville, avez-vous vu ou entendu quelque chose ?",u1];
line2 = ["Civil", "Bonjour, votre présence me rassure mais je n'ai rien d'intéressant à vous signaler."];
line3 = [name player, "Merci à vous, bonne journée!",u1];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero1", true];
sleep 7;
playSound ["intero22", true];
sleep 7;
playSound ["intero3", true];};
};

 

The part in blue is the one I want to transform, the variable allows me to switch to the two random conversations once the first 5 have been triggered. Thanks in advance for your advice!

 

EDIT:

 

After a lot of tests and a lot of mistakes, I finally found a track. I've run out of errors but nothing happens (the script for the conversation and the variable and marker changes). I'll keep looking tomorrow!

 

_text1 = { line1 = [name player, "Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je ne suis pas certains mais il me semble que l'US Army avait un avant poste au Château du Diable."];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero51", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["US",true,true];
{_x setMarkerAlpha 1} foreach ["US"];
};

_text2 = { line1 = [name player, "Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je me rappelle que durant la guerre civile des mercenaires s'étaient installés par ici, ION je crois bien."];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero52", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["ION",true,true];
{_x setMarkerAlpha 1} foreach ["ion"];
};

_text3 = { line1 = [name player, "Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je sais que la guerre est finie mais la base des forces chernarusse est encore bien active en ce moment !"];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero53", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["Cherna",true,true];
{_x setMarkerAlpha 1} foreach ["Rus"];
};

_text4 = { line1 = [name player, "4Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je sais que la guerre est finie mais la base des forces chernarusse est encore bien active en ce moment !"];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero53", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["boat",true,true];
{_x setMarkerAlpha 1} foreach ["boat2"];
};

_text5 = { line1 = [name player, "5Hey vous, je cherche des informations sur des sites militaires, ça vous dit quelque chose ?", player];
line2 = ["Civil", "Je sais que la guerre est finie mais la base des forces chernarusse est encore bien active en ce moment !"];
line3 = [name player, "Merci pour l'information!",player];
[[line1,line2,line3],"Direct",0.06,false] execVM "fn_simpleConv.sqf";
playSound ["intero4", true];
sleep 7;
playSound ["intero53", true];
sleep 7;
playSound ["intero6", true];
sleep 1;
missionNamespace setVariable ["heli",true,true];
{_x setMarkerAlpha 1} foreach ["heli2"];
};

 [_text1,_text2,_text3,_text4,_text5] select [0,1,2,3,4];

 

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
Sign in to follow this  

×