Jump to content

wok

Member
  • Content Count

    183
  • Joined

  • Last visited

  • Medals

Everything posted by wok

  1. Check dslyecxi's paper doll gear menu, I haven't tried it but in the video it seems it does what you need.
  2. wok

    General Discussion on the new tools.

    http://dev.arma3.com/sitrep-00033 More updates about the tools.
  3. ambientAnim looks like its only able to play some of the available animations, you can also use something like unit playMoveNow "AmovPercMstpSsurWnonDnon"; To test how to animate an unit, you could do this: place a playable unit on the editor, and then an enemy unit close to it (take out the ammo so he wont shoot you), then add this code to your mission init.sqf or just run it in the debug console: player addAction[ "test", { cursorTarget playMoveNow "AmovPercMstpSsurWnonDnon" }]; This will add an action menu entry, so just run the mission, aim at the enemy, and run the "test" menu entry. The unit you are aiming at (cursorTarget) will play the animation.
  4. You can add it on the second parameter of setTriggerStatements, something like: _trig setTriggerStatements ["({(side _x) == east} count allUnits) <= 2", "{if(side _x == east) then { _x playMoveNow 'AmovPercMstpSsurWnonDnon'; _x disableAI 'ANIM'; _x setCaptive true;}} foreach allUnits; win = true;", ""];
  5. I am not an expert (I got the trigger code from this forums and just added your code to it), but I think the trigger doesn't cover the whole map, it doesn't cover anything because it has no size, and its placed on the position [0, 0, 0] which I guess is a map corner. And since the activation is when "NONE" is "present" then it will always activate, but will only run the code when the conditions are met. I only worked on scripts as text, outside the editor. But I can say all you need to get it working is putting the code on your init.sqf file (or anywhere you want as long as it gets executed), so I guess you don't need any other trigger related to this.
  6. I think dr_strangepete is right, the person who clicked the button is the one running the dialog so you should be able to just use player.
  7. Yea a trigger should work, I tested the following code and it seemed to work fine, I placed 3 enemy units and after killing one the other two surrender: _trig = createTrigger ["EmptyDetector", [0,0,0]]; _trig setTriggerArea [0, 0, 0, false]; _trig setTriggerActivation ["NONE", "present", true]; _trig setTriggerStatements ["({(side _x) == east} count allUnits) <= 2", "{if(side _x == east) then { _x playMoveNow 'AmovPercMstpSsurWnonDnon'; _x disableAI 'ANIM'; _x setCaptive true;}} foreach allUnits;", ""];
  8. In the end Arma is still a video game, I don't think adding realism on everything imaginable would necessarily make a better game.
  9. Maybe you could use the Dynamic Spawn module. I never used modules but I was watching this video and it looks like it could be useful for you.
  10. Listboxes have a canDrag property, and then I think you use the events onLBDrag, onLBDragging and onLBDrop. But I really never used it so I can't say much. I hope you can get it working it would be a great addition, I love VAS, I sometimes even leave a server because the mission doesn't use VAS or it not working.
  11. wok

    ai veiw distance

    You could try playing around with setSkill, one of the values is called spotDistance. The value is from 0 to 1, so you will have to test 0.XX until you find something that works around 500mts.
  12. I am using the showWindow parameter on an addAction entry that uses an image, so the icon appears on the middle of the screen when I get close to the object. I was thinking if it would be possible to hide the entry from the left menu and show only the icon on mid screen. Is this possible or is there any workaround to achieve it?
  13. I think something like this should work (untested code): { if ( side _x == east ) then { _x playerMoveNow "AmovPercMstpSsurWnonDnon"; _x setCaptive true; _x disableAI "ANIM"; }; } forEach allUnits;
  14. It looks like you know some arma scripting so I'd say check TPW Civs anyway, see what I found in the readme: I think that's what you are looking for, they includ a scripts version so you don't need to use it as mod.
  15. I am doing some scripts and part of it involves an AI enemy being captured and then asked to follow the player. My simplified code looks something like this: target = cursorTarget; caller = _this select 1; target setBehaviour "CARELESS"; fnc_substr = { _str1 = toArray(_this select 0); _start = _this select 1; _length = (_this select 2) - 1; _substr = []; for "_i" from 0 to _length do { _substr set [_i, _str1 select (_start + _i)]; }; toString _substr }; while{ alive target && alive caller } do { target doMove position caller; _distance = caller distance target; if( _distance > 5 ) then { target setSpeedMode "FULL"; } else { if( [animationState caller, 9, 3] call fnc_substr == "wlk" ) then { target setSpeedMode "LIMITED"; }; if( [animationState caller, 9, 3] call fnc_substr == "run" ) then { target setSpeedMode "NORMAL"; }; if( [animationState caller, 9, 3] call fnc_substr == "eva" ) then { target setSpeedMode "FULL"; }; }; sleep 2; }; I call it with a simple addAction while aiming at an enemy unit. The important part is target doMove position caller;, the rest is just so the enemy will copy the speed of the player (walk, run, etc). The code works but the result is not very pretty, the enemy does follow the player but it looks like one of the zombies from dayz. They always have to move to your last known position instead of taking the shorter path, and they do weird stuff like stopping and continuing specially while walking. Does someone have a better code for doing this or have some ideas for improving mine?
  16. I am still working on my capture AI scripts, I am using unit playMoveNow "AmovPercMstpSsurWnonDnon"; To simulate a "hands up" command, it works pretty nicely, but that's the only surrender related animation I found. Now I am trying to do a "handcuff" command. I found InBaseMoves_HandsBehindBack1 which looks good but only works with switchMove and not playMove, so it's not animated, the unit just go from whatever position hes in to hands behind the back instantly. Does anyone knows how to do this handcuff thing but animated? A second question, I know A2 has some good surrender animations in the mod SLX_wounds, but I coulnd't find anything like this for A3. What I really wanted is to make the unit walk with the hands behind his back since I will also have a "follow me" command, so I either only allows the "follow me" command when uncuffed or I allow it and the unit hands will magicaly get free while moving. Does anyone knows about some animation that could help in moving an unit while "handcuffed"? (or any other related surrender stuff)
  17. Yea, I wanted to avoid that.
  18. I need to pass cursorTarget as an argument of addAction and then read it on the sqf file the action runs. My test code is: init.sqf player addAction ["test", "test.sqf", cursorTarget]; test.sqf (I've read on bis wiki that the argument would be passed on the _this array with the index 3) _test = format ["%1", _this select 3]; hint _test; My problem is that the hint always shows "<NULL-object>", no matter what I am aiming at. If I replace _this select 3 with cursorTarget, and then run the action while aiming at another soldier the hint show something like "B Alpha 1-1:2". And also if I pass a string instead of cursorTarget on init.sqf, then the hint shows the string correctly using _this select 3. So, why I can't read cursorTarget using _this select 3? I am just worried that the cursorTarget may change after running the action and mess up stuff, that's why I want to pass it as an argument.
  19. My end goal for this is to add an addAction menu entry when aiming at an enemy from close range, so I will be able to give him a command like "freeze" or "hands up" to an enemy AI. I managed to do the aiming part like this: init.sqf _trigger = createTrigger ["EmptyDetector", [0,0,0]]; _trigger setTriggerArea [0, 0, 0, false]; _trigger setTriggerActivation ["NONE", "present", true]; _trigger setTriggerStatements ["side cursorTarget == east", "execVM 'test.sqf'" , ""]; test.sqf player addAction ["Hands up!", {hint "test";}]; This works fine (if you are a NATO aiming at a CSAT), but the problem is that since I am not removing the action I get duplicated entries every time I aim at the enemy. I know I can use removeAction to remove it, but how do I run removeAction on this action when the player aims away from the enemy? UPDATE: I feel dumb, I can just use the addAction condition parameter instead of the trigger, I will still use the trigger method to add some complexity like detecting if the player is aiming his gun at the enemy after telling him to put the hunds up, but im not yet there.
  20. Thanks for the code, I also think I found a way to do it with triggers, will test that and your code tomorrow, time to sleep now. Btw I did know about the hint spam, I just tried to keep the code minimal to better explain what I needed. Thanks again.
  21. I recently fixed my old computer so I can play while I work on my main pc. It's an old dualcore with a gts250 and 3gb ram. Arma 3 runs quite fine, doesn't look as pretty as in my main pc but it's totally playable. The only problem is that when opening the inventory or map or pressing esc, the game freezes for like 30 seconds. I was wondering if there's something I could do to prevent this, like some of those launch params or something, or the computer is just too old for A3?
  22. I am thinking about doing a progress bar, the easiest way I though was using a slider and sliderSetPosition, but I don't know how to remove or hide the slider arrows. Is that even possible? I tried making the slider bigger than the background control box I have, but the overflow is not hidden as I though it would be.
  23. Sorry guys that I couldn't reply earlier, I had some personal issues that took me away from gaming for some time. You can find a working sample of the progress bar here: http://www.ahoyworld.co.uk/topic/1154-suggestion-refuelrepair-in-dialogbox/?hl=progressbar#entry5607 Check the sendspace link, it's a sample mission that contains all the code. Edit: The download link is not working atm, I will need some time to find the files and upload them again. Edit2: Here's the download link: http://www.sendspace.com/file/rme5dn, the files you want to check are ./misc/progressBar.hpp and ./misc/progressBar.sqf, then in the file rearmVehicle.sqf is where that code is used. Also in the file description.ext you have include the .hpp file with #include "misc\progressBar.hpp". This is how the progress bar is implemented in the rearmVehicle.sqf file: /* open progress bar & set initial text */ [] call progressBar_open; [format ["Repairing and refuelling %1. Stand by...", _vehType]] call progressBar_setText; /*--------------------------------------*/ /* set initial % */ [format ["Repairing (%1", floor (100 - (_damage * 100))] + "%)..."] call progressBar_setText; [100 - (_damage * 100)] call progressBar_progress; /*---------------*/ /* this goes inside a loop to update the percentage and text of the bar */ /* update % in text & bar */ [format ["Repairing (%1", floor _percentage] + "%)..."] call progressBar_setText; /*----------------------------------------------------------------------*/ /* close progress bar */ [] call progressBar_close; /*--------------------*/
  24. I've been thinking about an invisible barrier to protect a spawn area from ground vehicles, and I thought about using setVelocity. This is a simple test mission I made to show the idea http://www.sendspace.com/file/xfgc3p I used setVelocity [0,20,0] on a trigger so when the vehicle hits it it bounce back, lower values than 20 seem to let the vehicle pass. The main issue is that that works only when driving from one side of the trigger, if you drive from the other side it doesn't work well. I never really understood speed vectors and much less using sin and cos to calculate their value, does someone has an idea on how I could make this invisible barrier worh the same on all sides of the rectangle trigger or even in a circle trigger? I guess I would have to use something like http://community.bistudio.com/wiki/direction but im not sure how to apply it.
×