Home   Help Search Login Register  

Author Topic: Joining hostage to player group in coop.  (Read 2920 times)

0 Members and 1 Guest are viewing this topic.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Joining hostage to player group in coop.
« on: 11 Nov 2002, 21:14:46 »
??

This is driving me nuts. I'm pretty sure this is just another bug in OFP that I'm going to have to work around, but perhaps some of you more experienced MP gurus have some knowledge to drop upon me.

I have a coop hostage rescue mission, and when the leader of the group gets to within 5 meters of the hostage some lovey dovey "thank for rescuing me" - "no problem" dialougue ensues, and the hostage is command to join the player group - Only, MOST OF THE TIME, the hostage does not join the group when the leader has a high ping (100 or above). Sometimes the hostage does join, but it's rare.

Here's how the scripting is set up (sort of). "w6" is the hostage.
Code: [Select]
@(leader gw1) distance w6 < 5
w6 say "thanksblahblah"
~5
(leader gw) say "yourwelcomeblahblah"
~4
?player == (leader gw1):[w6] join gw1

It's not that code doesnt run...it allways runs. Here is how it plays out.

The leader says: 7..follow..1!
(the hostage then appears in the player group!)
The hostage says: 7..READY!
After that, the hostage disappears fromt he group!!
 :-\

It happens almost every damn time! This also happens even when I let the join code run on every player's computer,a nd not just the leader's. It amkes no firggen difference how I do it. I even had a trigger do the joining, and that gave the exact same results! :'(

As of now, I have workaround enabled. When the hostage first joins the group a message appears saying, that if the hostage failed to join the group then can use the radio to manually amke him rejoin. The radio fix works, but it should not be neccesary!! >:(

Once they reach the hostage, the group has no time to dilly dally with radio commands and whatnot, as the various highly skilled emeny patrol groups are hot on their trail and not in a very nice mood. :o

One thing I could do is just make a simple follow script that makes the hostage follow the group, but that would suck. Does anyone have any ideas? ???  
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Joining hostage to player group in coop.
« Reply #1 on: 12 Nov 2002, 01:19:22 »
In my latest mission, i've made 2 pilots joining the group
of the players. It's also a coop mp mish. I've been using
the waypoints of a gamelogic for that joining stuff + pilots
goin for their weapons, before joining the squad.
I have only been testing it on a client server with 3 players
on --> worked fine (hell we could even respawn into those
pilots).
I haven't tried it on a dedicated server yet, but my experience
told me, that it would work even better on the dedie'.

That problem with them not appearing in the group, could
be caused by running a mission on a client server, and not
the host player being the squad leader (this is one of the
reasons, why mucho things not workin fine).

Here's how i did it:

There i placed two individual pilots inside a barn.

I turned them to be captive, just the usual way (init field).

Both with a careless waypoint right on top of them.

The waypoints of both units i syncronized with a distance
checking trigger (workin better in mp than area checking triggers) -
condition: "_x distance pil1 < 10" count (units jkgrp) > 0 OR "_x distance pil2 < 10" count (units jkgrp) > 0
OnActivation: i've used to set their captive state to false

The next waypoints were leading them to a crate (remember:
they were still individual units, so i'm always talking about waypoints), and i used their activation fields to simulate the
pilots takin their weapons back.
Also these two waypoints i've syncronized with the first waypoint of a gamelogic, and the second wp of the gamelogic
i've used it's activation field for my joining stuff.
[pil1,pil2] join leader jkgrp


Maybe you're asking yourself now; "why does he tell me that,
i know how to make them join?"

I'm just telling you that, so that you can compare, where's
the difference in the technique here.

I've been trying that as Host player and as client player, as
group leader, and as a lower squad member. Everytime it
worked fine (v.185 btw).
What i can't tell you now is: i can't remember, how the ping
situation was looking like.

Once i get feedback of my squad-members (i gave the mission
for beta-testing to them, to be released this weekend), i can
tell you, how it worked on the dedicated server, where you
can be sure, there will be 100+ pingers from time to time.

hope this helps anyway

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Joining hostage to player group in coop.
« Reply #2 on: 12 Nov 2002, 03:26:57 »
The testing I have done is on a Dual T-1 dedicated server, with mostly 56k'ers playing (180-400 pings). It ALLWAYS works on a LAN or local machine. I've come to learn that just because it works on a lan or local machine doesn't mean it won't blow up on you when you put it out in the wild. :P

I'm gonna try running the join code only on the server and see if that might fix it.

« Last Edit: 12 Nov 2002, 03:31:20 by toadlife »
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Joining hostage to player group in coop.
« Reply #3 on: 12 Nov 2002, 04:36:09 »
Hmm... interesting...

Have you tried the syntax:

[ Hostage ] join group

rather than:

[ Hostage ] join unit ?

ie. give the group of players a name then tell the hostage to join the group?

Worth a try I reckon ;)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Joining hostage to player group in coop.
« Reply #4 on: 12 Nov 2002, 04:40:35 »
Yeah toadlife, i know what you mean, but what i mean is:

The difference between a dedicated server, and a client server.

With client server, i mean: where the host pc is also a player pc.

And this client server is also one of the reasons, why things
go wrong in mp. Very often, the host player is required to
have a trigger become activated on his pc, so that it works for
the others too.

OK, by your last post, i figured out, you're already testing on
a dedicated server (where all players are equal because they're all clients).

But again i'd suggest you to try different ways.

I've noticed a lot of times now, that there were different
results, depending on how i tried to activate one and the
same effect (by radio-call, by gamelogic's waypoint, by unit's
waypoint, trigger with radius, trigger with special condition,
etc.)

The point i want to hit here is: some events will be transmitted different to other events.

Just one more example:

a trigger with a condition:
"_x distance object < 200" count (units mygroup) > 0

works always more precise in mp, than trying to get the
same thing by using a trigger with the center on top of
the object, radius: 200/200 - activation: west/present
(or shall it be grouped to the squad).

If you display the same message out of the two triggers,
there will be different results.

I've noticed, that trigger 1 displays the message onto all
screens, while the second one displays them only to local
screens (in this case i mean with local: players, who are
present in that trigger area).

:note - this doesn't happen everytime, but in some cases
it does (it depends also on the technique, you're using to
display that message).

LOL, why am i bothering you here with that client server stuff,
when you're at all testing on a dedi' server  :D

No, just tried to clarify, what i did mean with my first reply.


~S~ CD
« Last Edit: 12 Nov 2002, 04:43:53 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Joining hostage to player group in coop.
« Reply #5 on: 12 Nov 2002, 06:50:39 »
Hmm... interesting...

Have you tried the syntax:

[ Hostage ] join group

Thats how I do it:

[w6] join gw1

gw1 is the player's group
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Joining hostage to player group in coop.
« Reply #6 on: 12 Nov 2002, 09:11:08 »
Oh... so you do... my mistake ;)

@(leader gw1) distance w6 < 5
w6 say "thanksblahblah"
~5
(leader gw) say "yourwelcomeblahblah"
~4
while "not (hostage in gw1)" do {[ hostage ] join gw1}

??
:)

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Joining hostage to player group in coop.
« Reply #7 on: 12 Nov 2002, 21:40:33 »

while "not (hostage in gw1)" do {[ hostage ] join gw1}

??
:)

I have a feeling, that piece of code would REALLY blow everything up! :P

One of the first things I tried was a little loop that went like this:

Code: [Select]
#join
[w6] join gw1
?!w6 in (units gw1):goto "join"


The results were:

7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1
7 follow 1

....and on, and on, and on, and on, and on…forever, until I exited the mission.

I tried running the code on just the server last night and nothing happened. The code definitely has to be run on the leader of the group's machine.

Here is what I think it happening:

* Join code runs on leaders machine, and the hostage appears in the group.

* The leader's machine sends a packet to the server telling the server that the hostage had joined the group, and to relinquish control of the hostage.

* The UDP packet get dropped (as many do!), and the server never gets the message.

* A second later, the server updates the group leader with the status of the units that are non-local, and as a result of the packet being dropped, control of the hostage is retained by the server, and therefore, the hostage disappears from the group.



Last night I tried this piece of code, and it worked! - But I need to test it some more.

Code: [Select]
#join
[w6] join gw1
~6
?!(w6 in (units gw1)):goto "join"


With the delay, the group leader and the server have time to get on the same page. I think that the server has to know that the hostage has joined the leader's group before the player can actually take control of the hostage.

With the long delay, the player will have time to receive a response from the server and know if the "transaction" was successful.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Joining hostage to player group in coop.
« Reply #8 on: 13 Nov 2002, 01:44:50 »
Yes that was going to be my next suggestion... the delay... ;)

I figured that while do loop was worth a shot, though I knew one of the possible outcomes was the infinite join situation:

7 follow 1
7 follow 1
7 follow 1
7 follow 1
...

MP scripting can be so nasty some times...
At least you got it sorted ;)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Joining hostage to player group in coop.
« Reply #9 on: 13 Nov 2002, 02:07:29 »
Yep, it seems, the problem occured because of a similar reason to what i was trying to tell you here. Sorry for not comming up with the solution itself.  ::)

Since resistance came out, i can't test multiplayer stuff
anymore on my lan (my 2nd pc is an old p3 700, and i  suppose resistance will end up in a dia show there).

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Joining hostage to player group in coop.
« Reply #10 on: 13 Nov 2002, 02:47:44 »
You can at least run a dedicated server on your old pIII 700 for testing purposes - no cd is needed and it's completely legal (isn't it?). Thats what I do with my old Athlon 750. :)

Resiatance ran ok on my athlon 750 too, though the graphics has to be turned down just a bit.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Joining hostage to player group in coop.
« Reply #11 on: 13 Nov 2002, 09:34:58 »
good idea (that dedicated server on my second one)

I'll go for that.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Joining hostage to player group in coop.
« Reply #12 on: 14 Nov 2002, 17:35:00 »
Guess I'll solve this one. The resoultion I came up with seems to work. Usually it only takes the script two tries to join the hostage, which is still annoying, buy hey that's OFP MP for ya!

The solution you described may actually work better than mine Chris (the one about using gamelogics and waypoints and triggers). I might try something like that too, but right now, It really aint broke, so I don't think I will try very hard to fix it.

 :) :D ;) ;D :cheers: :toocool: :thumbsup: :booty:
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.