Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: How to skip intros on reconnect/player arrive late

  1. #1
    This is the way i do it, might be anothers.

    If a player arrives late in the mission or reconnects, if the Intro was "ON" he shouldnt be forced to watch it all over again. So the way to do this is to tell ARMA that guy has arrived late.

    On init.sqs file place the following code:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if &#33;&#40;local Server&#41; then {exit}

    onPlayerConnected &#34; publicVariable &#34;&#34;missionstarted&#34;&#34;&#34;;
    [/QUOTE]

    And in intro, where you set the parameters, have something like this:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?&#40;param1&#41; == 1 AND missionstarted = false &#58; goto &#34;start&#34; else goto &#34;end&#34;
    ?&#40;param1&#41; == 0&#58; goto &#34;end&#34;;[/QUOTE]

    Where #start is where camera coding begins and #end where it ends... obviously.

    In the mission place a trigger set condition to "TRUE" with a countdown of 10 seconds or more, depends of your choice. In trigger, on activation, set the condition "missionstarted" to true, like this:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">missionstarted = true; PublicVariable &#34;missionstarted&#34;;[/QUOTE]

    and the player wont see the intro after 10 seconds in the mission.

    The onplayerconnected is very usefull to publicize the state of the variables to the late commers players. It really helps on intros, and i believe it has much more utility on other type of missions.

    Hope this is helpfull




  2. #2
    Quote Originally Posted by (Lolsav @ Jan. 10 2007,15:07)
    ...
    Nice m8 and thanks for Sharing...

    But a few things are loose ends to me:[*] onPlayerConnected "STATEMENT"; This will execute STATEMENT when a player is connected... I do not understand why you put ""missionstarted"" in there, as it will merely try to execute the boolean &#39;missionstarted&#39; (which is either true or false) and that is not possible as it is not code or string, but a boolean so as far as I know... it should be: onPlayerConnected "publicVariable ""missionstarted""";
    [*] Why waste a trigger while you can do a: sleep 10; missionstarted = true; publicVariable "missionstarted";
    in the init.sqf after if(&#33;local server)exitwith{};
    [*] on a side note: go SQF m8, really, why not go 100% to the newer, optimized format

    Since it is working anyway either says that just placing ""variable"" ***in the onPlayerConnected function, will in fact publicVariable ""variable""
    or that variables that have been made public before (publicVariable "variable") .. will be synced to joining in clients, automaticly...
    or that the outcome of triggers since the game started, are synced to clients while joining, but I see that as a small chance and a weird setup if that&#39;s true.


    Just trying to understand it Don&#39;t shoot me



    A.C.E. Advanced Combat Environment

    Dev-Heaven.net Free Project Hosting | A2 Community Issue Tracker Help BIS, Help yourself!

  3. #3
    Sergeant
    Join Date
    Jan 30 2002
    Location
    Portugal
    Posts
    186
    Author of the Thread
    Dont shoot me either, i had made a "copy paste" from my init and skiped the Publicvariable

    Was fixed on main post

  4. #4
    Okidoki ))


    BTW... I personally feel that intro&#39;s are supposed to run for anyone, even if they join later.
    This is of coarse a problem... in the way we are used to make intro&#39;s in the sqs/sqf scripts... but I think that if you would setup such intro in the "Intro" part of the game (In the editor you can choose if you wish to edit the intro, outro or mission itself)... then you would be able to show the intro to everyone as I guess that intro parts are built and played sort-of-&#39;locally&#39; and as such ur not starting at already blown up, moved etc. etc. vehicles (the problem you get when using the intro-in-the-mission part ), what&#39;s ur opinion/findings?

  5. #5
    Sergeant
    Join Date
    Jan 30 2002
    Location
    Portugal
    Posts
    186
    Author of the Thread
    Old issue Sickboy. Sincerely didnt even tryed it on Arma. In OFP the intro/outros in editor would not work in multiplayer, was designed for singleplayer only.




  6. #6
    Quote Originally Posted by (Lolsav @ Jan. 10 2007,15:48)
    Old issue Sickboy. Sincerely didnt even tryed it on Arma. In OFP the intro/outros in editor would not work in multiplayer, was designed for singleplayer only.
    I know it was in OFP, but I didn&#39;t know that there it didn&#39;t work in Multiplayer...

    I&#39;ll share my info if I tested it, will you do the same?

  7. #7
    Sergeant
    Join Date
    Jan 30 2002
    Location
    Portugal
    Posts
    186
    Author of the Thread
    Sure.. but i just cant do it now.. off to work. Anyway i dont really believe its diffrent in Arma.

  8. #8
    Master Sergeant HitmanFF's Avatar
    Join Date
    Oct 9 2002
    Location
    Breda (Netherlands)
    Posts
    631
    I&#39;ve taken roughly the same approach as stated in the opening post, apart from the trigger in the mission. I&#39;ve taken the first @camCommited in the intro (taking place some 5 seconds after start of the intro), and set the missionstarted=true after that.

    If a player connects during the intro (or even if someone has a slow system), the player may skip the intro while the others still have to wait for it to finish, which might give an advantage in being able to start early (obviously depending on the duration of your intro). Because of this I&#39;ve also added a introfinished public var, which will get set at the end of the intro. I&#39;ve then added
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?&#40;missionstarted&#41; and &#40;&#33;introfinished&#41;&#58; goto &#34;WAIT&#34;
    .
    .
    .
    #WAIT
    @introfinished
    .
    .
    exit
    [/QUOTE]
    so you still have to wait for the (fastest system&#39;s) intro to finish.

    At the end of the intro you&#39;ll of course get <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">introfinished = true; publicVariable &#34;introfinished&#34;[/QUOTE]



    Bellum pacis pater

  9. #9
    Sergeant
    Join Date
    Jan 30 2002
    Location
    Portugal
    Posts
    186
    Author of the Thread
    Quote Originally Posted by (HitmanFF @ Jan. 10 2007,16:33)
    I&#39;ve taken roughly the same approach as stated in the opening post, apart from the trigger in the mission. I&#39;ve taken the first @camCommited in the intro (taking place some 5 seconds after start of the intro), and set the missionstarted=true after that.
    Let me see that was a clever solution HitmanFF. But i do wonder if the time is the same for all players in that case. Why i make the question is simple: for my understanding all cutscenes are always local to clients, not to Server, therefor the time where your variable becomes true it will be diffrent on all clients.

    I went to the trigger solution because it was the first i rememberd of, not because it was the optimal solution. But, since its a trigger inside the mission, and its early in mission (hence no desynch at all), when the trigger becomes true it will send the condition of true/false at same time for all clients, right? Therefor i prefer my way, because i feel its more reliable.

    In my years of OFP ive learned a hard lesson: "Logic its not applyable to multiplayer behaviour or choppers"

  10. #10
    Staff Sergeant
    Join Date
    Jan 25 2002
    Location
    Manchester, GB
    Posts
    348
    How did you finally get this working. I have tried with a trigger set to gamelogic not present, that makes intro = 1; then set it to pubvar. then at the end of a intro, the Gamelogic is moved into the trig area, therefore anyone connecting later, the intro start trig would be false, i also set the intro var back to 0 when i move the gamelogic.

    Any help would be great, as i have a 2 1/2 min intro, which i dont want to see when i spawn into the middle of a fire fight.

    Cheers

    GC

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •