Jump to content

mikie boy

Member
  • Content Count

    664
  • Joined

  • Last visited

  • Medals

Everything posted by mikie boy

  1. mikie boy

    addaction and JIP

    try something like - (not tested) [[[_TAG_pilot],"fnc_unitinit"],"BIS-Fnc_spawn",true,true] spawn BIS_fnc_MP; i think its a matter of the function (name) not being sent to the client when he joins. Not that the client doesnt know about the fnc_unitinit (as this is loaded up in your init.sqf).
  2. mikie boy

    Array - operation

    no more than 6? do you mean in the array or the distance? and i didnt know about that sortBy, i actually spent time last night (literally) making a code to define an array of closest distance to a player lol. - so cheers for that.
  3. Not sure what the problem is but.... "FOCK_GHint" addPublicVariableEventHandler { private ["_GHint"]; _GHint = _this select 1; hint format["%1", _GHint]; }; and // FOCK_GHint = "Hello everyone on the server except me!"; publicVariable "FOCK_GHint"; works fine - the only person who this doesn't see the message is the player/machine that executed the broadcast command. maybe you need to explain more about what your trying to do or what code you are using.
  4. make sure each client knows what the variable is prior to being transmitted across the network - (publicVariable); for example - in the init.sqf - you could have if (isnil objtFOXTROT) then {objtFOXTROT = 0}; that way when each client loads in they will have access to the variable objtFOXTROT. Very crude explanation i know...sorry
  5. mikie boy

    Helipad Light Script

    this is something so simple but absolutelly brilliant - great foresight - nice work
  6. make a script that has a weapon rank/limit system and place that upon the player. when that player uses said weapon you can simply chuck it to the ground or delete. loads of these scripts laying around... forexample an old rank system i made... _corpweaps = ["M16A2GL", "G36C_camo", "G36A_camo"]; _corprank = ["CORPORAL"];//can change this for a type of player _wepchoice = weapons player; { if (_x in _wepchoice) then { if !(rank player in _corprank + _sergrank + _lieurank + _caprank + _majrank + _colrank) then { sleep 0.01; hint format ["you need to be at least a corporal!!!"]; player removeweapon _x; }; }; } foreach _corpweaps;
  7. mikie boy

    Helicopter fastrope script

    yeah same for me - great script by the way. it looked like my player was actually in the initial stages of being attached to the rope but then he just fell.
  8. use this for height difference - setPosATL as for not spawning stick a 0.5 sleep in to check - or randomise their position when spawing - for [{_i=0}, {_i < 7}, {_i = _i + 1}] do { // 7 determines amount to spawn _unit = "B_recon_TL_F" createUnit [getMarkerPos "spawn", group player]; _unit setPosATL [(getPosATL _unit select 0) + _i, getPosATL _unit select 1, (getPosATL _unit select 2) + 18]; sleep 0.5; };
  9. always set the first mag to fill the gun with teh below, then add the rest _caller setAmmo [primaryweapon player, 100]; - set amount to a 100 and that will cover all ammo capacity - delete the spare mag somehow or let it drop off. sorry this is from the top of my head - remember issues with it in the database system i wrote - cant recall how else i fixed it at mo - will get back to you if ive got a better solution
  10. mikie boy

    Code Optimization

    if (!isServer) exitWith {}; this does not always do what you think its supposed to do - it was designed to exit from the current scope not the script. It can however, not intended from what i remember, exit from the script - but when this happens or when it does not im not sure. you could therefore expect that it is running this script for the client when they connect. Have you had a look to see how many units are created - make a quick script to count units and also groups. this will give you an idea as to what is happening. As iceman has indicated, the repetition of your code needs to be reduced. You should make a function (as shown by iceman) that takes the position coordinates as parameters. This will save on the repetition. if for whatever reason you have to create units individually,then stick the create unit within a for loop :) As for the code not running first time round -you must declare the global variable before hand and ensure that it is changed before this particular script is run.
  11. mikie boy

    UI Slider

    basically - you execute the dialog, then dialog is shown. then you need a script or eventhandler from a button push etc to execute the above code to find the slider. that's where the code above comes in... if that makes sense
  12. {unassignVehicle _x} forEach crew _vehicle; should work
  13. mikie boy

    Help With This Script Please

    get rid of the if isserver start and end
  14. in the civvy's init. (may need a handle before.. - civvy = [this] addeventhandler....) this addEventHandler ["killed", "hint format['Killed by %1',_this select 1]"]; whack this in first as a tester. shoot a civillian and hopefully the hint will appear saying that you killed him. then replace with the below code... this addEventHandler ["killed", {[_this select 0, _this select 1] spawn identifyKiller}]; //make a function in a file that is preloaded prior to the game starting... identifyKiller = { _unitKilled = _this select 0; _killer = _this select 1; if (side _unitKilled == independent && side _killer == West) { hint "you killed a civillian numpty!"; _killer setdamage 1; //if you want to kill the player //if you want to have alimit to the amount of civies you can kill then - something like this... //(globalVariable) - need to add in init - //if (isnil "civillianKillCount") then {civilliankillcount = 0}; civillianKillCount = civillianKillCount + 1; if (civillianKillcount == 4) then { _killer setdamage 1; //if you want to kill the player} else {hint " carefull you are close to being punishedfor civivy killin"}; }; }; not tested of course but it should be there or thereabouts
  15. how are you adding the civillians? if you are placing them yourself a simple eventhandler killed on each of them will do the trick. scripting wise, you could try adding the eventhander using foreach command and units civillians - methods...
  16. mikie boy

    Need help!

    Top of my head - not in any shape has this been tested, but its a concept... _SpawnWave = { for [{_x=0},{_x<=1},{_x=_x+1}] do { _group = [getMarkerPos format ["spawn%1", _x] EAST, (configFile >> "CfgGroups" >> "EAST" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam")] call BIS_fnc_spawnGroup; //set skill array works magic { _x setSkill ["general",1]; _x setSkill ["aimingAccuracy",0.1]; _x setSkill ["aimingShake",1]; _x setSkill ["aimingSpeed",0.1]; _x setSkill ["endurance",0.3]; //no longer works? _x setSkill ["spotDistance",0.2]; _x setSkill ["spotTime",0.7]; _x setSkill ["courage",1]; _x setSkill ["reloadspeed",0.5]; _x setSkill ["commanding",1]; _x doMove getpos movetoPosition; //make the unit move to the position } forEach units _group; [] call _SpawnWave; }; }; _SpawnWave = { //your code plus this waituntil {{alive _x} count units _group == 0}; };
  17. mikie boy

    Need help!

    place the group creation in a for loop - remove one of the groups completely - in that loop add a spawn to the spawnwave function you can format the spawn marker using format - that way it iterates through the markers on each creation
  18. mikie boy

    Live feed control (LFC)

    nice work - very useful concept indeed
  19. Fair play great enthusiasm, and don't loose that. Just take what harzach has said on board. Start small with a few guys and see if u can build on that.
  20. havent done modelling in a while and seeing this i may get back into it - nice one - keep it up. Alot of people out there will appreciate it.
  21. mikie boy

    How Did You Learn To Script?

    Anyone reading this thread should take away two things. Try it yourself! And lots of practice. Those two things are enough to get you well into scripting. The community in this site will fill in any missing gaps. Some of the most helpful people on the internet. Finally. Whatever skill and knowledge you gain, pass it on and keep this game moving forward.
  22. Lol, I was just talking about the follow player bit. Taken from that suicide bomber one I made in A2. It needs line intersect command of similar to work better.
  23. Glad u made use of the follow script :)
  24. An old script - not tested of late - but it did work when i used it for suicide bombers - added your attack bit May help you along the way - new commands have appeared since this. lineIntersectsWith? ////////////////////// //Zombie basic // [FOCK] MIKIE J ////////////////////// //place this in the init of each zombie //zombie = [this] execVM "ZombieCtrl.sqf"; quitscript=0; zombiekilled = { if (!alive _this) exitWith {hint "Zombie killed";}; }; followdude = { _killer = _this select 0; _tokill = _this select 1; while {(position _tokill distance _killer > 10) and (quitscript == 0)} do { hintSilent "following"; _killer doMove (getPos _tokill); //modify the distance to make it easier or hard to run away if (position _tokill distance _killer > 100) exitWith {hint "quitting"; sleep 2; _killer doMove (getPos _killer); quitscript = 1;}; sleep 5; }; }; _zombie = _this select 0; _zombie addEventHandler["killed",{ (_this select 0) spawn zombiekilled;}]; //this runs whilst zombie is alive while {alive _zombie} do { _searchtarget = nearestObjects [_zombie,["CAManBase"],100]; { if (side _x == WEST && isPlayer _x) then { hint "targeted identified"; // use hints to find out where your scripts get to before breaking - this is just an example sleep 1; _kv = _zombie knowsAbout _x; //does the AI actually see the target if (_kv ==4) then //higer level = less likely to see { hint "targeted is gona die!"; _zombie doMove (getPos _x); _zombie setSpeedMode "LIMITED"; [_zombie, _x]call followdude; waitUntil {(position _x distance _zombie <= 10) or (quitscript == 1);}; if (quitscript == 0) then { _zombie setSpeedMode "FULL"; sleep 1; if(_zombie distance player < 2 && {alive _zombie}) then { _zombie say "zombie_attack_2"; _X setDammage +0.2; _x say "ouch"; }; } else { hint "aborting"; quitscript = 0; _x = nil; }; } else { hint "target not detected"; }; }; sleep 10; } forEach _searchtarget; };
  25. T be honest i havent looked at this for ages and was planning a revamp of it - when i get a chance i will sort through it and address the loss of the hex around players etc.
×