Jump to content
Sign in to follow this  

Recommended Posts

Hey All, first post :D

I have a few issues I would like help with. A mission i'm making involves a Hercules plane dropping off some soldiers. In every init field of the soldiers I use moveInCargo on the plane. This works fine. However I made a script to simplify the process where you give the leader as an argument:

_group = group (_this select 0);
_vehicle = _this select 1;
{
   _x moveInCargo _vehicle;
}
forEach units _group;

This code does not produce the correct result. I tested with friends and they did not start in the Hercules. AI did. When I used moveInCargo on each soldier individually it works. I'm also using this approach now since if the leader does not get picked they will not be moved in anyway. However I would like to know why it doesn't work still.

Another problem is that one of the paratroopers die random somehow near the ground, not sure whether is was on landing or not. To solve this problem I made the following script to make them invincible until landing:

_unit = _this select 0;

_unit allowDamage false;
while {_unit hasWeapon "ACE_ParachutePack"} do {
   sleep 1;
};

sleep 3;
_unit allowDamage true;

Is there a better way?

Finally I have a problem with the description.ext file. I've added some weapons and magazines to this file so weapons can be chosen at start. My friends are can see the weapons and remove their gear. However, they cannot add anything to their gear. I can do both on a "listen server". I have no idea how to solve this one.

Thanks for your time it is very much appreciated. :)

Share this post


Link to post
Share on other sites

Hi mate,

regarding to the first issue, indeed it won't work letting a remote machine, say, the server, manipulate a player local on another machine.

Dunno if it is just because the to manipulate unit is remote, or if it is a feature of the engine that a remote machine can't affect the local entity.

That's why it is working in the editor preview and with your unit when hosting locally, but not with your friend who's entity is remote to the server.

However, you can make it that a local player gets moved into a vehicle from within a server script by using setVehicleInit.

Code:

_group = group (_this select 0);
_vehicle = _this select 1;
{
   _x setVehicleInit format["this moveInCargo %1",_vehicle];
} forEach units _group;
processInitCommands;

Share this post


Link to post
Share on other sites

If it's just at mission start, it could always go in init.sqf, rather than each init field:

player moveInCargo varName

Won't work for AI, of course.

Share this post


Link to post
Share on other sites

Thanks a lot for the answers :). Hmm. I've read about locality issues. And know that in order to move a player in to a vehicle my way I would have to do it on the players machine. But don't the scripts get transmitted in the mission file and run on all clients and the server? So while the server can not load the remote player into the vehicle the script on the local player can, and the game client tells the server?

I've given up on the "gears before mission issue". Googled a lot and it seems it's bugged/unreliable?

Share this post


Link to post
Share on other sites

I've given up on the "gears before mission issue". Googled a lot and it seems it's bugged/unreliable?

Not really bugged or unreliable. It just seems that most of the time, because usually people don't know that the gear changing doesn't really work in briefing (while it's still loading units etc). So, often gear script are being run too early. Instead, you should wait for the players to be actually in the game. For example by using "sleep 1" or "waituntil {time>0}" before issuing the commands.

Share this post


Link to post
Share on other sites

Interesting shk :). However I don't think a sleep would solve the problem. Even after 2 minutes it still takes forever (even if i'm able) to pick a weapon. Don't know if you can call it a script i'm just using the description.ext. I'll try a sleep later, however I still doubt it'll work.

Do you mean I have to somehow pick weapons after the briefing? Is that possible? Even if, then it really isn't an option in my mission, since you have to have chosen your gear at start.

Share this post


Link to post
Share on other sites

Ah, you meant selecting weapons from the pool while in briefing. No scripting involved really, just the desc.ext. Yeah, picking them lag like hell with more than a few players. Don't think there's anything you can do about that.

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  

×