Jump to content
Sign in to follow this  
PRiME

Domove/move/commandmove not working in mp ?!?

Recommended Posts

Basicly I can't get units to move after I have createunit.

They refuse to move in dedicated mode but work in the Normal server and in editor.. Making testing frustrating..

I have tried all code possible atm.. Seems this is a dead end for editing in OFP for me tell it gets fixed...

here is my script so you can get a idea on what im doing.

----------

?!(local Server): Goto "Next"

East5Truck = "Ural" createVehicle getPos StartVclEast5

#Next

Publicvariable "East5Truck"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man1 = this", 0.9, "CAPTAIN"]

East5Man1 setBehaviour "AWARE"

East5Man1 moveindriver East5Truck

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man2 = this", 0.9, "Lieutenant"]

East5Man2 moveinCargo East5Truck

East5Man2 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man3 = this", 0.9, "Corporal"]

East5Man3 moveinCargo East5Truck

East5Man3 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man4 = this", 0.9, "Private"]

East5Man4 moveinCargo East5Truck

East5Man4 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man5 = this", 0.9, "Private"]

East5Man5 moveinCargo East5Truck

East5Man5 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man6 = this", 0.9, "Private"]

East5Man6 moveinCargo East5Truck

East5Man6 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man7 = this", 0.9, "Private"]

East5Man7 moveinCargo East5Truck

East5Man7 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man8 = this", 0.9, "Private"]

East5Man8 moveinCargo East5Truck

East5Man8 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man9 = this", 0.9, "Private"]

East5Man9 moveinCargo East5Truck

East5Man9 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man10 = this", 0.9, "Private"]

East5Man10 moveinCargo East5Truck

East5Man10 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man11 = this", 0.9, "Private"]

East5Man11 moveinCargo East5Truck

East5Man11 setBehaviour "AWARE"

"SoldierESaboteurBizon" createUnit [getMarkerPos "East5", groupE5, "East5Man12 = this", 0.9, "Private"]

East5Man12 moveinCargo East5Truck

East5Man12 setBehaviour "AWARE"

leader groupE5 domove getpos East5Move

exit

------------

Keep in mind I have tried move and commandmove. Both fail to work, the AI just stand around Tho if ya fire off a shot the crouch to the ground so they must be active in some way just unable to recieve orders or move commands etc..

Also the moveindriver/cargo command in Dedicated mode is a bit flaky as well as it does not appear to always work. Hard to tell.

It be Nice if BIS can confirm the above so I know were I stand. If anyone has any other ideas on how to get it to work please feel free to tell. THanks

Share this post


Link to post
Share on other sites

isn't "#Next" supposed to be just before 'exit'?

from what i see, if local computer is not the (dedicated) server, the above command will be executed. since AIs are controlled by dedicated servers, the dedicated servers might not be able to recognize that much.

just a pot shot. confused.gif

Share this post


Link to post
Share on other sites

Hmm, Ralph is probably right

you sohuld exit if it's not the server, so

?!(local Server):exit;

and you don't need this

Publicvariable "East5Truck"

Share this post


Link to post
Share on other sites

Also, try putting a small delay between the creation of the unit and the moveIn command. In some instances it may not have enough time to initialize the name of the unit before you use the name in the following commands. I'm not sure if this is of any help, but try it out.

Share this post


Link to post
Share on other sites

Sorry about this reply, but it does not work.

the units and vehicles in MP does not get any ID's, and can therefor not be used in this way you want, in SP it works, in MP it doesn't

The units might be "recognized" by the server the first time, but the group in which they are respawned is empty.

Share this post


Link to post
Share on other sites

Okay, one small suggestion for you PRiME:

Declare all the unit variables you are using on all machines first, so maybe in init.sqs

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">East5Truck = objNull;

East5Man1 = objNull;

East5Man2 = objNull;

.

.

.

.

<span id='postcolor'>

No, you do not have to wait at all after doing a createVehicle to put the men in.  I create hundreds of vehicles in the EnemyStack system at the CoC on a Dedicated server without any issues like this.  Mind you I never put men in cargo, only gunner,driver,commander.

Also, where and how do you call this script?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Feb. 13 2003,23:35)</td></tr><tr><td id="QUOTE">No, you do not have to wait at all after doing a createVehicle to put the men in.  I create hundreds of vehicles in the EnemyStack system at the CoC on a Dedicated server without any issues like this.<span id='postcolor'>

It seems to be a performance issue. I have a low-end 800MHz Athlon and when the CPU load is high, the first command following the createUnit -command is sometimes discarded. I have no other logical explanation than this. That's why I use ~0.5 always in my scripts after creating a named unit.

Share this post


Link to post
Share on other sites

bn880 - are you saying if I want to spawn vehicles on the fly (or respawn) in multiplayer and have known vehicle names I should initialize the empty names I want to use at mission start? Does this get around the problem of not knowing what the vehicle name will be after creation?

thanks,

Plaz

Share this post


Link to post
Share on other sites

Did someone try this, because i have the same problem.

I create the units but they do nothing.

another question is how do you respawn AI units in mp running a dedicated server ?

Share this post


Link to post
Share on other sites
bn880 - are you saying if I want to spawn vehicles on the fly (or respawn) in multiplayer and have known vehicle names I should initialize the empty names I want to use at mission start? Does this get around the problem of not knowing what the vehicle name will be after creation?

thanks,

Plaz

One way I tend to prefer is to intialize groups into global variables. It uses less global variables than if you used one for each unit.

What I do:

1. Place single unit in map (we'll call it "GroupMaker").

2. Group1 = group Groupmaker

3. Groupmaker join grpNull (Forces unit to join another un-used group)

4. Group2 = group Groupmaker

5. Groupmaker join grpNull

6. etc... (You see the pattern - I do this until I have the number of groups I need)

7. deletevehicle GroupMaker

Once I get all my groups I just:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierWB" createunit [getpos x , Group1]

then all I need to do to get the units within a script is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = (units Group1) select 0

_unit = (units Group1) select 1

EDIT: You do not need to use Groupmaker guy if your groups are already created in the mission editor with full squads. Just for every squad leader use in init line: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Group1 = group this

Share this post


Link to post
Share on other sites

Are you sure it is working?

I do this:

--------------------------------------------------

Group1 = group Groupmarker

Groupmaker join GrpNull

~ 2

_man = "soldierwb" createunit [getpos player,Group1]

Group2 = group Groupmaker

Groupmaker join GrpNull

~ 2

_man = "soldierwb" createunit [getpos player,Group2]

Group3 = group Groupmaker

Groupmaker join GrpNull

~ 2

_man = "soldierwb" createunit [getpos player,Group3]

---------------------------------------------------

Only the first soldier is created.

sad_o.gif

Share this post


Link to post
Share on other sites

I don't think you can do this:

_man = "soldierWB" createunit....

According to ComRef, createunit doesn't return anything.

change it to :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"soldierwb" createunit [getpos player,Group1]

_man = (units Group1) select 0

I've used createunit on ded servers successfully and have gotten them to move using above method. Also, I've used CoC's Enemy Stack system which does the similar.

Share this post


Link to post
Share on other sites
I've used createunit on ded servers successfully and have gotten them to move using above method. Also, I've used CoC's Enemy Stack system which does the similar.

Ok! I see the difference, works now. Can you tell me where can I find those CoC's Enemy Stack system?

Share this post


Link to post
Share on other sites

Why, I think it is on CoC forums in the Tech Demo area.

It's been awhile, but that's where I remember it at:

CoC Forums

Those guys are my OFP heros! wink_o.gif

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  

×