Jump to content

poweruser

Member
  • Content Count

    247
  • Joined

  • Last visited

  • Medals

Everything posted by poweruser

  1. Oh well, that's my error. Change it, then it should work.
  2. When you use a trigger, all of it goes into the 'On Activation' field. You can also use another script to do it, whatever you like. Like I said, run it at the time you want the groups to start attacking, where you do it is up to you. Then you haven't either defined the two arrays in the init.sqf. Or you didn't set up the waypoints of the groups, the way I suggested it at the beginning of my last post.
  3. Ok, here's one way to implement it then: A waypoint has a condition, when it's false the group perfroms that waypoints (the one with condition being 'false') orders but then waits for the condition to become 'true' before performing the next waypoint. Give those waypoints that send the groups at the place where they shall wait first, before being sent to attack, following conditions: for the 1st group: 1 in attackorders for the 2nd group: 2 in attackorders and so on.. In the mission init script, define this: squadarray = [1,2,3,4,5]; attackorders = []; And this is the complete script. Only execute it once, at the time you want the groups to start attacking. if(isServer) then { [] execvm "scriptname.sqf"; }; scriptname.sqf: private["_rnd"]; while {count squadarray > 0} do { [indent]_rnd = squadarray select (floor(random(count squadarray))); squadarray = squadarray - [_rnd]; attackorders = attackorders + [_rnd]; sleep (90 + random 20);[/indent] }; ================================================ @while loop in first post script example: you have to use the double equals sign == ,when you want to check whether two values are equal. Single equal signs = are used for assignments. The OR is correct there, I usually use ||, it does the same thing. Additionally the syntax of your 2nd while loop is wrong. And you need to define the variable 'c' first, before you use it. (same goes for the other while loop) c = round ((random 4) + 0.5); while {c==a OR c==b} do { c = random 4; c = c + 0.5; c = round c; };
  4. Just a quick thought: Additional to the Turret and Gun Animations with the sources 'mainTurret' and 'mainGun' defined in the cfgModels class, you could add the same animations again (different class names ofc.), but this time both with the source 'user'. That enables you to rotate/elevate the cannon by scripts (command 'animate'). Then simply add some useractions to the cannon (or some other fancy interface) with which the player can script-rotate the cannon by a certain number of degrees, to speed up the rotation process. And for the rotation speed values in the config leave the low ones.
  5. You can do this a lot easier and with only one script, instead of one for each draw. In the mission init script, define an array containing your five squads, like: squadarray = [1,2,3,4,5]; Instead of the numbers you can also store the groups directly, then you don't have to translate from the number to the group later. (l1 be the leader of squad1, l2 be the leader of squad2, and so on...) squadarray = [group l1, group l2, group l3, group l4, group l5]; then thats the whole sqf script: EDITED: fixed a typo, updated entry selection executed with: [squadarray] execVm "scriptname.sqf"; The clue here is to memorize the set of entries that are valid to pick, and after you picked something you remove the picked one from the set. That avoids writing extra scripts for each time. The local variable _rnd is the selected entry from the set, it corresponds to the variable 'x' in your scripts ADDED: Multiplayer notes: Make sure that you run this script only on the server as otherwise every connected machine would generate a different random number.
  6. poweruser

    Adding HUD Radar

    You might take a look at these settings: http://community.bistudio.com/wiki/CfgVehicles_Config_Reference#...CanSee
  7. poweruser

    smokeshells and MP

    execVM/call this on the init-event of the vehicle: if(isnil "UniqueGlobalVariable") then { [indent]UniqueGlobalVariable = true; VariableForBroadcast = []; "VariableForBroadcast" addPublicVariableEventHandler { [indent]if (time - ((_this select 1) select 3) < 10) then { [indent](_this select 1) execVM "pop_smoke.sqf"; // adjust script-path here[/indent] };[/indent] };[/indent] }; lets say this is the code that is executed when the gunner hits the action [TANKOBJECT,MAINGUN,RELOADTIME] execVM "pop_smoke.sqf"; extend it to: [TANKOBJECT,MAINGUN,RELOADTIME] execVM "pop_smoke.sqf"; VariableForBroadcast = [TANKOBJECT,MAINGUN,RELOADTIME,time]; publicVariable "VariableForBroadcast"; and in the script pop_smoke.sqf use 'createVehicleLocal' instead of 'createvehicle'. ====================================== Note: the check with the time (when the variable is published and when its received is required, to avoid smokeshells being fired off, on the last vehicle that has done it, for jip-players right after they join. Thats because of the vehicles in the mission being init-ed before the published variables are being syncronised for jip-players ====================================== Another mp issue that is being resolved that way (which you are probably not aware of right now) is the reload status. 'setVariable' has local effect only, meaning that the vehicle is marked as reloading the smokeshells only for the player that has shot them (in your script). That can be exploited.
  8. poweruser

    Event handlers

    Take a minute and think about your shar.sqs script again. The first line doesnt really make sense, and the second creates your rear-vehicle at the position [0,0,0]. The init-event is executed on all connected machines in a multiplayer game, that means that multiple rear-vehicles will be created per front?-vehicles in a mp game. It should be more like this, shouldn't it? private["_pos","_vehicle"]; if(isServer) then { [indent]_pos = getPos (_this select 0); _vehicle = "Rear" createVehicle _pos;[/indent] }; exit;
  9. It's a urban legend that the line if (!isServer) exitWith {}; does the same as (in sqs scripts) ?(!isServer): exit They are NOT and do NOT the same! http://community.bistudio.com/wiki/exitwith Do it this way instead: if (isServer) then { // code to be executed on the server only };
  10. poweruser

    addEventhandler - Problem

    Additional to making the counter variable a global one, you need to initialise it before it starts to count. in the init script and maybe in radio trigger to reset the counter. counter = 0; _rtarget addEventHandler ["hit", { counter = counter + 1"; range_man sideChat format["Target hit, hits so far: %1", counter];}];
  11. poweruser

    Adding footstep sounds

    It is. You have to have to overwrite the class 'SoundEnvironExt' (which is defined in the base class 'CAManBase') within your new units class. class CfgVehicles { [indent]class someBaseClass; class yourunit: someBaseClass { [indent]class SoundEnvironExt { [indent]// define the new movement sounds here[/indent] };[/indent] }; [/indent] };
  12. The init script is run on all connected machines once at mission start (server, clients and jip-clients). That means that on a dedicated server with #X clients the script is executed 1+#X times and as the command 'createVehicle' has global effect, the 'LAND_A_*' objects objects are created 1+#X as well. To make sure that some code is only run once on mission start, put this if-clause around it: if(isServer) then { // code to be run only on the server };
  13. poweruser

    Friendly Fire O My!

    Are you sure about that? Afaik the cost and threat values in the unit's config are responsible for the AI's decision.
  14. poweruser

    Autoflares Script Help.

    In sqf: private["_x","_y","_xpos","_ypos","_xspread","_yspread","_flares","_flare1"]; if(isServer) then { sleep 4; _xpos = (getpos middle) select 0; _ypos = (getpos middle) select 1; _xspread = 250; _yspread = 500; _flares = ["F_40mm_White","F_40mm_Red","F_40mm_Green","F_40mm_Yellow"]; while { autoflares } do { _x = _xpos + ((random _xspread) - _xspread / 2); _y = _ypos + ((random _yspread) - _yspread / 2); _flare1 = (_flares select (random 3)) createvehicle [_x,_y,120]; sleep (10 + random 10); }; }; true It doesn't require a game logic with the name 'server' anymore, but it still requires an object with the name 'middle'. I've set the variable 'autoflares' as condition of the loop, so you're able to shut it off in the mission by setting it to 'false'.
  15. The onMapSingleClick command defines a statement which is executed every time you left-click on the map, you cannot use local variables of your script in it (like: _sla_force), as it simply cannot access it. Use a global variable for the group you create instead, e.g. sla_force
  16. poweruser

    Addon as background application

    Here's the compensation for the latency of variable distribution you fear: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if(isNil "MYADDON") then {     MYADDON = (_this select 0);     sleep 3;     if(MYADDON == (_this select 0)) then {     // Your code goes here     }; }; Any additional instances that pass the isNil check will either overwrite the already set variable or their value will be overwritten by some other instance. There can only be one instance executing the distribution as the last one. Then all instances will wait to make sure that all other instances have done that as well. After the timeout, the instance that executed it as last will continue, all others will exit.
  17. poweruser

    Addon as background application

    Then I have to warn you that the Extended_Eventhandler addon is using the exact same technique for Pre- and PostInit!
  18. poweruser

    Addon as background application

    You can avoid having multiple instances of your script, by adding this to your init script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> if(isNil "MYADDON_initialised") then { Â Â Â Â MYADDON_initialised = true; Â Â Â Â // Your code goes here }; Or use xehs PreInit or PostInit EHs (but: PreInit only available in XEH v1.9 and later; PostInit only available in XEH v1.91 and later) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Extended_PreInit_EventHandlers { Â Â MYADDON_init = " _this execVM ""\MYADDON\init.sqf""; "; }; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Extended_PostInit_EventHandlers { Â Â MYADDON_init = " _this execVM ""\MYADDON\init.sqf""; "; }; The init event is global.
  19. poweruser

    GUER side check

    Side: resistance
  20. poweruser

    Read content ammobox

    http://pastebin.com/m48efd060
  21. poweruser

    Scoring script

    I don't think that you can access this detailed info directly, only the sum of all scores with the command 'score'. But you can record this info during the mission: Add a killed-Eventhandler to all units (or extend an already existing one). This EH returns the destroyed object and the one who destroyed it. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler["killed", {_this execVM "score.sqf";}]; score.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private["_obj", "_killer", "_type"]; _obj = _this select 0; _killer = _this select 1; if(_obj iskindof "Man") then {     // _killer killed a soldier } else {     _type = getNumber (configFile >> "CfgVehicles" >> (typeOf _obj) >> "type");     if(_type == 0) then {         //_killer killed a soft vehicle     };     if(_type == 1) then {         // _killer killed a tank     };     if(_type == 2) then {         // _killer killed a aircraft     }; }; Then you have to think of some datastructure where you store and maintain these infos for each player.
  22. poweruser

    Read content ammobox

    I've been trying to find a workaround for this. So far I can read the available weapons/magazines of the gear menu, whenever the client accesses it. Just have to find a way now to find out at what object (corpse, ammo box, vehicle, nothing) the player looked at, at that time, to assign the content to the right object.
  23. poweruser

    Enhanced Configuration System

    Update: Â New version of the bridge addon Themis v1.0.1.02 Our bridge addon Themis v1.0 or v1.0.1.01 does not work well together with the latest versions of the Extended Eventhandlers addon (released along with ACE v1.01 and ACE v1.02), if at all. There have been player reports that ECS will work with ACE v1.01 by using the old Themis (v1.0), but this is not true. With this configuration almost none of the game events will reach ECS (only from vehicles of the type "LandVehicle" (Cars and Tanks)). To prove these players wrong: In the mission editor, put only yourself as soldier on the map and preview. ECS won't initialise then. That's why we release a new version of Themis v1.0.1.02 which is compatible with all public versions of the Extended Eventhandlers addon (tested down to v1.4) and should stay compatible with future versions of it. The old versions 1.0 and 1.0.1.01 are obsolete from now on and shall be replaced with v1.0.1.02 Download as usual on our site: ECS Website - Downloads
  24. Post what you did with that "other line". Something like this? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _allowedItems = ["ACE_Bandage"]; Â _allowedItems = ["ACE_Morphine"]; It should be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_allowedItems = ["ACE_Bandage","ACE_Morphine"];
×