PDA

View Full Version : [MP Ded.Srv.] Getting a whole group getting in



ManDay
Dec 28 2006, 08:13
My mission has actually been finished a few days agao, but since i know that evrything goes differently on a ded. Server I got some more questions to that:

How can I order a group to get into a vehicle?
Normally 'assignAsCargo' for the whole group makes the group automaticly get in but on a ded Server only the groupleader gets in.
Then I tried 'orderGetIn' afterwards but that didnt work :/

Sickboy
Dec 28 2006, 09:24
You can take the examples from my demo get in tank mission:
http://www.flashpoint1985.com/cgi-bin....22;st=0 (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=71;t=55722;st=0)

To use it in scripts do a:
{_x moveincargo _vehicle} foreach units leader1
etc..

_vehicle = the vehicle
leader1 = the leader of the group you wish to get in, make sure you name it in the editor http://forums.bistudio.com/oldsmileys/smile_o.gif

ManDay
Dec 28 2006, 09:46
Uhhm... you are talking about 'moveInCargo' ? That teleports the units right in, which is not acceptable.

Sickboy
Dec 28 2006, 09:52
Uhhm... you are talking about 'moveInCargo' ? That teleports the units right in, which is not acceptable.
Ah, sorry, did you try the above scripting example with, assignascargo instead of moveincargo?

ManDay
Dec 28 2006, 09:57
'cuse me?

Dunno what you mean but I tried (i.e.):

{ _x assignAsCargo car1 }forEach units group unit1;
unit2 orderGetIn true;
unit3 orderGetIn true;
unit4 orderGetIn true;

PS: Just to let you know: I'm not new to OFP-scripting at all. I am a great scripter so dont be afraid that i may not know such simple commands http://forums.bistudio.com/oldsmileys/wink_o.gif

Sickboy
Dec 28 2006, 10:30
..
PS: Just to let you know: I'm not new to OFP-scripting at all. I am a great scripter so dont be afraid that i may not know such simple commands http://forums.bistudio.com/oldsmileys/wink_o.gif
Ok, hard to guess so I rather add some extra info here and there so there's no need for more questions http://forums.bistudio.com/oldsmileys/biggrin_o.gif

Will look into it soon!

ManDay
Dec 28 2006, 10:34
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;getGroupIn.sqs - CSP
;1 - Group&#58; Group to get in
;2 - Object&#58; Vehicle to mount

_leaderu = leader&#40; _this select 0 &#41;;
_unitsu = units&#40; _this select 0 &#41;;
_car = _this select 1;
_i = 0;
#action1
?&#40; &#40; _unitsu select _i &#41;&#33;=_leaderu &#41;&#58;&#91; _unitsu select _i &#93;join grpNull;
~0.1
&#40; _unitsu select _i &#41;assignAsCargo _car;
_i = _i + 1;
?&#40; _i &#60; count _unitsu &#41;&#58; goto &#34;action1&#34;;
@<hidden>&#40; &#40; { _x in _car }count&#40; _unitsu &#41; &#41;== count _unitsu &#41;
_i = 0;
#action2
?&#40; &#40; _unitsu select _i &#41;&#33;=_leaderu &#41;&#58;&#91; _unitsu select _i &#93;join group _leaderu;
_i = _i + 1;
?&#40; _i &#60; count _unitsu &#41;&#58; goto &#34;action2&#34;;[/QUOTE]

That is the only way it works on dedicated servers.

Sickboy
Dec 28 2006, 11:22
Well, for all the people who suffer the same merde: If you want to know a solution then just unjoin the soldiers into their own special groups. then each soldier is a groupleader and you can use assignAsCargo as usual. they will getin becaus they know they have to. but i dont like that solution

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">...[/QUOTE]
Thanks for sharing&#33; I&#39;m sure it&#39;s either only a temporary needed solution until it&#39;s fixed, or there might be some things we&#39;re not aware of to get it working the proper way, if I get some time I will do some tests aswell.

BTW, in the BIKI it says that the soldiers need to be delivered in an array, to orderGetIn (http://community.bistudio.com/wiki/orderGetIn)

BTW2, only as suggestion... SQF is the future baby http://forums.bistudio.com/oldsmileys/smile_o.gif)

ManDay
Dec 28 2006, 11:33
BTW2, only as suggestion... SQF is the future baby http://forums.bistudio.com/oldsmileys/smile_o.gif)
It&#39;s just the same. I don&#39;t care http://forums.bistudio.com/oldsmileys/wink_o.gif It&#39;s only usefull if you code blocks.

My suggestion: Dont use SQF as long as you dont really need it. The OFP-Engine is only a parsing engine and parsing a code-block is more complicated then parsing a line. As I expsect the parser to be written just in the same quality I see the game to be written It will be better to stay to the more simple syntax of lines http://forums.bistudio.com/oldsmileys/smile_o.gif


PS: gotta work on that script again. it doesnt work so fine

zyklone
Dec 28 2006, 12:32
BTW2, only as suggestion... SQF is the future baby http://forums.bistudio.com/oldsmileys/smile_o.gif)
It&#39;s just the same. I don&#39;t care http://forums.bistudio.com/oldsmileys/wink_o.gif It&#39;s only usefull if you code blocks.

My suggestion: Dont use SQF as long as you dont really need it. The OFP-Engine is only a parsing engine and parsing a code-block is more complicated then parsing a line. As I expsect the parser to be written just in the same quality I see the game to be written It will be better to stay to the more simple syntax of lines http://forums.bistudio.com/oldsmileys/smile_o.gif


PS: gotta work on that script again. it doesnt work so fine
This is just so wrong on so many levels.
SQS scripts are parsing the file as they&#39;re executed, each goto will start from the beginning of the file for example.

While SQF scripts files are parsed once and then stored in memory.

ManDay
Dec 28 2006, 14:18
This is just so wrong on so many levels.
SQS scripts are parsing the file as they&#39;re executed, each goto will start from the beginning of the file for example.

While SQF scripts files are parsed once and then stored in memory.
SQS scripts are parsing which file? The SQS script theirself are parsed - arent they?
I still think letting the sqs be parsed is better than letting the sqf be parsed because you can just not rely on the Engine to do that right. (at least i dont)

CrashDome
Dec 28 2006, 15:27
Nope,

IIRC each line of an SQS is parsed/compiled individually which means loops and other such advanced usage means they are parsed multiple times and possibly read from the file multiple times.

A proper SQF (compile w/ spawn) will guarantee reading the file once and storing it in memory for faster access.

Additionally, the idea that parsing SQS is easier because it is NOT in code blocks is just something that is not true anymore. BIS would not be recommending to use SQF instead of SQS if it wasn&#39;t better in most situations.