Jump to content

twirly

Member
  • Content Count

    1304
  • Joined

  • Last visited

  • Medals

Everything posted by twirly

  1. Same here... programming a long time. Found this about 12 years ago and been fiddling with it ever since. Trust me mate... you've found many challenges and much, much more! Enjoy! Twirly.
  2. Cool man... you might have just gone down the rabbit hole. Hooked for life!
  3. Hi man... Create your description.ext if you don't have one and stick this in it.... class Params { class CivCount { //param 0 title = "Civilian Count"; values[] = {0, 10, 20, 50, 100}; texts[] = {"No Civilians", "10 Civies", "20 Civies", "50 Civies", "100 Civies"}; default = 10; }; [color="#FF8C00"] class Daytime { //param 1 title = "Day or Night"; values[] = {0, 1}; texts[] = {"Daylight", "Night"}; default = 0; }; [/color] }; Then in your main code or wherever... _numcivs = (paramsArray select 0); The second parameter Daytime is just included to show how to do another one.
  4. Hi... If I understand you right here's a command you can try. http://community.bistudio.com/wiki/typeOf Example:- if (typeOf _unit == [color="#FF8C00"]"USMC_SoldierS_Sniper"[/color]) then { //blah...blah...blah }; You need the classname for this. There's probably better places to find classnames but check here as a start... http://www.ofpec.com/COMREF/index.php?action=read&id=209#Man
  5. Not sure but try changing your completion radius to something bigger. http://community.bistudio.com/wiki/setWaypointCompletionRadius
  6. Have a look in these and see how it might be done... hope they help. http://forums.bistudio.com/showthread.php?111766 http://forums.bistudio.com/showthread.php?133312
  7. Seems you're mixing up the two commands... where you call the script is really for markers! You can have the unit spawn at a marker randomly. H1 = groupHostage createUnit ["GUE_Soldier_MG", _markerPos, [[color="#FF0000"]"markerA1","markerA2","markerA3"[/color]], 0, "FORM"]; You could do this... H1 = groupHostage createUnit ["GUE_Soldier_MG", _markerPos, [], 0, "FORM"]; nul = [H1] execVM "scriptName.sqf"; ...and scriptname.sqf would start like this to select the passed unit... _unit = _this select 0; //code block...do whatever you want with the unit here ---------- Post added at 01:19 PM ---------- Previous post was at 01:15 PM ---------- Do you know about what Galzohar mentioned?... I did mention diag_log and the report file in a previous post. It's good advice to make -showscripterrors, hint, diag_log and the report file your good friends.
  8. I changed your createunit to createunit_array....and works fine now. Tested. For some reason it didn't like the other createunit. I think I've had that problem before and now always use createunit_array. Code in spoiler....
  9. ....for removeAllweapons... removeAllWeapons H1; ....and try creating the centers before you create the groups!
  10. Try it and see what the results you get. If all this stuff is spawning at the beginning of your mission there shouldn't be any problems.
  11. twirly

    Random Spawning

    @Iceman... thanks bud! If he had done any reading at all in these forums he would know that all I do is try to help people! Anyway... water under the bridge.
  12. It'll be something silly... I'll bet! Anyway good luck mate.
  13. To be honest... I don't see anything wrong if the marker names are correct. Give it up for a little while and then come back to it... that usually works for me. Sometimes you can dig yourself into a hole :)
  14. twirly

    Random Spawning

    Good... I'm glad you got some joy. Take it easy.
  15. twirly

    Random Spawning

    http://forums.bistudio.com/showthread.php?133509 http://forums.bistudio.com/showthread.php?94646 http://forums.bistudio.com/showthread.php?141871 http://forums.bistudio.com/showthread.php?139699 http://forums.bistudio.com/showthread.php?138515 These are just some of the posts I might might read if it was me..... just sayin' ---------- Post added at 02:06 PM ---------- Previous post was at 02:05 PM ---------- Man you sure read all that shit real fast!! ---------- Post added at 02:09 PM ---------- Previous post was at 02:06 PM ---------- More.... if you think it's useless information then you just don't have the patience for this...... I suggest you give up now!
  16. twirly

    Random Spawning

    I just typed "random spawning" into the search box and got pages of info..... don't be friggin' lazy!!!!
  17. twirly

    Random Spawning

    Mate... there's now three posts on this page about random spawning.... if they don't help you then I can't... because I'm just going to type the same stuff in those posts stuff all over again. And how could "asking" possibly mean "doing"???
  18. This is worth it's electron weight in Gold! Mr. Murrays Editing Guide.
  19. You already have the variable... "_crate" to work with. So it would be something like this.... private ["_crate"]; // Get the crate _crate = _this Select 0; // Remove the stock items from the crate ClearMagazineCargo _crate; ClearWeaponCargo _crate; if ([url="http://community.bistudio.com/wiki/typeOf"]typeOf[/url] _crate == "TKBasicWeapons_EP1") then { // Add items _crate AddWeaponCargo ["AK_47_M", 5]; _crate AddWeaponCargo ["AK_47_S", 5]; //_crate AddWeaponCargo ["AK_GOLD", 5]; //code continues here.... }; if ([url="http://community.bistudio.com/wiki/typeOf"]typeOf[/url] _crate == "RUSpecialWeaponsBox") then { // Add items _crate AddWeaponCargo ["AK_47_M", 5]; _crate AddWeaponCargo ["AK_47_S", 5]; //_crate AddWeaponCargo ["AK_GOLD", 5]; //code continues here.... }; You can also use switch to do this instead of if.
  20. Hi... check here for the proper use of removeallweapons... http://community.bistudio.com/wiki/removeAllWeapons
  21. twirly

    Random Spawning

    Hi... where do you actually spawn the civilians? There's no code there for spawning anything. Please search the forums... there are lots of posts on spawning. There's one right now on this same page! Answering the same questions over and over is getting old. It's really easy.... you want scripts... learn to script by reading other scripts and spending many, many hours testing. We've all been through this. The people that are still here after many years anyway.
  22. Are those marker names missiong an "A"? This code below outputs the correct numbers.... no problems there. for "_i" from 1 to 20 do { n1 = round ((random 6) + 0.5); // generates random number from 1 to 6 [color="#FF0000"]diag_log[/color] format ["n1: %1",n1]; sleep 0.01; }; AS well as random... you also have floor and ceil to work with. Yes... you can also use diag_log as I did above to output to the report file.
  23. If that other script isn't working... make sure you have at least one INDEPENDANT placed on the map or they won't spawn.
  24. You'll have to run something like this on the server (dedicated) only. This is basically a purpose built trigger which executes about every one second. It needs an object and a radius. I hardly ever mess with editor placed stuff.... so you're stuck with this :) myscript.sqf:- if (not isDedicated) exitwith {}; _obj = _this select 0; _rad = _this select 1; _UIDarray = ["123456","654321","456789"]; _list = []; while {true} do { _list = (position _obj) nearEntities [["Man"],_rad]; for "_i" from 0 to (count _list)-1 do { _dude = _list select _i; _rating = rating _dude; _UIDdude = getplayerUID _dude; if (not (_UIDdude in _UIDarray) and (_rating > -10000)) then { _dude addrating -10000; }; sleep 0.01; }; sleep 1; }; Execute it with an object and a radius as parameters. nul = [someobject,radius] execVM "myscript.sqf"; I haven't tested this but it should work. See how you get on. Hope you enjoy your time with Arma!
  25. Here it is... a little shorter. Tested and working. if (! isServer) exitwith {}; // NOTE: in multiplayer, only server should create random numbers. // Create Group for units to be spawned into; must have group created BEFORE spawning units in. groupAlpha = createGroup RESISTANCE; //random markerpos _markerPos = getMarkerPos format ["markerA%1",ceil (random 6)]; //array of soldier typs _typs = ["GUE_Soldier_CO","GUE_Soldier_MG","GUE_Soldier_GL","GUE_Soldier_AT"]; //create the units...set their direction {_unit = groupAlpha createUnit [_x, _markerPos, [], 0, "NONE"];_unit setdir 180} foreach _typs; You don't end up with unit names.... but you may not need the units to have individual names if they are just cannon fodder?!
×