Jump to content

dr_eyeball

Member
  • Content Count

    625
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by dr_eyeball

  1. dr_eyeball

    Pointer structures available?

    Need more info for the situation. You might need to elaborate on what these global variables are: object variables, string variables or what. Not sure if this is relevant for you, but if they're object variables, you may find the following handy: vehicleVarName setVehicleVarName The string value you assign to setVehicleVarName can be modified with the Format command. Eg: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">object2 setVehicleVarName Format[ "MyGlobalVar%1", _counter ]; where _counter is a number. - OR - object2 setVehicleVarName Format[ "%1%2", _var1, _var2 ]; where _var1 and _var2 are strings.
  2. dr_eyeball

    Scripting problems..still

    The syntax would be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this switchMove "AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground"but that won't work in the initialization part, probably because it gets immediately reset to the next action (like below). If you add it to a trigger or script somewhere and name the soldier soldier2, you then call: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soldier2 switchMove "AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground"He'll perform the sit action, but then get straight back up again. I don't know beyond that.
  3. dr_eyeball

    Random specific numbers

    _x1 = 175580; _x2 = 175591; _number = floor random (_x2-_x1+1) + _x1; or _number = floor random (175591-175580+1) + 175580;
  4. Overview & Main Goal: After looking at Kronzky's Urban Patrol Script ( UPS ), I thought it was great to have all of these random patrolling squads, but in addition, I also wanted to be able to automatically place lots of stationery squads simply hiding and guarding from within random house positions. Some of the big buildings have as many as 20-250 positions. I think this could be a useful script, if completed to include all the ideas listed below. Download: Test mission with THAG script version 1.0 Test mission with THAG script version 1.01 (fixed "move" with "setPos") Image 1 Problems: - I've just got it working, so it's not 100% tested yet, so if not used properly within it's limitations, it could potentially lock up ArmA due to excessive looping. i.e. changing the 2 constants or not placing units inside towns near local buildings. But I think I've caught any possible cases. - Also, it still appears to sometimes place 2 or more units near each other (or possibly inside each other). Still investigating whether this is legit. Usage: Adjust the script constants: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_MaxBuildingSearchRadius = 170; // Suggested range: 70-200 _MaxBuildingPositionsSearchCount = 38; // Potential range: 1-250. High values may cause long start-up delays, until optimised. Add a few enemy squads and set the initialization for each Squad Leader to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fn = compile preprocessFile "THAG.sqf"; [this] call fn; - OR - nul=[this] execVM "THAG.sqf"; The script should be self initializing, I hope. (See THAG_OccupiedHouses var.) I suggest you uncomment this line for testing, if you've got Kronzky's 3D Markers mod installed. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// [_x, "lg", east] execVM "attachmarker.sqf"; // debug Future ideas: - use FindCover to hide them further. - Failure to find an unoccupied house position, should simply expand the house search radius and try again. - Add waypoints to "GUARD" position - Watch a direction away from walls - Speed up search for house positions count, using a binary search. - stop AI standing on wall edges due to collision with nearby objects I'm still working on it, but any advice on improving this is welcome.
  5. dr_eyeball

    Town Hide and Guard script (THAG)

    I didn't know about that one. Yeah, it looks like it does virtually the same thing, the way it is now. Oh well, good scripting practice anyway. If I can improve upon it, I'll let you know. Thanks for the link. Just rechecking the other script: - it doesn't seem to check whether a building position has already been occupied by a previous person - it limits the building positions to 40, instead of 250+ - it may create a group with an odd unit counts (eg: 3 Squad Leaders)
  6. dr_eyeball

    choosing infil type and location ?

    Try using parameters. It'll allow you to select from up to custom 2 lists on the MP start-up dialog. You can use 1 for your start position.
  7. dr_eyeball

    Referring to an object by ID #

    nearestObject_id does and maybe some of the other "nearest..." type commands.
  8. dr_eyeball

    Get ID of object

    Yes I know "Show ID's" button works, but I need to deal with hundreds of ID's randomly based on their class type, so you can guess now that I wanted it to be obtained programatically. I guess I just wanted confirmation whether a command for it exists, given that some commands still expect a StaticObjectID instead of the object itself, with no way of automatically obtaining it. Reading elsewhere, apparently OFP had a suitable command but it's not in ArmA. Thanks.
  9. Quick question: Q: How do you get the (Visitor) ID of a static object (like a house) programmatically? (Assuming you've got an object variable of the house already using something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Houses = [getPos _unit select 0, getPos _unit select 1] nearObjects ["House", 50]; _House = _Houses select (floor (random (count _Houses))); _id = ? ? ?; ... _waypoint = _group addWaypoint [ position _House, 0 ]; _waypoint waypointAttachObject _id; // <- need the id for here _waypoint setWaypointHousePosition 1; There are lots of functions to get an object from an ID, but I don't see one going the other way. Thanks in advance.
  10. Is there a list of parent classes or types or is there a hierachy involved or where do you get these parent types from? Is this info in one of the main pbo files somewhere? I can see topics like ArmA_Classes, but they only have specific classes and types. When you use commands like: nearestObjects, nearestObject_type or nearObjects, they all require a generic parent type like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">- Vehicle - Weapon - Car - House - Tank - quite a specific sub type - StreetLamp - quite a specific sub type For example, I need a sub type of "house" for just buildings, but "house" itself includes things like walls and promenades "Land_podesta_..." types, etc. I've also examined: typeOf and isKindOf, but they are too specific. Anything like that around? Thanks. Edit: Looks like some of this info could be found in config.bin's *.hpp files. Not many parent or sub classes to choose from.
  11. I think I've found the solution to your problem (and mine). Check the command buildingPos: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">building buildingPos index; - or - buildingPos [building, index]; I'm just finishing off a script now which should randomly populate a town with the AI inside all the local buildings, which should be cool. Still need to deal with collisions. You could combine that with the UPS script and it would be great.
  12. Yes it's that simple, there's nothing special about using an init.sqf file except that it allows you to use the new sqf syntax (great for multi line statements). It seems to get automatically called at the same time as init.sqs, not sure what order though, but I don't use init.sqs anymore, when possible.
  13. Yeah I asked the same problem here. Some suggested that the Initialization fields of units possibly get executed before the init.sqs script. Not sure if it's true, but the way you did it won't work. Just change your initialization field to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ReArmEast = compile preprocessFile "ReArmOpfor.sqf"; [R1] call ReArmEast Or if you have too many of those sort of calls, you can move all the code into your init.sqf file. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ReArmEast = compile preprocessFile "ReArmOpfor.sqf"; { [_x] call call ReArmEast; } forEach [R1, R2, R3, R4];
  14. dr_eyeball

    Full report on Armoury in ArmA

    Cool tests. If you want to get official, you would need to tabulate the information into a spreadsheet to make it more readable. Plus for the items you've marked "(wrong)", perhaps add your recommended value. Others say it doesn't matter if the values are out, which is true if it's out by a factor of 2, but if it's out by a factor of 10 or more, then it needs to be rechecked. So perhaps include a multiplying factor value to give a simple check of how far it's out. Unless I'm just misreading the data. Nice effort.
  15. When you've got Radio Commands (like: Alpha, Custom, etc), it can be accessed by higher ranks (like Squad Leaders) by both: - the Main Menu (0-Reply, 0-Radio) and also - using the Radio on the map screen. But as a regular grunt (lower ranked soldier), you cannot access the radio via the Main Menu, but you can still use the Radio on the map screen. Is this a bug? It seems to me it is. I presume the easiest way around it is to "setRadio false" for each grunt (which is easy enough). However, I'm not sure whether you could forcibly enable the Main Menu radio options for grunts though.
  16. dr_eyeball

    Get ID of object

    The id from SetVehicleId doesn't appear to be suitable for the waypointAttachObject where I need it. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">waypoint waypointAttachObject idStatic There must be a way to get the proper static ID. Edit: Or it may be that waypointAttachObject doesn't work, even with a valid ID from the map. There doesn't seem to be a way to get the number of house positions in a building either, for use by setWaypointHousePosition.
  17. dr_eyeball

    Detecting unit in the area?

    - Create player MikeOne - Create your trigger - set activation to "PRESENT" - set On Activation: "hint "Mike's here";" - Switch to Groups (F2) - Drag a link between MikeOne & the middle of the trigger. (This will change the triggers's Activation list and set it to "Vehicle".) That should work.
  18. dr_eyeball

    Global and private commands

    Not sure about the execVM variations, but with relation to global/private variables, I posted a similar topic Scope of variables recently. The replies directed me to Variables#Namespace. Don't know if that helps.
  19. Not sure if this might help you. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Script=[] ExecVM "Script.sqs"; Sleep 5; Terminate _Script; Hint "Script.sqs has been terminated after 5 seconds"; taken from BIKI: terminate
  20. dr_eyeball

    teamspeak IP included in mission briefing

    That would be good. I guess you should add this to the wish list if you want it. Hoz, he is not talking about a hard-coded TS IP address being in the mission itself or something. He means that it would be good to have something like a Server welcome message box displayed somewhere in the game, which is easily accessible at any time. eg: a new Welcome Message boxed region on: - the Briefing screen, or - on the List of Players dialog (key P) or - even on the Loading Screens themselves. Good to learn about the scroll back option though.
  21. dr_eyeball

    Stupid noob question

    Back to your sync'd waypoint problem, it is almost right. The radius of the trigger is irrelevant when Activation=Alpha. So you can set it to a small number like 0 or 5. (The waypoint of your player is not required for this discussion.) The tank (or chopper) needs 2 waypoints. Leave the first waypoint close to your tank and sync it like you already have, then the add a 2nd waypoint for where you want it to move after Alpha trigger is called.
  22. You need to look up the usage of the commands in the wiki. The examples are just a guide. As far as syntax goes, it's something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(damage (position ManuallyPlacedNearbyObjectX nearestObject 161744)) > 0 but nearestObject id has a 50m radius restriction. Side Note: I absolutely cannot understand why the radius restriction exists nor why you need a position, when you know the exact Visitor ID. (The restriction is fine for the other nearestObject command though).
  23. dr_eyeball

    Stupid noob question

    @Winters1807: I think you may be confusing the terminology used. TeamSwitch is a new feature to ArmA which wasn't in OFP. It brings up a dialog to allow you to switch to another player. What you're probably looking for is Respawning either via the built in functionality using markers and description.ext settings (which is easy to do) or via scripting (for fancy stuff). You can then spawn into remaining live AI players or infinitely at specific locations. There's a heap of threads in this sub-forum to conver that topic.
  24. dr_eyeball

    Stupid noob question

    I don't think you can TeamSwitch in MP, only in SP. Using the editor's Preview option is the same as running it as SP.
  25. Is there any reason why 70% of missions are created without a Mission Name & Description? I perhaps wonder if some don't know how because it's not fully obvious (or are they just lazy?) Please start adding this to all your missions. 1. Adding Description In the editor, simply click on the Intel box which brings up the Intel Dialog to input the Mission Name, Description and set the weather. Once added, this will add a section to your mission.sqm file with: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Mission { .... class Intel { briefingName="My Mission Name"; briefingDescription="My Description"; startWeather=0.100000; forecastWeather=0.300000; year=2007; month=6; day=7; hour=8; }; class Groups { .... } .... } 2. Format The common format includes the game mode and player count and sometimes a version, as in: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">My Mission Name (Coop 20) v1.2 It will appear in the mission selection dialog plus the briefing title plus the debriefing title plus all stats software. Otherwise all you will see is "filenamex.sara" (and some of those are badly named too, but that's for another day). As well as the above, it would be good to add to the description.ext file, the following lines: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onLoadMission="<Your loading screen message>"; OnLoadIntro="<Your intro message>"; 3. String Table In both cases you can reference a string table entry as: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">briefingName="@STR_MP_MISSION_TITLE"; and <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onLoadMission=$STR_MP_MISSION_TITLE; I know it's dead simple and there's much more you can add, but even just the bare minimum above is not happening. It will be much appreciated.
×