5133p39
Dec 11 2006, 03:33
14.12.2006 23:33 EDIT: Problem solved:
After you create the unit, you must Join the unit with the group.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">NPC_SIDE = CreateCenter Civilian;
NPC_GRP = CreateGroup NPC_SIDE;
_u = NPC_GRP createUnit [_type, _pos, [], _r, "NONE"];
[_u] Join NPC_GRP;
[/QUOTE]
Problem description:
I am creating new units with the following lines of code:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">NPC_SIDE = CreateCenter Civilian;
NPC_GRP = CreateGroup NPC_SIDE;
_u = NPC_GRP createUnit [_type, _pos, [], _r, "NONE"];[/QUOTE]
The problem is that the command ...<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Side Group _u[/QUOTE]... is returning UNKNOWN side as it's result - i would expect it would return the CIV side.
(all the units are really created, so it's not a problem with referencing nonexisting unit, also, when i join the units with west player as their leader, then it returns the correct WEST side - so the problem lies somewhere within the scope of createCenter and createGroup commands)
What am i doing wrong?
After you create the unit, you must Join the unit with the group.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">NPC_SIDE = CreateCenter Civilian;
NPC_GRP = CreateGroup NPC_SIDE;
_u = NPC_GRP createUnit [_type, _pos, [], _r, "NONE"];
[_u] Join NPC_GRP;
[/QUOTE]
Problem description:
I am creating new units with the following lines of code:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">NPC_SIDE = CreateCenter Civilian;
NPC_GRP = CreateGroup NPC_SIDE;
_u = NPC_GRP createUnit [_type, _pos, [], _r, "NONE"];[/QUOTE]
The problem is that the command ...<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Side Group _u[/QUOTE]... is returning UNKNOWN side as it's result - i would expect it would return the CIV side.
(all the units are really created, so it's not a problem with referencing nonexisting unit, also, when i join the units with west player as their leader, then it returns the correct WEST side - so the problem lies somewhere within the scope of createCenter and createGroup commands)
What am i doing wrong?