Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by poweruser

  1. Trigger-Condition: OMGPlayerHasRunTheScript exec in the action/script: OMGPlayerHasRunTheScript = true; publicVariable "OMGPlayerHasRunTheScript";
  2. Can you explain more in detail what you mean with I've not yet seen a script stop working on its own because of other reasons than wrong syntax or type mismatch. And your code looks fine to me.
  3. poweruser


    When you dont find the right config files, you might have better luck reading the game config within the game. put this in a radio trigger or script: ammoClass = (configFile >> "cfgAmmo" >> "Bo_FAB_250"); hint format["Ammo: %1\nHit: %2\nIndirectHit: %3\nIndirectHitRange: %4",configName ammoClass,getNumber(ammoClass >> "hit"),getNumber(ammoClass >> "indirectHit"),getNumber(ammoClass >> "indirectHitRange")]; Same goes for the lgb, just exchange the class name in the first line of code.
  4. Creating objects/vehicles on the client side creates desync/lag and shall be avoided whenever possible. It should work though, as createvehicle has global effect. I don't know what's going wrong with your current code, without having a look at it. You might want to post all the code that is run after the client activates that action. But let's get back to how to do it properly: Creating vehicles should be done by the server, to achieve that the client has to tell the server that he wants to have a vehicle created. Send it a message using publicVariable pvRequestVehicle = []; // put all info you want to send in this array publicVariable "pvRequestVehicle"; On the server you need a publicVariable-eventhandler listening to that very global variable (same name) the client is publishing, to register the request of the client and process the request "pvRequestVehicle" addpublicvariableeventhandler { [indent]_info = _this select 1; // the array with the info the client has sent // code that creates the vehicle[/indent] }; You said you're also setting variables in the vehicles variable space. When those variables shall set for all clients then run setVariable on the server with the boolean flag to broadcast it to all connected machines. When only the client that sent the request shall have the variables in the namespace set, then you the same thing as above, but this time the other way around. The server sends out a message to the clients, the clients listen to this message (use a different variable name than the one above for this). To run the code only on the client that issued the request you need to send information with the request, and the server sends it back, that identifies that client unambiguous. For that you can use the players unit, or generate a random id. EDIT: Note: When you publish a variable and you have a pvEH running on the same machine listening to the very same variable, then the pvEH won't trigger (source). This can happen in a SP game and in MP with a client-host as server. Therefore you need to check whether the current maching is the server before sending out the request message: if(isServer) then { [indent]// run the code that the pvEH on the server would run in a mp game[/indent] } else { [indent]pvRequestVehicle = []; // put all info you want to send in this array publicVariable "pvRequestVehicle";[/indent] };
  5. You shall not overwrite script commands by creating a global variable which has the same name as a script command. Check all your scripts and trigger codes for that again, because overwriting publicvariable first (like you tried and actually did in your 3rd post) and then trying to use it the as scripting command, causes the exact same error message, as the one that arma2 is throwing at you.
  6. poweruser

    Too many vertices problem

    That sounds exactly like what I experience sometimes, that Oxygen fails to correctly update the sections count, after you've done a change. Try this: Identify the 6 sections. (All objects with the same face properties [texture, material, ...] usually form one section). Spilt your model up into 6 lods, so that every lod has one section only (these 6 lods serve as clipboards right now). Then create the proxy. The sections count of the clipboard lod, where you do that in should raise to 2. Cut and paste the proxy selection into a 7th clipboard lod, to make all clipboard lods to have only one section again. Finally cut&paste all clipboard lods back together into one. The resulting sections count should be 7 or lower (depending on what you move into the proxy model. i.e. a part of a section, a whole section, or several whole sections).
  7. You could store this waypoint status information (heli_wp0_done, heli_wp1_done) in the variable space of the respective helicopter. As every object has its own variable space, you won't have a conflict. _heli setVariable ["heli_wp0_done", false]; // ... _heli_wp0 setWaypointStatements ["true", "(vehicle this) setVariable [""heli_wp0_done"",true];"]; // ... waitUntil { _heli getVariable "heli_wp0_done" }; instead of heli_wp0_done = false; // ... _heli_wp0 setWaypointStatements ["true", "heli_wp0_done = true;"]; // ... waitUntil { heli_wp0_done }; same goes for 'heli_wp1_done'
  8. When scripting this, I wouldn't use waypoints for it. But what you do is up to you, maybe someone posts a solution that uses waypoints later. helidrop.sqf (blue code is new/changed): assert (count _this == 5); _heli_class = _this select 0; _heli_source = _this select 1; _heli_dest = _this select 2; _heli_pilot = _this select 3; _heli_passengers = _this select 4; assert (typeName (_heli_class) == "STRING"); assert (typeName (_heli_source) == "OBJECT"); assert (typeName (_heli_dest) == "OBJECT"); assert (typeName (_heli_pilot) == "OBJECT"); assert (typeName (_heli_passengers) == "GROUP"); // Create heli at source H. _heli = _heli_class createVehicle (position _heli_source); _heli setPos (position _heli_source); // Move pilot into heli as driver. _heli_pilot moveInDriver _heli; _heli_pilot_group = group _heli_pilot; [color="Blue"]{_x assignAsCargo _heli; _x moveInCargo _heli; } forEach (units _heli_passengers); _heli move (getpos _heli_dest); waitUntil {unitReady _heli}; _heli land "GET OUT"; {unassignVehicle _x; } foreach (units _heli_passengers); waitUntil { {_x in _heli} count (units _heli_passengers) == 0}; _heli move getpos (_heli_source);[/color]
  9. I'm sorry that I go into this very basic topic, but from these statements ... ... I take it, that you have a wrong understanding of how this stuff works. The ai DOES NOT run your script, your game does. And with the script you can order the ai to do or even not to do certain things. But initially your script has nothing to with any ai unit, nor is any ai bound to your script in any way, until you start giving the appropriate orders to these ai units. As the ai driver hasnt received any orders from your script down to line 24 (sleep 10; ), that unit is still totally independent from your script, and therefore not affected by it. In other words: So far, the ai tank driver gives a damn about that new running script. He at most laughs at you suspending its execution for 10s and then puts the pedal to the metal. Now, what you want is: The ai driver shall not start driving away until the script has finished doing its thing (delay 10s, play a sound, do some engine startup effect). In order to achieve this, you have to give the appropriate order to the ai driver, like: UNIT disableAI "MOVE"; which disables the AIs ability to move/drive. After the script has done all the things it is supposed to do, you you need to enable its ability to move/drive again, UNIT enableAI "MOVE"; as the ai shall now perform the tank commanders orders.
  10. I've never used forceSpeed before. Just tried it and it doesn't do anything at all (Arma1 1.16beta, maybe its fixed in ArmA2).
  11. It's easier to prevent an AI from moving than a human player. I assume that the engine eh is added on all machines (server and clients). merge this with your 'tank_start.sqf' private["_veh","_state","_unit"]; _veh = _this select 0; _state = _this select 1; _unit = driver _veh; if(local _unit && _state) then { _unit disableAI "MOVE";}; // play the engine start sound and wait if(local _unit) then { _unit enableAI "MOVE";};
  12. There's a little misunderstanding here. Let me try to clear it up. The predefined variable player always points to the unit that you control in a multiplayer game (unless you have accidently overwritten that variable with something else). As every client controls a different unit, the variable is different on each client. It doesnt matter if you're controling a unit which you have set as PLAYER or PLAYABLE in the editor, in multiplayer they are basicly all PLAYABLE. From what you've described, I bet that the unit set as PLAYER and all PLAYABLE units are in the same group, with the unit set as PLAYER being the group leader. You need to change that, every PLAYER/PLAYABLE unit needs to have his own group, because it's not possible for a group member (not leader) to be a group leader himself of other units.
  13. poweruser

    Random start position

    black code is yours, everything blue is new. [color="Blue"] if(isServer) then { [indent]_initialLeaderPos = getPos Lead;[/color]_Number = floor(random 5); _marker = Switch (_Number) do { [indent] case 0: {"Start0"}; case 1: {"Start1"}; case 2: {"Start2"}; case 3: {"Start3"}; case 4: {"Start4"};[/indent] }; _pos = getmarkerpos _marker; Lead setpos _pos; _StartMarker = createMarker ["Start",_pos]; _StartMarker setMarkerType "Start"; _StartMarker setMarkerColor "ColorBlue"; [color="#0000ff"]pvStartPosition = [_StartMarker, _marker]; publicVariable "pvStartPosition"; _scenery = nearestObjects[_initialLeaderPos, ["ALL"], 200];[/color] // alternative: array, which holds all scenery objects [color="#0000ff"]{ [indent]_diffx = ((getpos _x) select 0) - (_initialLeaderPos select 0); _diffy = ((getpos _x) select 1) - (_initialLeaderPos select 1); _diffz = ((getpos _x) select 2) - (_initialLeaderPos select 2); _x setPos [(_pos select 0) + _diffx, (_pos select 1) + _diffy, (_pos select 2) + _diffz];[/indent] } forEach _scenery;[/indent] } else { [indent]waitUntil { !isNil "pvStartPosition" }; (pvStartPosition select 0) setMarkerType "Start"; (pvStartPosition select 0) setMarkerColor "ColorBlue";[/indent] };[/color] // Debug player sidechat format["%1",(pvStartPosition select 1)]; This is going to be a multiplayer mission, right? Be careful with the command random then, as every computer will generate a different number. Handling random stuff needs to be done on only one connected machine, preferably the server, as it's available throughout the whole mission. The random number and setPos of the scenery stuff has to be done on the server only. The things that have to be processed on the clients are those commands which have local effect only, i.e. afaik setting the marker properties and the debug chat message.
  14. poweruser

    Too many vertices problem

    You don't need anything in the config to make 'static proxies' (that's what i call them, opposed to driver/gunner/cargo proxies for units) work. After you have moved the selection to a proxy (Right click the selection in the 'Named selections window, then click 'Move selection to Proxy'), make sure the 'Proxy Name' (Right click the proxy selection and click 'Rename') points directly to the new file (i.e. \addonname\file.p3d). To check if its working its enough to preview in Buldozer. @sections Happens occasionally for me, too. Sometimes its enough to switch to another lod and back, to make Oxygen refresh the sections count. But most times I have to manually split up all sections to temporary different lods (to have 1 section per lod) and then merge them back together one by one.
  15. poweruser

    how to empty condition

    you need to read the units from the group first 'units GROUPNAME' {_x in VEHICLE} count (units GROUPNAME) == 0
  16. poweruser

    how to empty condition

    checking for certain units: {_x in VEHICLE} count ARRAY == 0 checking for an empty cargo space: count ((crew VEHICLE) - [commander VEHICLE, gunner VEHICLE, driver VEHICLE]) == 0 VEHICLE => your chopper ARRAY => an array holding all units to check for
  17. poweruser

    Weird error "Bad version 48 in pd3 file""

    He compiled his addon with the ArmA2 tools (creates pbo version 48) and then ran ArmA1 (uses pbo version 40) with it. The solution is simle. Compile addons for ArmA1 with the Arma1 tools, and addons for ArmA2 with the ArmA2 tools. Don't mix them.
  18. in the desctiption.ext class Params{ [indent]class someClassName { [indent]title= "string"; texts[]= {"string1","string2","string3"}; values[]= {1,2,3}; default= 1; [/indent] }; class someDifferentClassName { [indent]title= "string"; texts[]= {"Yes","No"}; values[]= {1,0}; default=1;[/indent] };[/indent] }; Each parameter has its own class with its settings in the class Params. In the mission you can access the set values over the array paramsArray. The first value in this array (paramsArray select 0) is the one from the first Params subclass, the second (paramsArray select 1) is from the second one, and so on. If you need more parameters when just add another subclass and adjust it.
  19. (east countside thislist) < 4 'Activation' of the trigger must be set to either EAST/OPFOR or EVERYONE, because the array 'thislist' holds only those units which comply the triggers settings. Otherwise the east units won't be included in the array 'thislist' and the trigger will activate right away at start, with the condition that I typed above.
  20. That warning appeared for me too, when porting one of my addons from arma1 to arma2. I've identified the flags 200, 201, 202 and 203 so far Setting the lighting option to "normal" will fix this message, for these four ones.
  21. poweruser

    Too many vertices problem

    You can split up your model into several models (one main model with several proxy models). That's how I did a 63k points and 74k faces space ship interior model. In the main model I leave all the selections that are being animated and/or setObjectTextured as I havent found out yet, how to do these thing within proxy models. Using proxies this way is also a great way to keep the number of sections at a minimum, and therefore having almost no performance impact, even with very detailed models. The least number of sections you can have in a model (when texturing is done right) is the number of textures you use in it (no texture counts as one too). The trick is move all selections/faces with the same texture into one proxy model. What you end up with then, is one main model with very few sections, depending on what you leave in it, and several proxy models, each having only one section.
  22. You're using the command 'publicVariable' wrong, the name of the variable you want to broadcast, must be given in quotes. publicVariable "NewTargetName";
  23. Setting the pilot's behavior to 'careless' will do it group/unit setBehaviour "CARELESS";
  24. What do you mean with "the plane can't move"? I tested it in ArmA1 (dont have ArmA2) with a slow and fast plane (Camel and Su34) and worked for me. First accelerate normally a bit then activate the script and you have to pull up yourself.
  25. Or let someone stupid like me write you a script (The heck with it, just for the fun of scripting) Goes into the init line of the plane: this addaction ["boost", "boost.sqf"]; boost.sqf: Play around with the variables _boost_interval , _max_velocity and _boost_factor to get the desired results.