Jump to content

Khalashnikovf

Member
  • Content Count

    114
  • Joined

  • Last visited

  • Medals

Posts posted by Khalashnikovf


  1. So far so good.

    Im working on this

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Script for using randomness to select which civilian is dangerous to a player and will try to hurt him somehow
    // Script by: Khalashnikovf
    // Thx for help to neokika for base script of revealing all certain units
    // -----------------------------------------------------------------------------
    // Example:	nul = [unit,distance] execVM "CivilianDanger.sqf";
    //
    // unit = name of unit
    // distance = distance of danger area, recommended is 20
    // -----------------------------------------------------------------------------
    // Use: 	Place unit on map, place enemy unit with zero probality of existence and name it Eneminator
    //
    // Idea: 	Script will choose unit and says, if it is possible weapon holder, or stone thrower, or if he is just annoyer
    //			There is 10% chance that possible weapon holder has got a gun, 40% for stone throwerer, and 80% for annoyer
    //			Civilians with gun will just for sure shout Allah Agbar
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    private ["_unit","_distance","_mag","_wep"];
    
    _unit = _this select 0;
    _distance = _this select 1;
    _mag = "";
    _wep = "";
    
    _targetsArray = nearestObjects [_unit, ["Man"], _distance]; 
    { 
      if ((side _x == CIVILIAN)and( alive _x)) then 
      { 
    _unitType = ceil (random 3);
    _unitProb = floor (random 101);
    switch (_unitType) do { 
    	case 1: { _unit sidechat "Armed Possible";
    		if(_unitProb < 10) then {  _unit sidechat "Armed Is";
    		_weaponType = ceil (random 6);
    		switch (_weaponType) do
    			{ 
    			case 1: { _mag = "17Rnd_9x19_glock17"; _wep = "glock17_EP1";};	// Glock 17
    			case 2: { _mag = "6Rnd_45ACP"; _wep = "revolver_EP1";};			// Revolver
    			case 3: { _mag = "30Rnd_9x19_UZI"; _wep = "UZI_EP1";};			// UZI
    			case 4: { _mag = "8Rnd_9x18_Makarov"; _wep = "Makarov";};		// Makarov
    			case 5: { _mag = "7Rnd_45ACP_1911"; _wep = "Colt1911";};		// Colt 1911
    			case 6: { _mag = "20Rnd_B_765x17_Ball"; _wep = "Sa61_EP1";};	// SA-61
    			};
    		[_x] JoinSilent Eneminator;
    		//_x say3D "allahu";
    		_x addMagazine _mag;
    		_x addMagazine _mag;
    		_x addWeapon _wep;
    		_x selectWeapon _wep;
    		_x SetUnitPos "Up";
    		_x doTarget _unit;
    		_x SetSpeedMode "Full";
    		_x SetCombatMode "Red";
    		_x reveal _unit;
    		_x SetBehaviour "Careless";	
    
    
    	};};
    	case 2: {  _unit sidechat "Stone Possible";
    		if(_unitProb < 40) then {  _unit sidechat "Stone Is";
    		[_x] JoinSilent Eneminator;
    		_x reveal _unit;
    		_x addMagazine "HandGrenade_Stone";
    		_x addMagazine "HandGrenade_Stone";
    		_x selectWeapon "HandGrenade_Stone";
    		_x doTarget LOG; // only try for attacking logUnit
    		_x SetBehaviour "Careless";
    		_x SetUnitPos "Up";
    		_x SetSpeedMode "Full";
    		_x SetCombatMode "Red";
    		_x doFire _unit;
    
    	};};
    	case 3: {	 _unit sidechat "Runner Possible";
    		if(_unitProb < 80) then {  _unit sidechat "Runner";
    		_x doMove getPos _unit;
    		_x SetBehaviour "Careless";
    		_x SetUnitPos "Up";
    		_x SetCombatMode "Red";
    	};};
    	};	  
      }; 
    } forEach _targetsArray;
    
    _unit sidechat "-------------------------------------------";
    

    Description is in script. In short: It makes possible to arm any civilian anytime you launch this. I was trying to JoinSilent zero probability of existance unit OPFOR side. That certain unit in exactly right time only and wanted from it to attack player.

    So I have got problem with switching weapon to a pistol which civilian gets, or Stone and then attack on him with that pistol, or throw a stone on a player.

    --------------------------- E D I T --------------------------------------------

    I made some little changes, this works fine, but there is big delay when AI is realising that it should attack on me.

    Anyway functional code:

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Script for using randomness to select which civilian is dangerous to a player and will try to hurt him somehow
    // Script by: Khalashnikovf
    // Thx for help to neokika for base script of revealing all certain units
    // -----------------------------------------------------------------------------
    // Example:	nul = [unit,distance,10,40,80] execVM "CivilianDanger.sqf";
    //
    // unit = name of unit
    // distance = distance of danger area, recommended is 20
    // 10,40,80 is possibility of Actions: ArmedCiv,StoneCiv,RunCiv
    // -----------------------------------------------------------------------------
    // Use: 	Place unit on map, place enemy unit with zero probality of existence and name it Eneminator
    //
    // Idea: 	Script will choose unit and says, if it is possible weapon holder, or stone thrower, or if he is just annoyer
    //			There is 10% chance that possible weapon holder has got a gun, 40% for stone throwerer, and 80% for annoyer
    //			Civilians with gun will just for sure shout Allah Agbar
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    private ["_unit","_distance","_mag","_wep"];
    
    _unit = _this select 0;
    _distance = _this select 1;
    _posArm = _this select 2;
    _posSto = _this select 3;
    _posRun = _this select 4;
    _mag = "";
    _wep = "";
    
    _targetsArray = nearestObjects [_unit, ["Man"], _distance]; 
    { 
      if ((side _x == CIVILIAN)and( alive _x)) then 
      { 
    _unitType = ceil (random 3);
    _unitProb = floor (random 101);
    switch (_unitType) do { 
    	case 1: {
    		if(_unitProb < _posArm) then {  _unit sidechat "Possible armed threat";
    		_weaponType = ceil (random 6);
    		switch (_weaponType) do
    			{ 
    			case 1: { _mag = "17Rnd_9x19_glock17"; _wep = "glock17_EP1";};	// Glock 17
    			case 2: { _mag = "6Rnd_45ACP"; _wep = "revolver_EP1";};			// Revolver
    			case 3: { _mag = "30Rnd_9x19_UZI"; _wep = "UZI_EP1";};			// UZI
    			case 4: { _mag = "8Rnd_9x18_Makarov"; _wep = "Makarov";};		// Makarov
    			case 5: { _mag = "7Rnd_45ACP_1911"; _wep = "Colt1911";};		// Colt 1911
    			case 6: { _mag = "20Rnd_B_765x17_Ball"; _wep = "Sa61_EP1";};	// SA-61
    			};
    		[_x] JoinSilent Eneminator;
    		//_x say3D "allahu";
    		_x setskill 0.6; 
    		_x reveal _unit;
    		_x addMagazine _mag;
    		_x addMagazine _mag;
    		_x addWeapon _wep;
    		_x selectWeapon _wep;
    		_x doTarget _unit;
    		_x SetBehaviour "Careless";
    		_x SetUnitPos "Up";
    		_x SetSpeedMode "Full";
    		_x SetCombatMode "Red";
    		_x doFire _unit;
    
    	};};
    	case 2: {
    		if(_unitProb < _posSto) then {
    		[_x] JoinSilent Eneminator;
    		_x setskill 1;
    		_x reveal _unit;
    		_x addMagazine "HandGrenade_Stone";
    		_x addMagazine "HandGrenade_Stone";
    		_x selectWeapon "HandGrenade_Stone";
    		_x doTarget _unit;
    		_x SetBehaviour "Careless";
    		_x SetUnitPos "Up";
    		_x SetSpeedMode "Full";
    		_x SetCombatMode "Red";
    		_x doFire _unit;
    
    		//_x fire ["throw","HandGrenade_Stone","HandGrenade_Stone"];
    
    	};};
    	case 3: {
    		if(_unitProb < _posRun) then {
    		_x doMove getPos _unit;
    		_x SetBehaviour "Careless";
    		_x SetUnitPos "Up";
    		_x SetCombatMode "Red";
    	};};
    	};	  
      }; 
    } forEach _targetsArray;
    
    

    Next Thing I will put simple thing for smoking soldier out of his position, something like that civilian throw there instead of stone one Smokeshell :) , or maybe with really little percentage a grenade.

    Little demo mission: CivilianDanger.zarghabad there is a hint when some civilian will be armed.


  2. I would like to make this:

    I have trigger circle named City.

    And I would to:

    civ countSide list City

    This will count every civilian unit in town (but would like to not count vehicles,only men). They are not named!

    Then I would like to Add them a Pistol (makarov or whatever) randomly to a for example 1 / 20 of all civilians.

    And these armed Civilians would become EAST and would try to kill west player.

    Then all of civilians would run onto a player. Just to annoy him and obstruct in his sight. And when player will kill one civilian all of the crowds would throwing rocks on him. And count every throw that some civilian do and make some possibility to hit player (some blur,little damage according to where civilian would hit, all random).

    I know that this is too much.

    Lets start with how to send all civilians in trigger area onto a player.

    Then arm some of them.


  3. bomb = "SmallSecondary" createVehicle [getpos targ select 0,getpos targ select 1,200];

    place the code in a gamelogic and name targ or place in a trigger.

    That will spawn a small explosion in the air.

    a couple of other explosions that will work are

    "HelicopterExploSmall"

    "HelicopterExploBig"

    These are just effects and I don't think they will damage anything.

    .

    Nice,not quite undestand it ... but will try and will report.

    ---------- Post added at 20:00 ---------- Previous post was at 19:09 ----------

    Like I thought, dont understand what to do with that gameLogic,etc. Could you describe it more in details pls?

    I most likely have got this in init file only for just one explosion of helicopter tail.

    Something like you write is practicaly same like from BI tutorial recently added onto Youtube.

    _explosion1 = "SmallSecondary" createVehicle [(getpos hawk6 select 2),(getpos hawk6 select 2),(getpos hawk6 select 2)];

    so why its not working just like that only because of "SmallSecondary" ?

    EDIT: Forget it,working already, I just need to somehow put it into script :)


  4. Im trying to make identities to showing in game

    I made this:

    class CfgIdentities
    {
    class Overlord {
    name = "Overlord";
    face = "Face35";
    glasses = "none";
    speaker = "Eva";
    pitch = 1.1;
    };
    
    class Pilot {
    name="Pilot";
    face="Face05";
    glasses="none";
    speaker="Jonah";
    pitch=1.0;
    };
    
    };

    Then I made in init file this:

    overlord setIdentity "Overlord";
    c130_real setIdentity "Pilot"; 

    So its not showing their names in game? Its still showing for example 1-1-C 1: " bla bla bla" ...

    I searched forum for this thing and there is everywhere only this guide,nothing more.

    Im using sideRadio in desription.ext and stringtable.xml for messages.

    So what is wrong?


  5. But, it isn't simple ;) It's as simple as that :D The best thing you can do is download existing missions and see how dialogs are done from that, and try to change there until you got what you want, and then try to implement it into your own mission.

    Commands: http://community.bistudio.com/wiki/Category:Command_Group:_GUI_Control

    Dialog Control: http://community.bistudio.com/wiki/Dialog_Control

    Although I have created my share of dialogs, and modified a lot of others to suit my need, trust me - I never look forward to doing it. I don't know your skill level on scripting in general, but if 20 posts is to be a pointer, I'd say it's a bit too early to jump into dialogs.

    I'm not saying it can't be done. I'm saying that if you do, expect a lot of crashes :p

    And that the another problem. I dont know any mission where is dialog ... Some recomendations? :)


  6. Yup, I tried this last night. That was useless.

    I really need only some pretty nice tutorial, or demo mission where it could be all in one.

    Creating Dialog, Buttons with reaction like launching eecVM, and Dialog with lot of still changing infos. How to change color, shape, style of lines, etc.

    Something simple,pls.

    I have some tutorial, but it is from OFP1 and it not seems like functional and using all stuff from Arma 2.


  7. I would like to create a simple Dialog window looking like mini display from 80s.

    I need a little checking "device" where you can set up dificulty of Exam which you have to finish.

    I was searching and watching and reading some instructions. I could not find something really simple.

    So I would like to make something like this where player could choose dificulty.

    http://img243.imageshack.us/img243/1249/arma2pc1.jpg

    And that would switch to this:

    http://img838.imageshack.us/img838/8133/arma2pc2.jpg

    In first screen would player control mouse only and has to choose, then the second screen would be only like informative character. Only thing on screen.

    Almost All data would be dynamic and would be changing.

    I already have script which doing all this stuff.

    Could anyone help me how to do this pls?


  8. You can create an addaction then script a unit kneeling using the notebook by using setunitpos If you want a notebook you will probably have to create your own, I do not believe that there are any in the editor.

    There was some notebooks since OFP1, so it couldbe even here :) will see.

    But this is that problem. I dont know how to set that position of notebook.

    I dont know how to use that this select0, select1 etc stuff.

    So could you pls make me some few lines of how to write this?

    I would like to get Unit into position like it searching in Cargo or dead body.

    And than add afront of him in distance 0.5 metres a some object,lets call him notebook.

    And then action for canceling this all. To remove notebook and return unit into previous position.

    I have also problem with getting direction of that unit.

    I need this thing also for my mission previous mentioned in other thread. I need to setup waypoint of hawk 50 metres afront of direction of target way (for better catching him up).

×