Home   Help Search Login Register  

Author Topic: Move / domove in MP  (Read 2349 times)

0 Members and 2 Guests are viewing this topic.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Move / domove in MP
« on: 19 Mar 2005, 05:51:09 »
Is there a way to get these commands to work in MP? Move / domove that is. Currently I am creating a group of units (which works fine), and then I give them a "move" command to get them to move (duh). Anyway, it works fine in the editor or when I run it on my computer in MP, but only when there is only 1 computer in the game! Basically, if I have my other computer play the mission with me, the command does not work. The command is only being run on the server, although I tried running it on all clients at the same time to no avail.

I did a search and found someone else had the same problem as me:
http://www.ofpec.com/yabbse/index.php?board=7;action=display;threadid=6309;start=0

Unforutnately, his thread wasn't ever solved either, so I'm guessing this won't go very far...

I have, however, found a workaround that seems to work just fine. In the editor I have units with "grpx = group this; deletevehicle this" in their init field, in order to reserve the group names of course. My workaround however, was to give those guys a single "cycle" waypoint. Then, instead of using the "move" command, I use the "setwppos" command like so:

[grp, 0] setwppos _wp

"0" is a waypoint that every group has, which is its very first WP (run before editor-placed ones). Normally this wp is at the groups starting location, and is completed immediately (and thus never repeated, even if moved). By putting a "cycle" wp right after that one, the group will continually repeat this first waypoint, which I then move around the map with the setwppos command.

Like I said, this seems to work, but I haven't tested it extensively. I suspect that this might not be the best solution, because when the group completes it's WP, and another setwpos command has not been issued, then I would think the cycle WP is just endlessly giving the group a move order to where they are standing. That is why I'd prefer to use the move command, if possible.

Anyone have experience with this?

BTW, I suspect I'm going to be flooding the s out of this forum soon, because I'm starting to get into MP editing, and I have a lot of questions like this about how a certain command works in MP.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Move / domove in MP
« Reply #1 on: 19 Mar 2005, 06:01:41 »
Okay, I take all the above back. Using "setwppos" does NOT work either. I mistakenly thought I was playing with clients on a server, but I was wrong.

There has to be a way to get this to work, right? I mean, CTI and other missions use dynamic waypoints, so HTF do they do it? I'll depbo the mission and try to find out, but there are a ton of scripts to sort thru...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Move / domove in MP
« Reply #2 on: 19 Mar 2005, 07:03:48 »
Okay, one more spamming...

I just ran a simple test mission where I create a unit and order him to move, all done on the server. It works fine! So I must be doing something wrong in my more complicated script for my real mission.

But what might I be doing wrong? It works fine when run from the editor... any ideas?
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Move / domove in MP
« Reply #3 on: 19 Mar 2005, 07:30:50 »
Interesting. I would also like to know the answer to this; happened to me acouple of times. Since then i kinda gave up on mp scripting

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Move / domove in MP
« Reply #4 on: 19 Mar 2005, 08:00:00 »
Just to throw a few more observations out here...

I just plopped VB's script dialog console into my mission, which is run locally on each computer thru an action. I was unable to get the group to move when issuing a "move" command to them from either one of my two computers.

An interesting thing I noticed, however, was that the GROUP I spawned these units into was non-existant on the non-server machine. Even though I created the group name in the unit's init field, which is supposed to be run on all clients, I thought. Perhaps the "deletevehicle" command deletes the unit on the server BEFORE the rest of the unit's init field is executed on the other clients? Would this somehow be messing up my move commands?

I thought I did the same thing in my simple test mission though... I'll have to go back and check that one with the console as well. More to come I suppose...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Move / domove in MP
« Reply #5 on: 19 Mar 2005, 13:16:12 »
Hey GB-man,

Here's some of my observations at BIS forums in a topic named JUST like this one  :o ;D
Not all is lost.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re:Move / domove in MP
« Reply #6 on: 20 Mar 2005, 17:46:29 »
I've had that problem in my mission where I create units to attack a base, and give them a move command, but they didn't move. They moved in preview and when I tested it in MP alone, but never when I played it with others. The solution I found was to give the group a move command, and the pos to move to was in coordinates. I gave the command to the group in the creation script, cause if I gave the group a name and moved them in another script, it didn't work.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Move / domove in MP
« Reply #7 on: 22 Mar 2005, 07:46:29 »
YES!!! YES!!! YES!!!
I FINALLY FIXED IT!!!

Anyway, the problem was the way that I was assigning group names. I placed a unit down, and put something like this in his init field:

Grp1 = group this; deletevehicle this

As I discovered earlier, Grp1 would be defined on the server, but NOT on the clients. I suspect that the vehicle gets deleted before it's init field is broadcast to all the clients in the game (so in this case, only the server "knows" that this group is Grp1).

So anyway, I made a simple script called "delete.sqs", which just waited a few seconds, then deleted the passed unit. This gave enough time so that the group was defined on all clients (I verified this with the console), and for some reason, THE MOVE COMMANDS NOW WORKED!!!

So I suppose the moral of the story is that the group name MUST be defined on ALL clients for Move commands to work. And this will NOT happen if you define the group AND delete the unit in the same init field. This would explain why some people seem to have no trouble with this command when run on the server (i.e. Artak), while others tear their hair out wondering WTF is going on.

I hope this helps other people in the future who are lucky enough to find it via search or referrals. :D
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Move / domove in MP
« Reply #8 on: 22 Mar 2005, 21:44:39 »
Anyway, the problem was the way that I was assigning group names. I placed a unit down, and put something like this in his init field:

Grp1 = group this; deletevehicle this

As I discovered earlier, Grp1 would be defined on the server, but NOT on the clients. I suspect that the vehicle gets deleted before it's init field is broadcast to all the clients in the game (so in this case, only the server "knows" that this group is Grp1).
It gets worse... :-) Actually, the deleteVehicle this call isn't what makes the group reference invalid on clients. It seems that

In MP, "Group variables" assigned in init lines of (manned) vehicles will only be valid on the machine where the unit in question is local.

By now, we all know that it's of no use to ask why. It's OFP... ::)

The general solution to this is to set group variable values in, say, the mission's init.sqs or a script started from there. Something like
Code: [Select]
Grp1 = group joe
Grp2 = group bill
Grp3 = group marie
and so on.

EDIT: this issue seems isolated to vehicle groups (eg a tank platoon), not groups of soldiers. Statement in bold above changed to reflect this.
« Last Edit: 23 Mar 2005, 14:13:54 by Killswitch »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Move / domove in MP
« Reply #9 on: 23 Mar 2005, 00:49:58 »
Are you sure about that? I'm assigning the group names thru the init fields (as stated above), and now the group is registering on all clients.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Move / domove in MP
« Reply #10 on: 23 Mar 2005, 14:09:58 »
Really? If so, I'll be darned... I'm quite sure I've seen init-line initialised group references be invalid on clients (if the group being referenced is a server-side AI group, for example) on many occasions.

Hmm...hold on...brain awakens - on second thought, I saw this when the group reference created was referring to a vehicle group.

Actual case
A AI tank platoon having "tank1=group this" in the init line of the lead tank.

When mission was started on a dedicated server, the variable "tank1" was invalid ("scalar bool..." or "<NULL-group>", can't remember which atm) on the client(s). It remained invalid even after waiting a while, barring any MP initialisation/hand-shaking going on.

So,it could be "vehicle groups", if we can call them that, which leads to invalid group references.

PS. It could be that changing the group assignment call for vehicles to, taking the tank example, "tank1 = group leader this" or some other clever variation would work. This I haven't tested yet.
« Last Edit: 23 Mar 2005, 14:16:33 by Killswitch »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Move / domove in MP
« Reply #11 on: 23 Mar 2005, 22:40:54 »
Ah, okay, I'll keep that in mind. There always seems to be something or another funny when working with crewed vehicles. I suppose there isn't much more to add to this thread, so I'll hit the little solve button. :D

Thanks all!
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!