Jump to content

MuadDib

Member
  • Content Count

    23
  • Joined

  • Last visited

  • Medals

Everything posted by MuadDib

  1. hey there, Just trying to convert an old sqs script into the new SQF format its the Airstrike one from murray (I think) anyway its giving me an error on line 36 saying missing ";", Ive triple checked it multiple times and for the life of me I cant figure it out (Im guessing its something glaringly obvious that I just cant see) here is the entire sqf file for reference. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> comment"=========DEFINE======================="; "Firedirection" setmarkerpos getpos ASTarget; _dropPosition = getpos ASTarget; sleep 0.5; _dropPosX = _dropPosition select 0; _dropPosY = _dropPosition select 1; _dropPosZ = _dropPosition select 2; sleep 0.1; _planespawnpos = [_dropPosX - 3000, _dropPosY, _dropPosZ + 1000]; _pilotspawnpos = [_dropPosX - 3000, _dropPosY, _dropPosZ + 1000]; comment"=========CREATE======================="; sleep 0.1; _plane = "AV8B" createvehicle _planespawnpos; _plane setpos [(getpos _plane select 0),(getpos _plane select 1),900]; _pilot = "SoldierWPilot" createUnit [getmarkerpos "Firedirection", dummy,"pilot1=this"]; _Plane setVelocity [50,0,0]; sleep 0.4; pilot1 MoveInDriver _plane; pilot1 setdamage 0; pilot1 action ["gear_up", vehicle pilot1]; _plane FlyInHeight 100; _plane SetSpeedMode "full"; while {(_plane distance ASTarget) > 1500}do { pilot1 doMove getpos ASTarget; pilot1 dotarget ASTarget; pilot1 dowatch ASTarget; } sleep 5.2; _plane FlyInHeight 90; _plane setpos [(getpos _plane select 0),(getpos _plane select 1),100]; sleep 1.05; _plane fire "BombLauncher"; sleep 0.1; _plane fire "BombLauncher"; sleep 0.6; _plane fire "BombLauncher"; sleep 0.1; _plane fire "BombLauncher"; sleep 0.6; _plane SetSpeedMode "normal"; sleep 3; _plane FlyInHeight 600; pilot1 doMove getpos Dummy; pilot1 dotarget Dummy; while{(_plane distance ASTarget) < 2500 }do { _plane Setdamage 0; pilot1 Setdamage 0; pilot1 MoveInDriver _plane; } ASTarget setpos getpos Dummy; "Firedirection" setmarkerpos getpos Dummy; deletevehicle _plane; deletevehicle pilot1;
  2. hmm still havent found the cause of the total failure in the script. Im beginning to think it could be something BIS changed in 1.05 as when I ran this exact script on a pre 1.05 install it worked. Either that means they "optimised" something which in turn broke my script or it was an inadvertant error.
  3. cheers for that mate, was looking for a good debug method. Reminds me of printf anyway the plane stays alive until about the 2400m mark, Im pretty sure it does a nice graceful unpowered fall from the 3000m mark. whats a good method to confirm the pilot is indeed inside the plane. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Player SideChat Format ["Pilot is in %1 ",(vehicle pilot1)]; will that work?
  4. the code I gave is the exact contents of the sqf file. That file is called via the execVM command in a trigger on radio alpha. please note FireDirection marker, ASTarget, dummy logic and invisible H called ASTarget_1 are all included in the map (pretty sure thats all thats needed to execute it) please note this script works fine pre 1.05
  5. OMG... gotta get used to this darn syntax lol nailed it But the script doesnt seem to do anything anymore lol this is using 1.05
  6. MuadDib

    Mines a MINE

    seriously, look like 5 topics down from yours....
  7. if Im not mistaken SQF is more C like, therefore while/for loops should work just as well right? or am I way off track?
  8. MuadDib

    Infinite area triggers

    I use plenty of triggers that do this, such as getting a trigger to fire when a certain unit dies or making it trigger when someother conditional statement happens. I use mine to have several different ways to end a mission for example.
  9. MuadDib

    Mission Design Team

    ruddy good idea I say.
  10. MuadDib

    a newbie's question

    try going to ofpec.com they have lots of stuff to help with editing too. Though of course the best way is to practice practice practice
  11. MuadDib

    Newbie scripting question.

    just a quick query on that format but doesn't getpos return an array anyway so would it not be more efficient to simply put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">marker1= createMarker ["MyMarker",getpos objectname ]; instead of initializing getpos twice? or is this not allowed by the engine? ( I cant test it at the moment as I am not at home.)
  12. MuadDib

    Onmapsingleclick and a spawn question

    as far as I can tell, sqs files still function if they have ? and ~ at least my scripts still do :P must be something else
  13. Ok ive been trying to get this particular little script to work for me as well and I think Im having the same problem, the plane makes a successful bombing run however nothing goes boom :P Im positive the script runs as I've tested the trigger and it works. Another issue as well is it seems that the plane has ummm for lack of a better word guidance problems every now and then, it takes off but does not make a successful run over the waypoint. Its totally random though as I just restart the mission and it will work again, when it does bugger up it seems the plane misses the mark by a few hundred meters or so but it does not come back and try again (ie it has flagged the waypoint as done)
  14. so the soldiers riding in the blackhawk are in the same group as the blackhawk itself? if this is the case then I suggest making them into a separate group then simply giving them separate orders to the blackhawk group. That way you should be able to change their mode and not affect the way the chopper behaves.
  15. Hi there, please note I am a total noob when it comes to scripting :P Basically I have a trigger that executes a script fine, I want that script to spawn a transport chopper of the east side at a gamelogic location in flight as s2_group(for naming sake) I also want the script to spawn around 5 SoldierEB's as s1_group in the cargo of the chopper and then move the chopper to a gamelogic position called ND2. At that point I want s1_group to exit the chopper and make their way to gamelogic position ND1. This is what Ive come up with sofar and it doesn't work of course :P <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> "Mi17_MG" createUnit [position NDCS, s2_group, "east_chop = this", 1.0, "corporal"]; "SoldierEB" createUnit [position NDCS, s1_group, "NDU1 = this", 0.6, "corporal"]; "SoldierEB" createUnit [position NDCS, s1_group, "NDU2 = this", 0.6, "private"]; "SoldierEB" createUnit [position NDCS, s1_group, "NDU3 = this", 0.6, "private"]; "SoldierEB" createUnit [position NDCS, s1_group, "NDU4 = this", 0.6, "private"]; NDU1 assignAsCargo east_chop; NDU2 assignAsCargo east_chop; NDU3 assignAsCargo east_chop; NDU4 assignAsCargo east_chop; _waypoint0 = s2_group addWaypoint [getMarkerPos "ND1", 0]; _waypoint0 setWaypointType "TR UNLOAD"; _waypoint0 setWaypointStatements ["true", ""]; _waypoint1 = s1_group addWaypoint [getMarkerPos "ND1", 0]; _waypoint1 setWaypointType "GET OUT"; _waypoint1 = s1_group addWaypoint [getMarkerPos "ND2", 0]; _waypoint1 setWaypointType "MOVE"; Please note I have another gamelogic called NDCS which is pretty far out to sea. I also run 2 bits of script that create groups called s1_group and s2_group figured out some more stuff but still haven't got it working
  16. by using unnassignvehicle I have been able to get the chopper to land and the squad to exit and follow some other waypoints. Cheers for all the help to everyone :P Its weird how we get different behaviour when the waypoints are scripted or placed in the editor.... btw I tried the assigndriver to the pilot before he is moved in but that didnt work, the only way to get it to land was by using unassignvehicle on each of the infantry squad members in a separate script file executed when the chopper reached its first waypoint.
  17. how do you make the unit join the group of the deleted unit? I have no idea what the group of that deleted unit is called. Is there a default name? I have tried in the init of the deleted unit to put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> [this]join s2_group; deletevehicle this; but that doesnt seem to work either
  18. cheers for helping :P what do you mean that it all works when you enter the waypoints in the editor? how can you add waypoints for units that dont exist? lol here I thought I would try out something easy for my first foray into scripting :P
  19. cheers mate, the chopper now flies to the waypoint however he doesn't land, ive tried giving him several different types of waypoints such as UNLOAD and TR UNLOAD. Ive even changed the waypoint location to an invisible helipad and he still doesn't land I have also tried putting in <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _waypoint1 setWaypointStatements ["true", "eastchop land "LAND""]; however it gives me an error saying expected object yet recieved string when clearly that command as far as I can tell is correct. Any ideas on how to get this helicopter to land?
  20. it still goes in the incorrect direction no change on how it behaves
  21. ok, I moved myself into the chopper after its created to try to figure out where its heading and as far as I can tell it just continues to head SouthWest which is pretty much opposite to where it should be going (out past rahmadi lol) what have I done wrong? btw latest piece of code is up there ---^
  22. lol yes it is :P now though it seems the chopper does not want to go to the waypoint, it ends up flying somewhere else completely... not sure where though here is the updated code so far :P <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> eastchop = createVehicle ["Mi17_MG", position NDCS, [], 0, "FLY"]; "SoldierEPilot" createunit [position ND2,s2_group,"EPilot1 = this", 1, "PRIVATE"]; EPilot1 moveindriver eastchop; EPilot1 action ["ENGINEON", eastchop]; "SoldierEB" createUnit [position ND2, s1_group, "NDU1 = this", 0.6, "corporal"]; "SoldierEB" createUnit [position ND2, s1_group, "NDU2 = this", 0.6, "private"]; "SoldierEB" createUnit [position ND2, s1_group, "NDU3 = this", 0.6, "private"]; "SoldierEB" createUnit [position ND2, s1_group, "NDU4 = this", 0.6, "private"]; NDU1 moveincargo eastchop; NDU2 moveincargo eastchop; NDU3 moveincargo eastchop; NDU4 moveincargo eastchop; _waypoint0 = s2_group addWaypoint [getMarkerPos "ND1", 0]; _waypoint0 setWaypointType "TR UNLOAD"; _waypoint0 setWaypointStatements ["true", ""]; _waypoint1 = s1_group addWaypoint [getMarkerPos "ND1", 0]; _waypoint1 setWaypointType "GET OUT"; _waypoint0 synchronizeWaypoint [_waypoint1]; _waypoint2 = s1_group addWaypoint [getMarkerPos "ND2", 0]; _waypoint2 setWaypointType "MOVE";
  23. cheers for replying :P and yes I was kind of working on it when I was posting too so I ended up editing the post like 3 times :P Anyway, the plan was for the chopper to spawn in midair with the units inside it instantaneously. Ill keep trying though, hopefully with some of the stuff you have given me I might be able to get closer
×