TheDarkFox 0 Posted January 17, 2002 I'm using the following code, which is darn near exactly what is in the manual: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierWB" createUnit [getMarkerPos "Nowhere", groupAlpha]<span id='postcolor'> But no unit ever appears at marker "Nowhere"!! Any hints? Thanks Share this post Link to post Share on other sites
MP 0 Posted January 17, 2002 Use this instead: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">soldier = "soldierWB" camCreate [(getPos marker1 select 0),(getPos marker1 select 1),0]<span id='postcolor'> I think you know where to put it... . Hey Hey!!! I got my avitar back!!! Share this post Link to post Share on other sites
TheDarkFox 0 Posted January 17, 2002 Doesn't camCreate just create a camera? Maybe I don't know where to put it! Share this post Link to post Share on other sites
MP 0 Posted January 17, 2002 Camcreate can create anything from a soldier to a bottle of vodka. Put this in a script, the init field of a unit or the "On Activation" field of a trigger or WP. That shit pisses me OFF!. You try to help and you get smart comment's back in your face. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Maybe I don't know where to put it!<span id='postcolor'>. Share this post Link to post Share on other sites
PiNs_Da_Smoka 0 Posted January 17, 2002 No, you can create units and vehicles with CamCreate. The only thing is, they are pretty much useless for anything besides decoration. Thats where the CreateUnit and CreateVehicle commands come in. I can't help you with the CreateUnit command, as it crashes me to my desktop when i use it. But here is what i do to get around it. I use the CreateVehicle command to make them. As so: myguy="soldierWlaw" CreateVehicle getmarkerpos "here" The first part is the name of the unit you put. This of course can be anything you want. Just remember, with CreateVehicle you don't need the class like in CamCreate, you can use that as the name. Hope that helps a little. PiNs_Da_Smoka Share this post Link to post Share on other sites
TheDarkFox 0 Posted January 18, 2002 Hey, MP, I wasn't trying to be sarcastic man! As you pointed out, I really didn't know! And hey, that's cool that you can create non-vehicle unites with createVehicle! Thanks for the help all Share this post Link to post Share on other sites
mahuja 12 Posted January 19, 2002 didn't you guys know? Everything (at least everything non-static) in OFP is a "vehicle" including soldiers. unit is a vehicle "with brains" - that is with either ai or player controlling it. Share this post Link to post Share on other sites
TheDarkFox 0 Posted January 19, 2002 No, I didn't know that. Why did they make a "createUnit" command then? Share this post Link to post Share on other sites
hlq2action 1 Posted January 19, 2002 ok to make it work it s very simple.... put that in the init field of a unit : alphagroup = group this (this will put the soldier as leader of the group alphagroup) then make a triger. put that in the init field : "SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha] and make the trigger repeatedly. axis a and b to 0 and activation to radio alpha.... then you just have to try it.... in the game use the radio and code alpha.. it will create in the group alphagroup (you are the leader of that group) one soldier everytime you use the alpha radio command. i had lot of problems too about it.. and i ve found that it was a problem about GROUP we should all learn a little bit about grouping. me too :] Share this post Link to post Share on other sites
TheDarkFox 0 Posted January 19, 2002 Aha! My problem was likely that I was trying to create a unit and add it to a group that didn't yet exist. (I assume you need to set a group leader before the group "exists"?) Makes sense... Share this post Link to post Share on other sites
hlq2action 1 Posted January 19, 2002 i don t think that you have to create a group leader before.... but you have to assign one!!! dunno if you can create a variable that is not actually a unit and then assigning this unit to a group and then createunits in this group.... try it cuz i did not try. ALL GUYS REMINDS THAT LEARNING ABOUT GROUPS IS VERY IMPORTANT!!!!!!!! THERE IS LOT OF COMMANDS WORKING WITH GROUPS THAT WILL HELP TO HAVE A SMALLER CODE... AND TO MAKE THINGS EASIER... SO TRY TO FIND GROUP TUTORIALS TO WORK ON GROUP COMMANDS!!!!!!! (EVEN ME I HAVE TO LEARN MORE ON GROUPS) Share this post Link to post Share on other sites
hlq2action 1 Posted January 19, 2002 ok i would like the BIS team to add a feature to the createunit command... this is what it would be great: when you use the createunit command it create a unit in a GROUP.... the problem is that when you want to add the FIRST unit in a NEW group you simply can t do it... the createunit don t work... so could you add the feature for that command that check if the group already exist and if not create a new one!!! Share this post Link to post Share on other sites
mahuja 12 Posted January 26, 2002 the only way to set the "skill" etc of a guy is to use the createunit command. That you cannot do with createvehicle. So now you have a reason to use it. Share this post Link to post Share on other sites