honger 115 Posted May 28, 2023 19 hours ago, Green Coyote said: im an idiot, total noob. How does this work? i want to catch a badguy. i named him "obj_HVT" then i typed in the script you have posted above. i get an error: "invalid number in expression". no idea what to do here. i got desperate and i saw the dropbox link with the "SQF files. i think that i need to put the files in my mission folder. i put them in and boot it up and now my mission is gone, replaced by the sample mission you made. how do i make this work on my mission? what went wrong? im a moron can you break this down Barny style? like step-by-step? is there a way to recover the mission i was working on, because now i cant get it to load. If you have overriden your files and shutdown your PC in the meantime - no, you can't recover it. At least now you'll know you have to do backups if you want to replace files, although in this case replacing mission.sqm was not necessary since script literally uses two sqf files and needs only them. And give some stuff a read instead of blindly copying stuff without reading all the text and searching for things you don't understand. Code shown in OPs post shows two lines of code, one line is for hostage, second for HVT. There are also two scripts, one SQF for hostage, another SQF for HVT. Make a new mission, place player and the HVT dude named obj_HVT, save it. Go to your mission folder, put the Hvt_setup.sqf file in the same place where your mission.sqm file is. Create the init.sqf file and inside it put the line of code for obj_HVT, save it. Now in-game load your mission again (in Editor click on Open and select the mission you've been just editing), preview, it should work. If it doesn't you either didn't follow this guide to the word or script requires more editing, in this case get a cool code editor and give a read to scripting guides. 2 Share this post Link to post Share on other sites
Green Coyote 1 Posted May 28, 2023 Thanks Honger for the quick reply. So make sure I got this straight, your saying I should 1. Create a scenario 2. Place my player and my npc badguy on the map. 3. Name the badguy "obj_HVT" 4. save and exit 5. Put HVT_setup.sqf (found on the dropbox) into the same folder that my mission.sqm file is in 6. Use notepad to create a .sqf file that says: //prepare HVT and hostage obj_hostage execvm "Hostage_setup.sqf"; obj_HVT execvm "Hvt_setup.sqf"; 7. Put created sqf file in folder with mission & HVT_setup.sqf 8. Load and test? I guess I have questions steps 6 and 7? What should I name the sqf file? Does it matter? and what lines are irrelevant or should be removed? Share this post Link to post Share on other sites
Harzach 2517 Posted May 28, 2023 Not quite. These two snippets of code: obj_hostage execvm "Hostage_setup.sqf"; obj_HVT execvm "Hvt_setup.sqf"; are executing the sqf scripts. In plain language, they say: "Hey, Arma, there's something called obj_HVT in the mission. Also, there's a script in the mission file called Hvt_setup.sqf. I want you to execute that script in the context of that thing." So: Create a scenario Place my player and my npc badguy on the map. Name the badguy "obj_HVT" Paste the following into badguy's init field obj_HVT execvm "Hvt_setup.sqf"; save mission as "My HVT Mission" or whatever Put HVT_setup.sqf (found on the dropbox) into the same folder that my mission.sqm file is in Load and test 2 Share this post Link to post Share on other sites
Green Coyote 1 Posted May 29, 2023 (edited) 1 hour ago, Harzach said: Not quite. These two snippets of code: obj_hostage execvm "Hostage_setup.sqf"; obj_HVT execvm "Hvt_setup.sqf"; are executing the sqf scripts. In plain language, they say: "Hey, Arma, there's something called obj_HVT in the mission. Also, there's a script in the mission file called Hvt_setup.sqf. I want you to execute that script in the context of that thing." So: Create a scenario Place my player and my npc badguy on the map. Name the badguy "obj_HVT" Paste the following into badguy's init field obj_HVT execvm "Hvt_setup.sqf"; save mission as "My HVT Mission" or whatever Put HVT_setup.sqf (found on the dropbox) into the same folder that my mission.sqm file is in Load and test Perfect. This is actually pretty close to what I was thinking the right steps were after I nuked my scenario. I appreciate both you people clearing this all up for idiots like me. EDIT: works great on demo!! Also, do you guys have suggestions for creating a task and trigger for this? Edited May 29, 2023 by Green Coyote Follow-up question 1 Share this post Link to post Share on other sites
gatordev 219 Posted June 7, 2023 On 5/28/2023 at 9:02 PM, Green Coyote said: Also, do you guys have suggestions for creating a task and trigger for this? I don't bother with tasks in my missions, but for HVT missions, I'll create a trigger that activates a variable saying I've done what I wanted successfully. So, player distance hvt < 2 And then On Activation will be: hvtJoin=true; I can then also add other things that make the mission move along like radio calls or what not. I'll then have an END trigger that has a parameter that includes hvtJoin (usually with some other variables added in there). Something like this: hvtJoin && player distance endpoint < 50 && alive hvt I'm sure there's slicker ways to do things, but that's just my quick and dirty way to create triggers for self-made missions 2 Share this post Link to post Share on other sites