pyro05x
Member-
Content Count
19 -
Joined
-
Last visited
-
Medals
Community Reputation
0 NeutralAbout pyro05x
-
Rank
Private First Class
-
Spawn ai to return unused vehicles
pyro05x replied to HulkingUnicorn's topic in ARMA - MISSION EDITING & SCRIPTING
Would that place it at the marker or at the pos? Guess I'll go with your suggestion though - getmarkerpos, I mean. oh yeah you're right. that should work fine, then. the AI is far from intelligent in this game. usually if you don't add the vehicle to the group, the guys like to get out immediately. here is the script after a few changes retrieve.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehicle = this select 0; _base = getMarkerPos "RetrieverBase"; _lot = getPos west_parking; if {(alive RetrieverChopper) || (alive RetrieverPilot) || (alive RetrieverDriver)} exitWith {echo "One or more retrivers alive";}; if !(canMove _vehicle) exitWith {echo "Vehicle can't move";}; hint format ["%1 can move...", _vehicle];//can objects be turned into strings? RetrieverGroup = createGroup west; RetrieverChopper = createVehicle ["MH6", _base, [], 0, "NONE"]; //i threw out the reference to 'officials' and put the retriever group in its place RetrieverPilot = RetrieverGroup createUnit ["SoldierWPilot", _base, [], 0, "NONE"]; RetrieverDriver = RetrieverGroup createUnit ["SoldierWCrew", _base, [], 0, "NONE"]; sleep 1; [RetrieverPilot, RetrieverDriver, RetrieverChopper] join RetrieverGroup; {_x disableAI "target"; _x disableAI "autotarget";} forEach [RetrieverPilot, RetrieverDriver]; RetrieverPilot moveInDriver RetrieverChopper; RetrieverDriver moveInCargo RetrieverChopper; while {(RetrieverDriver distance _vehicle) > 100} do { RetrieverPilot doMove (getPos _vehicle); sleep 15; //i raised this a bit so that the ai doesn't stop and pause after 5 seconds of moving hint "ordering pilot to get in the vehicle"; }; RetrieverDriver action ["Eject", RetrieverChopper]; RetrieverPilot doMove _base; _vehicle join RetrieverGroup; //added vehicle to the group RetrieverDriver assignAsDriver _vehicle; [RetrieverDriver] orderGetIn true; //this command takes an array as it's parameter while {((driver _vehicle) != RetrieverDriver) && (alive RetrieverDriver)} do //added curly braces { sleep 5; hint "Player in vehicle or retriever not in vehicle yet."; }; while {(alive RetrieverDriver) && ((driver _vehicle) == RetrieverDriver) && ((_vehicle distance _lot) > 400)} do { RetrieverDriver doMove _lot; sleep 15; //i raised this a bit so that the ai doesn't stop and pause after 5 seconds of moving }; RetrieverDriver action ["Eject", _vehicle]; RetrieverChopper setPos [0,0,0]; //move the chopper so it doesn't expolode and kill someone. //according to the biki, setDammage doesn't take arrays as a parameter {_x setDammage 1; sleep 0.001; } forEach [RetrieverDriver, RetrieverPilot, RetrieverChopper]; hint format ["%1 (hopefully) retrieved...", typeOf _vehicle]; //assuming that it is... carstoretrieve = carstoretrieve - 1; i also noticed that your monitorvehicles.sqs file is a bit jacked up. using the publicVariable command WAY too much. don't put it in every if statement; only once after all the vehicles are checked. using publicVariable too much is bad...very bad. also, you should decide on whether you are using sqs or sqf syntax on there...because it looks like both were thrown in there. if i were you, i'd change it all to sqf because you appear to have that down correctly. and sqf the last few lines were a bit messed up for sqs syntax, so here's the proper stuff: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? (carstoretrieve > 0) : hint format ["Ran check, found %1 vehicles to retrieve", carstoretrieve] ? (carstoretrieve == 0) : hint "No vehicles to retrieve" [/code] and you don't need to use curly braces anywhere in sqs. -
Spawn ai to return unused vehicles
pyro05x replied to HulkingUnicorn's topic in ARMA - MISSION EDITING & SCRIPTING
it might be a good idea to give their group a name, as well. add the chopper and the vehicle that will be picked up to the group, too. oh and i noticed this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">retrieverchopper = createVehicle ["MH6", position "retrieverbase", [], 0, "NONE"]; retrieverpilot = officials createUnit ["SoldierWB", position "retrieverbase", [], 0, "NONE"]; retrieverdriver = officials createUnit ["SoldierWB", position "retrieverbase", [], 0, "NONE"]; you can't grap the position of a string. type string, expected object. if "retrieverbase" is a marker, use getMarkerPos. -
Spawn ai to return unused vehicles
pyro05x replied to HulkingUnicorn's topic in ARMA - MISSION EDITING & SCRIPTING
just skimming over your script and i do believe your real problem lies in the init file. you never called the script. just precompiled it EDIT: looking at it again this line in the first script stand out to me: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x disableai "target";} foreach units [retrieverpilot, retrieverdriver]; {_x disableai "autotarget";} foreach units [retrieverpilot, retrieverdriver]; you are grabbing a unit from an array? the units command should be used when you want to grab an array of units from a group. in this case, they are part of a null group, so their group is undefined. since you already have an array of the units, take out the units command. try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x disableAI "target"; _x disableAI "autotarget";} forEach [retrieverpilot, retrieverdriver]; short and simple. also it's a good habit to get into putting capital letters in your variable names and commands, it makes them easier to read. -
Syntax Highlighting for SQF and SQM/EXT
pyro05x posted a topic in ARMA - MISSION EDITING & SCRIPTING
first of all i have to say that i'm not responsible if you eff up your computer while following my instructions. 'nuff said. ok. i zipped up the files and put them on my web server. they can be downloaded here. Instructions for Notepad++: 1. extract the armaLang.xml file from the zip file to somewhere you can find easily 2. Launch Notepad++ 3. Open armaLang.xml which was extracted to the folder you're supposed to find easily 4. While you have this open, click on the file menu and open... 5. browse to the folder where you have Notepad++ installed. (ex. C:\Program Files\Notepad++). 6. Open up 'userDefineLang.xml'. 7a. If the file does not exist: add <span style='color:blue'><NotepadPlus></span> at the beginning of the file and <span style='color:blue'></NotepadPlus></span> at the end. save armaLang.xml into the above directory as this name: userDefineLang.xml . continue at step 12. 7b. If the file exists: click on the tab that says 'armaLang.xml'. 8. Go to Edit > Select All. then go to Edit > Copy 9. Switch back to userDefineLang.xml 10. go the the very very end of the file and put your cursor (not your pointer but the text insertion point) just before the <span style='color:blue'></NotepadPlus></span> and Edit > Paste. 11. Save. 12. close Notepad++ then re-load it. you're finished! Instructions for SciTE 1. Extract 'sqf.properties' and 'sqm.properties' to your main SciTE directory. (the one where SciTE.exe or Sc1.exe can be found.) 2. Load up SciTE. 3. under the Options menu, click on 'Open Global Options File' 4. scroll down a few hundred lines until you see a bunch of lines that start with $(filter.blahblah... 5. insert these 2 lines without screwing up any other lines: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">$(filter.sqf)\ $(filter.sqm)\ 6. ok now scroll down a bunch more and find the lines that look like Pe&rl|pl||\ and P&HP|php||\ 7. put these lines somewhere in there without screwing up any other lines: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">SQF|sqf||\ SQM/EXT|sqm||\ 8. now scroll down to the end where you see a bunch of imports. 9. paste these lines at the end of the file: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">import sqf import sqm 10. Save. Close SciTE. Load SciTE back up again and you're done. I hope you all get some use out of these. Send a pm or post a reply if you find them very useful. I like feedback. Notepad++ is currently my favorite for editing mission files. The explorer and favorites windows and RegEx search utilities are awesome. I know there are a few bugs in the Notepad++ syntax, but that's because of the limitations of the user define language system. Free software has yet to be perfected, but it gets the job done and gets it done just as well as pay software. EDIT: fixed notepad++ instructions for when the file does not exist. -
waypoints with multiple groups
pyro05x replied to pyro05x's topic in ARMA - MISSION EDITING & SCRIPTING
i started writing that crap and it's like.............serious pita. i started experimenting with the waypoints in the editor and each group has a move, hold, and cycle waypoint. only problem is that it's not easy to test by yourself hehe. well i've got 2 public boolean variables; wOwned and eOwned. these tell us who has control of the flag. the move waypoint has condition of xOwned, hold waypoint has condition of !xOwned. <s>the next waypoint is active after teh previous condition is met, correct?</s> i'm not exactly sure whether the cycle wp needs to have a condition or not. EDIT: struck text, answer found here -
in order for someone completely clueless to the subject of scripting and editing...the first place to start is to simply go out there and play some high-quality missions. put some objects down in the editor...this is where you figure out rotation, ranks, and object types. next, load up a mission template. look at the components and the way it's set up. there's not a whole lot of code in the mission editor, but it's where the content is. you should get the gist of things eventually. load up some of the files into notepad or your preferred text editor. while doing this, learn the syntax. most of the commands used are pretty self-explanatory, but for one you don't understand, look it up on the list. after a couple days, i figured out the basic structure of a mission...or so i thought... take a peek at mission design. this information is priceless because it tells us about so many different things! after that you should be able to take it from there. you will get better and better every day you study this stuff. heck...i still am getting better...smarter...faster...and getting less sleep. it's sort of a thing where you look at all these biki pages at once (thanks to firefox! tabbed browsing pwns). i remember when i had notepad, arma mission editor, and like 3 different biki pages open at once....it was a day to day thing. you have to want to learn it to learn it. if you're not getting it, you're not trying hard enough, because you don't want it enough. oh...and in case anyone in interested....i've got syntax highlighting keyword files for SciTE as well as Notepad++. i'll post them somewhere this week. EDIT: they are for file types SQF files and i have another for SQM and EXT.
-
I find the BI Wiki very useful...useful enough for me to make a search plugin for Firefox. I prefer it over the OFPEC com ref, which is very ugly and harder to navigate than any wiki. I do believe that beginners do have a lot of trouble if they don't have any prior programming experience (minimum VB, recommended c/c++). I'm one of those who's never edited for OFP or even played OFP. I bought ArmA some time before new years and started playing with the editor and researching stuff a couple weeks later. By the end of the month, I had both syntaxes down, and a few common commands memorized. I still use it regularly. if i can do it in 2-3 weeks, you can, too. and regarding the question thing... the talk pages are for questions regarding layout or clarification, or adding imfo you just figured out. Check here to for a better clarification of questions on teh Biki. <span style='font-size:11pt;line-height:100%'>Otherwise, THIS is where you ask questions!</span>
-
turning searchlights on without needing manning
pyro05x replied to warnlz's topic in ARMA - MISSION EDITING & SCRIPTING
does that work in multiplayer? -
i've got a problem as to how to go about changing the active waypoint for other groups when a group arrives at one that is the same as it. to keep things a bit more simple and to get my point across i'm keeping the numbers low... <scenario> ok...there is a flag and we have a have a public variable whoOwned which has an initial value of "neutral". this variable represents the team that controls the flag. let's say we have 2 groups on each side wg1, wg2, eg1, and eg2 each group contains 2 units. each group has an initial waypoint to move to the flag. let's say wg1 arrives at the flag. wg1's new waypoint is to hold position. wg2, eg1, and eg2's waypoints haven't changed. after wg1 is done waiting, whoOwned="west" and it is broadcasted. wg1 and wg2 should now have waypoints to defend the position. eg1 and eg2 still have a waypoint to move to the flag. wg2 is still at spawn because they are noobs. now let's say that eg1 and eg2 arrives at the location and shoot the crap out of wg1. the east team agrees that eg1 will switch the flags while eg2 covers them. the flag is switched, so whoOwned="east". wg1 respawns. wg1 and wg2 both now have waypoints to move to the location of the flag while eg1 and eg2 have waypoints to defend the flag. </scenario> it's obvious that it's a bit complex (i don't mind). i'm just not sure if it can be done using "CYCLE" waypoints or am i just going to have to rely on an entire waypoint management script that uses deleteWaypoint and addWaypoint. any suggestions?
-
sweet! thanks for the insight. messy code or overly complex code is something i absolutely hate.
-
KaRR's vrs.sqf is my favorite Check this thread
-
ok. i put some work into it and here's what i came up with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> if (_perpSide == west) then { if (wOwned) then { _pType = "defense"; } else { if (eOwned) then { _pType = "assault"; }; }; } else //_perpSide == east { if (eOwned) then { _pType = "defense"; } else { if (wOwned) then { _pType = "assault"; }; }; }; _pPoint = switch (_pType) do { case "assault":{_conAPoint}; case "defense":{_conDPoint}; }; _conAPoint=nil; _conDPoint=nil; if (local server) then { _perp addScore _pPoint; _perp sideChat format ["I killed a%1 %2er!", switch (_perpSide) do { case west:{"n OPFOR"}; case east:{" BLUFOR"};}, switch (_pType) do { case "assault":{"attack"}; case "defense":{"defend"};}]; }; if (player == _perp) then { if (_pPoint == 1) then { hint format ["You earned a flag %1 point!", _pType]; } else { if (_pPoint > 0) then { hint format ["You earned %1 flag %2 points!", _pPoint, _pType]; }; }; };
-
How to respawn into a flying parachute ?
pyro05x replied to Lonewolf1980's topic in ARMA - MISSION EDITING & SCRIPTING
from the BI Wiki: Description.ext: Respawn_Options, i believe the type you want is 3. when using this type you need to create a marker that defines where the team respawns. names are: respawn_west, respawn_east, etc. (m1 is a regular marker)How do you start the parachute as flying? What's the script command to specify the equivalent of: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Special="FLY"; since FlyInHeight might be restricted to aircraft(?) and using <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">p1 FlyInHeight 1000seems to be ignored. use setPos after creating the parachute object. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">p1 = "parachute" createVehicle [0,0,0] p1 setPos [getMarkerPos "m1" select 0, getMarkerPos "m1" select 1, 1000] player moveInDriver p1 -
any ideas for cleaning code that looks like this?: from my "onPlayerKilled.sqf" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">... if (_perpSide == west) then { if (wOwned) then { if (local server) then { _perp addScore _conDPoint; _perp sideChat "I killed a BLUFOR attacker!"; }; if (player == _perp) then { if (_conDPoint==1) then { hint "You earned a flag defense point!"; } else { if (_conDPoint>0) then { hint format ["You earned %1 flag defense points!",_conDPoint]; }; }; }; } else { if (eOwned) then { if (local server) then { _perp addScore _conAPoint; _perp sideChat "I killed an OPFOR defender!"; }; if (player == _perp) then { if (_conAPoint==1) then { hint "You earned a flag assault point!"; } else { if (_conAPoint>0) then { hint format ["You earned %1 flag assault points!",_conAPoint]; }; }; }; }; }; } else //_perpSide == east { if (eOwned) then { if (local server) then { _perp addScore _conDPoint; _perp sideChat "I killed an OPFOR attacker!"; }; if (player == _perp) then { if (_conDPoint==1) then { hint "You earned a flag defense point!"; } else { if (_conDPoint>0) then { hint format ["You earned %1 flag defense points!",_conDPoint]; }; }; }; } else { if (wOwned) then { if (local server) then { _perp addScore _conAPoint; _perp sideChat "I killed a BLUFOR defender!"; }; if (player == _perp) then { if (_conAPoint==1) then { hint "You earned a flag assault point!"; } else { if (_conAPoint>0) then { hint format ["You earned %1 flag assault points!",_conAPoint]; }; }; }; }; }; }; ... it looks pretty nasty, imo. i thought about testing various conditions beforehand and creating a string of binary numbers then using <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">switch {_s} do { case "0000":{blahblah;}; case "0001":{blehbleh;}; }; but it turns out that would really just be nasty and ultimately just more code.
-
maybe <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_foo = compile "5-1-_this"; for "_i" from 1 to 4 do { _bar = _bar + _i call _foo; }; or a one-liner: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_foo = _foo + (5-1-_x);} forEach [1,2,3,4]; the latter is merely a theory, it appears to be correct syntax, but sloppy, nonetheless.