Recipient 0 Posted January 12, 2003 I have searched the forums for the following item: In my mission, I want to use Unit Creation to spawn a group of infantry, rather than one.. Â The problem is, I do not have the knowledge to carry it out. Â What will I need to do? Â Anybody? Recipient Share this post Link to post Share on other sites
PiNs_Da_Smoka 0 Posted January 16, 2003 Just routing throw the last few pages for unanswered posts and found this one, and to my surprise, wasn't answered. Here is a very simple script i used in my last mission. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierEB" CreateUnit [getmarkerpos "squad1",groupcreate1,"guy1=this"] ~0.1 "SoldierELaw" CreateUnit [getmarkerpos "squad1",groupcreate1,"guy2=this"] ~0.1 "SoldierEMG" CreateUnit [getmarkerpos "squad1",groupcreate1,"guy3=this"] ~0.1 "SoldierEMG" CreateUnit [getmarkerpos "squad1",groupcreate1,"guy4=this"] ~0.1 "SoldierELaw" CreateUnit [getmarkerpos "squad1",groupcreate1,"guy5=this"] ~0.1 "SoldierEB" CreateUnit [getmarkerpos "squad1",groupcreate1,"guy6=this"] <span id='postcolor'> Now, let me explain each part, since you said you do not understand how to use it. First off, "SoldierEB" and such other names are pretty self explanatory, those are the kind of soldier you are spawning. In this case, they are East soldiers. Now, the "getmarkerpos" part is where i wanted them to spawn when created. I simply placed a marker on the map named "squad1", simple as pie. Next, is "groupcreate1". This is the group name for htose units to be spawned into. Unfortunately, you have to have a group already made in the mission to be able to spawn units into it. All i did was place on unit, an officer, and in his init field, i put: groupcreate1 = group this That simply names his group. And the last part in that "guy1=this", is simply naming each guy i created. This is not necessary, and you probably won't need it, i jsut did it because i needed to control each soldier. And lastly, of course is the "~0.1". Which is common knowledge, i made a pause of 0.1 seconds between each spawn, just did this so i could avoid a pause in creation on my slow pc. Hope this helps you understand the CreateUnit command so that you may use it in whatever way you need it used. Share this post Link to post Share on other sites