limmy3 0 Posted March 26, 2007 Hello fellows, I’m looking for a fellow how “loves†challenges in writting a script. I have no experience in writting scripts. So I do not know whether it is possible. Well, I’m able to write cunscenes and speech scripts but that’s all. I need a special script ...  I explain it. A couple of two civilians called Civ_1 and Civ_2 are walking down a hill and may be detected by one of three soldiers W_2, W_3 or W_4 Only one of them should report to the Corporal otherwise when all speak this ends in chaos. I tried this with triggers which works but then it may happen that all are reporting to the Corporal. I have written two scripts for each soldier <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; [this] exec "W_2_Civ_1_1.sqs" W_2 SideChat "Sir, Civilians are coming up the hill from the south." ~5 W_1 SideChat "Very well Mr Balboa, then tell them to disappear." ~3 W_2 SideChat "Yes Sir." exit <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; [this] exec "W_2_Civ_1_2.sqs" W_2 sideChat "I intercepted them and convince them to go back. Sir." ~5 W_1 SideChat "Very well Mr Balboa that was correct." ~3 ; W_1 SideChat "Fall back in formation." W_2 CommandFollow W_1 ~2 W_2 SideChat "Yes, Sir." exit <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; [this] exec "W_3_Civ_1_1.sqs" W_3 SideChat "Corporal, here's a couple walking over the hill trough the zone." ~4 W_1 SideChat "Mr Bond make clear to them they can't pass this area." ~3 W_3 SideChat "Aye-aye, Sir." exit <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; [this] exec "W_3_Civ_1_2.sqs" W_3 sideChat "Ok, Corporal the couple is bugging out." ~4 W_1 SideChat "Thank you Mr Bond." W_3 CommandFollow W_1 ~2 W_3 SideChat "Aye, Sir." exit <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; [this] exec "W_4_Civ_1_1.sqs" W_4 SideChat "Corporal, Sir! Two persons are coming towards the depot." ~10 W_1 SideChat "Mr Christian make sure they leave this area. Don't let them pass." ~3 W_4 SideChat "Aye-aye, Sir." ~3 W_1 SideChat "Chase them away." ~3 W_4 SideChat "Yes, Sir." exit <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; [this] exec "W_4_Civ_1_2.sqs" W_4 sideChat "They turned arround, Sir." ~7 W_1 SideChat "Yes, Mr Christian well done." ~3 W_4 SideChat "Yes, Sir." W_4 CommandFollow W_1 ~2 W_4 SideChat "Yes." 3 W_4 SideChat "Sir!" exit The triggers: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Trigger : 01 Function: Activates *.sqs at distance Axis a: 0 Axis b: 0 Angle: 0° Ellipse: 0  Rectangle: 0  Once: 0  Repeatedly: 0 Activation: None Type:  None Text:    Name:   Condition: W_2 distance Civ_1 < 160 On Activation: [this] exec "W_2_Civ_1_1.sqs" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Trigger : 02 Function: W_2 will move to Civ_1 Axis a: 0 Axis b: 0 Angle: 0° Ellipse: 0  Rectangle: 0  Once: 0  Repeatedly: 0 Activation: None  Type:  None Text:    Name:   Condition: W_2 distance Civ_1 < 70 On Activation: Civ_1 stop true; W_2 doMove getPos Civ_1 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Trigger : 03 Function: W_2 will talk to Civ_1; Civ_1 will flee; W_2 will return to formation Axis a: 50 Axis b: 50 Angle: 0° Ellipse: 0  Rectangle: 0  Once: 0  Repeatedly: 0 Activation: None  Type:  None Text:    Name:   Condition: W_2 distance Civ_1 < 5 On Activation: Civ_1 stop true; [this] exec "W_2_Civ_1_2.sqs" On Deactivation: Civ_1 stop false; verjagen = true What I need is a script to let only the one soldier activate his *.sqs file who first detected the civilians. eg: Lets say the soldier W_3 detected the Civ_1 first that means the other soldiers W_2 and W_4 should say nothing. The important thing is that only one soldier talks both parts. All is  Regards limmy3 Share this post Link to post Share on other sites
Metal Heart 0 Posted March 26, 2007 Use only one script for simplicity's sake and no triggers for stuff like distance. Something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #check_dist ?W_2 distance Civ_1 < 160: goto "w2speak" ?W_3 distance Civ_1 < 160: goto "w3speak" ?W_4 distance Civ_1 < 160: goto "w4speak" ~1 ?W_2 distance Civ_2 < 160: goto "w2speak" ?W_3 distance Civ_2 < 160: goto "w3speak" ?W_4 distance Civ_2 < 160: goto "w4speak" ~1 goto "check_dist" #w2speak W_2 SideChat "Sir, Civilians are coming up the hill from the south." exit #w3speak W_3 SideChat "Corporal, here's a couple walking over the hill trough the zone." exit #w4speak W_4 SideChat "Corporal, Sir! Two persons are coming towards the depot." exit Start from init.sqs or some single init line. And I don't think that corporals are called Sirs anywhere Share this post Link to post Share on other sites
limmy3 0 Posted March 27, 2007 Thank you very much Metal Heart, indeed. Regards limmy 3 Share this post Link to post Share on other sites