Kabolte 10 Posted July 12, 2009 So I basically have a simple script that spawns a unit and adds an action to him. The action appears, but when I try to use it, it does nothing. Here are the scripts. //creates one guerrilla soldier group1 = createGroup Resistance; this1 = group1 createUnit ["GUE_Soldier_1",getMarkerPos "spawnKUMYRNA1",[],0,"NONE"]; //adds action to recruit him this1 addaction ["Recruit","/interaction/recruitLvl1Kumyrna.sqf"]; recruitLvl1Kumyrna.sqf this join player; I'm trying to make it as simple as I can, but even then I can't get it to work? What did I do wrong? Share this post Link to post Share on other sites
jamesf1 0 Posted July 12, 2009 Try: (_this select 0) join player "this" won't do what you think it does. Share this post Link to post Share on other sites
Redfield-77 10 Posted July 12, 2009 (edited) unit addaction ["action", "the sqf."]; Hope that helps. EDIT: sorry just re-read your post. should be... [this1] join player; Edited July 12, 2009 by Redfield-77 Share this post Link to post Share on other sites
Kabolte 10 Posted July 12, 2009 Is there anyway to make it apply to any unit that calls that script, not just this1? If I did it that way, I'd need a ton of files for each unit I'm making that I will be able to recruit. Share this post Link to post Share on other sites
Redfield-77 10 Posted July 12, 2009 How do you plan to call the script? by placing addaction on each unit? or a different way? I want to say: [this] join player; could be used as a universal sqf. that any unit could call via addaction but im probly wrong. Best if somone with skills answers your question. Meanwhile try it this way. Share this post Link to post Share on other sites
Murklor 10 Posted July 12, 2009 Kabolte said: Is there anyway to make it apply to any unit that calls that script, not just this1? If I did it that way, I'd need a ton of files for each unit I'm making that I will be able to recruit. _activated = _this select 0; _activator = _this select 1; _activated join _activator; Should work, yes? Share this post Link to post Share on other sites
Kabolte 10 Posted July 12, 2009 When I enter a trigger, it executes that first script I posted. So I guess yes, by placing addaction on each unit. Using [this1] works fine, but using [this] instead doesn't. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted July 13, 2009 Quote _activated join _activator Quote (_this select 0) join player Remember that join requires an array of units. Add square brackets to either of these and they'll work just fine. Share this post Link to post Share on other sites