Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Samcot

Member
  • Content Count

    20
  • Joined

  • Last visited

  • Medals

Everything posted by Samcot

  1. Hello everyone! Thanks for answering all my questions over the past few days. You have helped me a lot. However, I have another question... I'll start by putting this code which lives inside my Officer unit's init. (Incase anybody needs to see it) inspector = this addAction[ "Talk to the officer", { params[ "_target", "_caller", "_ID" ]; [ "task1", "SUCCEEDED" ] call BIS_fnc_taskSetState; [[ [ "CDF Officer", "Welcome to Altis, Captain. We're glad your here.", _target ], [ "Michael", "Glad to be here. So what's the situation?", _caller ], [ "CDF Officer", "The reds have been hitting our supply lines from the east to try and cripple us.", _target ], [ "CDF Officer", "So far we're holding them off in the south but we're noticing their strength increase by the day.", _target ], [ "Michael", "Just keep doing what you're doing and hold firm Sir. Is my lift ready?", _caller ], [ "CDF Officer", "Your carriage awaits, Captain. Board the helicopter when you're ready.", _target ] ], "CUSTOM", 0.10, true ] execVM "fn_simpleConv.sqf"; _target removeAction _id; }]; The above code lets my player do the following: Speak to the officer > Complete task1 > Then finally run a conversation script. (All working perfectly) I would now like to create a second task (task2) using the BIS "Create Task" module, where my player is told to get into a helicopter. I tried to create a trigger synced to task2 module with the following code in "Condition" scriptDone fn_simpleConv; But this did not work. Does anybody know a simple way for task 2 to run as soon as my conversation script has finished doing its stuff? (Maybe a 3 second delay after?) Thanks in advance!
  2. It worked! Thank you so much! the simple addition of a = sign made all the difference... Bloody scripting eh. I'm motivated now more than ever to learn as much as I can about this. Thanks again :)
  3. Ok, so I did what you asked. On mission start the value of conv1 is 1. Even though I set it to 0 in my init.sqf. See below for the contents of my init.sqf. wp1 = compile preprocessfile "wp1.sqf" ; // Play helicopter path via made with unitCapture. conv1 = 0; // Initialize global variable to false. I also added the following to my trigger on act box. hint "My trigger fired so conv1 must equal 1 now. Yoda be praised."; It wouldn't let me do hintc so I presume this was a typo? The trigger did not seem to fire as I didn't get the hint pop up. I'm not sure why this isn't working lol. Also thanks for telling me about these handy debug tricks. They will sure come in handy. Also thank you for your patience in dealing with this issue for me :)
  4. Hmm, still not working. The script seems perfect I don't know why it won't activate the trigger. Perhaps I'm doing something wrong with the trigger. I read somewhere that triggers don't like booleans. So I changed the code in init.sqf to conv1 = 0; // Initialize global variable to false. Then I added conv1 = 1; into my addAction script like you showed me above. (Also changed name to conv1 to keep it shorter). Here is a screenshot of my trigger. And here is the addAction code. inspector = this addAction[ "Talk to the officer", { params[ "_target", "_caller", "_ID" ]; [ "task1", "SUCCEEDED" ] call BIS_fnc_taskSetState; [[ [ "CDF Officer", "Welcome to Altis, Captain. We're glad your here.", _target ], [ "Michael", "Glad to be here. So what's the situation?", _caller ], [ "CDF Officer", "The reds have been hitting our supply lines from the east to try and cripple us.", _target ], [ "CDF Officer", "So far we're holding them off in the south but we're noticing their strength increase by the day.", _target ], [ "Michael", "Just keep doing what you're doing and hold firm Sir. Is my lift ready?", _caller ], [ "CDF Officer", "Your carriage awaits, Captain. Board the helicopter when you're ready.", _target ] ], "CUSTOM", 0.10, true ] execVM "fn_simpleConv.sqf"; _target removeAction _id; conv1 = 1; }]; Also, Here is my create task module. (Create task module is synced to my player. Previously I used "All playable units" for the Owner.)
  5. Thanks for the reply @johnnyboy. Unfortunately it still isn't working 😞
  6. @Dedmen It didn't work. I'm not sure I did it right. I added SAM_FirstConversationDone = true at the end of my script in officer's init box. (See bottom of picture) inspector = this addAction[ "Talk to the officer", { params[ "_target", "_caller", "_ID" ]; [ "task1", "SUCCEEDED" ] call BIS_fnc_taskSetState; [[ [ "CDF Officer", "Welcome to Altis, Captain. We're glad your here.", _target ], [ "Michael", "Glad to be here. So what's the situation?", _caller ], [ "CDF Officer", "The reds have been hitting our supply lines from the east to try and cripple us.", _target ], [ "CDF Officer", "So far we're holding them off in the south but we're noticing their strength increase by the day.", _target ], [ "Michael", "Just keep doing what you're doing and hold firm Sir. Is my lift ready?", _caller ], [ "CDF Officer", "Your carriage awaits, Captain. Board the helicopter when you're ready.", _target ] ], "CUSTOM", 0.10, true ] execVM "fn_simpleConv.sqf"; _target removeAction _id; }]; SAM_FirstConversationDone = true; I then added this to my trigger condition. !isNil "SAM_FirstConversationDone" But it didn't do anything. I'm sorry if I've done this completely wrong. I have no idea how to add code to a script because I get confused where it should go in relation to all the [ and { brackets.
  7. Looks great. I'll give this a go. fn_simpleConv.sqf is the name of my conversation script. Thanks for the reply :)
  8. Samcot

    JBOY Scripts Compilation

    These look awesome! I can't wait to dig into some and especially play some of your missions. Thanks for the great post.
  9. Hey guys. So I need some help with the following. I set up a task for my player to talk to an officer before heading off onto his next task. (I use an addaction command to talk to the officer (See below) which also sets my task state to succeeded. Code below is put into the init of my officer unit. inspector= this addAction ["Talk to the Officer", "[""task1"",""SUCCEEDED""] call BIS_fnc_taskSetState"]; I wanted to add a short conversation between the player and officer which initiates as soon as the above command is used. (Via addAction "Talk to the officer") Here is the script which initiates the conversation. (Thanks to R3vo's Simple Conversation Script) line1 = ["CDF Officer", "Welcome to Altis, Captain. We're glad your here.",officer1]; line2 = ["Michael", "Glad to be here. So what's the situation?",michael]; line3 = ["CDF Officer", "The reds have been hitting our supply lines from the east to try and cripple us.",officer1]; line4 = ["CDF Officer", "So far we're holding them off in the south but we're noticing their strength increase by the day.",officer1]; line5 = ["Michael", "Just keep doing what you're doing and hold firm Sir. Is my lift ready?",michael]; line6 = ["CDF Officer", "Your carriage awaits, Captain. Board the helicopter when you're ready.",officer1]; [[line1,line2,line3,line4,line5,line6],"CUSTOM",0.15,true] execVM "fn_simpleConv.sqf"; So the above script works perfectly when ran locally from the debug console. How do I combine both scripts together so when I "Talk to the Officer" the conversation script is also played? Thanks in advance.
  10. Ahh I see. This makes sense, thank you for the description man!
  11. @Larrow Well I don't know how you did it but it worked! Thank you so much. Some of the guys on here said I should learn about params as they make things a lot easier. I'm presuming you have used 3 params (_target, _caller and _ID) to completely simplify everything and make it work, honestly I'm amazed. How do the params know who each person is? I presume _target is the officer who's variable name is "officer1", _caller is my player who is "michael" and I have no clue what _ID means? I'm learning new things every day thanks to this awesome community. :)
  12. Thanks for the info man! I checked the thread already and there's nothing about it. I made a post anyway. Hopefully it's an easy fix as I'd love to make progress on my mission :)
  13. Thanks for the reply @wogz187. Because I'm fairly new to this scripting stuff I'm unsure what paranthesis is. I assume it's just using 1 set of " instead of multiple ones? (Sorry in advance for me being dumb lol) The script you posted above works great but I'm having a weird issue which I think is due to my lack of scripting knowledge and I wondered if you may know what's going wrong? I'll reproduce my steps for you. Added your script to my officer unit's init. Hit play. Spoke to the officer unit using the addAction and it triggered the taskSetState perfectly. It then gave me This error and did not play my simpleConv script. I spoke to the officer again (As I don't know how to remove addAction once activated for the 1st time) Then my simpleConv script worked fine with no error message. I think the error message has something to do with defining the unit so the built-in lip movement script can activate on the right guy?. In my fn_simpleConv.sqf script that @R3vo made he included an example. Located at the bottom of This image. I was unsure where to post my line1,line2 etc so I just put them at the start. See Here (Located at bottom of image). In my lines I defined the unit which will say the message. "Michael and officer1" I hope I haven't super confused you and I've tried to include as much information as possible. Thanks in advance. Edit - This is the script I'm using.
  14. Hey guys. I have placed an object in the editor with the following code in the init - (The code lets me inspect the weapons and plays a cool little sound when activated). this addAction ["Inspect the weapons", { params ["_object","_caller","_ID"]; _object say3D "01"; }]; I want to create a task where I have to inspect the weapons, using the create task module. Is there a way to automatically set the task to "Succeeded" once I have manually clicked "Inspected the weapons" on my object? preferably using setTaskState? I'm kinda new to scripting so if someone would be kind enough to change my code which I pasted above to go straight into the object init that would be great. Thanks in advance.
  15. Thanks for offering to help out man! I might just do that later on today. :)
  16. Thanks so much wogz! I need to learn about params as I have no clue what they do. :)
  17. That looks great, I'll test it soon. @wogz187 Would you please be able to edit the code so it also includes the command to play my sound? _object say3D "01"; ? Thank you very much for your help :)
  18. Hey guys. I need some help with the following, I'm new to scripting so please try to be patient with me lol :) Here's my situation. I have setup UnitCapture on a vehicle to drive my player to a certain point. My player has to first enter the vehicle before I tell the driver to follow the path created with UnitCapture. I made a trigger (Activated by Radio Bravo) which plays the UnitCapture and also tells the vehicle to turn its engine on. As soon as I enter the vehicle I activate Radio Bravo manually so my driver sets off to his destination. I use the following command in the above trigger to turn the vehicle engine on. v1 engineOn true; (As well as a command which plays the UnitCapture) Everything works fine in terms of the UnitCapture but the vehicle automatically turns it's engine off after a few seconds and the vehicle is moving without any engine sound. Is there a way for me to somehow to set up a trigger or init script that will automatically repeat/loop the v1 engineOn true; command so my vehicle keeps its engine on for the duration of the journey? Edit- I'm also wondering if there is any way to make it so the car following the UnitCapture path moves its wheels? They are currently dragging along the ground making a horrible sound. Thanks for taking the time to read my problem and thanks in advance for any replies willing to help.
  19. Ok, that makes sense. It's great to know that unitCapture will work effectively with Helicopters and Boats. If your saying it will ruin immersion by repeating engineOn then I'll just forget that idea. Thank you so much for your reply pierre. I'll have a look into this setDriveOnPath command and see how I get on. Thanks again bud.
×