Forum Jump :

Author Message


Posts: 231
Rank:


Level: Member

Country: en
Location:
Occupation: Project Manager
Age: 37
In-game name: I3lueVein

 
#1 Posted at 2008-09-07 10:37        
     
Hi all.

Ok nearly there with a taser we are making for City Life. But guess what it will kill you

Basically I'm looking for somone to help me finish it off so we can get it out to the ARMA community.

All the modeling is done by IMG, I just need help on the script and every one I have askes is too busy. (There must be someone out there)

Thanks in advanced:



config.CPP

class CfgPatches
{
 class Taser
 {
  units[] = {};
  weapons[] = {"Taser"};
 };
};
class CfgVehicleClasses
{
 class Recon_Weapons
 {
  displayName = "Recon Weapons";
 };
};
class CfgSkeletons
{
 class taserbones
 {
  isDiscrete = 0;
  skeletonInherit = "";
  skeletonBones[] = {};
 };
};
class CfgModels {};
class CfgAmmo
{
 class Default;
 class Grenade;
 class Mine;
 class BulletCore;
 class BulletBase;
 class stuncharge: BulletBase
 {
  hit = 16;
  indirectHit = 0;
  indirectHitRange = 0;
  model = "\ca\Weapons\shell";
  cartridge = "FxCartridge_Small";
  visibleFire = 0.01;
  audibleFire = 0.01;
  visibleFireTime = 1;
  cost = 1;
  deflecting = 10;
  typicalSpeed = 350;
 };
};
class CfgMagazines
{
 class Default;
 class CA_Magazine;
 class recon_mag;
 class Taser_Mag: recon_mag
 {
  scope = 2;
  type = 16;
  model = "\Taser\Taser_mag.p3d";
  modelMagazine = "";
  modelSpecial = "";
  displayName = "Taser Battery";
  picture = "\Taser\Icon\taser_m.paa";
  ammo = "stuncharge";
  nameSound = "";
  count = 10;
  initSpeed = 350;
  reloadAction = "ManActReloadMagazine";
  maxLeadSpeed = 23;
  class Library
  {
   libTextDesc = "Deployment Charge x 10";
  };
 };
};
class CfgWeapons
{
 class M9;
 class Taser: M9
 {
  scope = 2;
  model = "\Taser\Taser.p3d";
  modelOptics = "-";
  picture = "\Taser\icon\taser_w.paa";
  displayName = "Taser";
  sound[] = {"\Taser\sound\fire.ogg",1,1};
  drySound[] = {"\Taser\sound\empty.ogg",1,1};
  reloadMagazineSound[] = {"\Taser\sound\reload.ogg",1,1};
  magazines[] = {"Taser_Mag"};
  minRange = 2;
  minRangeProbab = 0.1;
  midRange = 30;
  midRangeProbab = 0.8;
  maxRange = 70;
  maxRangeProbab = 0.04;
  optics = 1;
  distanceZoomMin = 50;
  distanceZoomMax = 50;
  dispersion = 0;
  Dexterity = 3;
  initSpeed = 365;
  ffCount = 1;
  aiRateOfFire = 0.35;
  aiRateOfFireDistance = 50;
  reloadTime = 0.1;
  autoReload = 0;
  opticsZoomMin = 0.32;
  opticsZoomMax = 0.5;
  magazineReloadTime = 2;
  class EventHandlers
		{
			init = "[_this select 0] execVM ""\Taser\scripts\taser_init.sqf""";
		};
  class Library
  {
   libTextDesc = "";
  };
 };
};

taser_init.sqf:

_target_bullet = objNull;
_target = objNull;
_deadfirst = false;
taze = [player, _target];
publicVariable "taze";
_gunner = ( ( _this select 0 ) select 0 );
_type = ( ( _this select 0 ) select 4 );
while {isNull _target_bullet} do
{
  _lista = _gunner nearObjects [ _type, 100 ];
  if ( count _lista > 0 ) then
        {
            _target_bullet = _lista select 0;
        };
      Sleep 0.0001;
};
while {isNull _target} do
{
  if ( ! isnull _target_bullet ) then{
              _listb = _target_bullet nearObjects [ "man", 1.2 ];
              if ( count _listb > 0 ) then
              {
                  _target = _listb select 0;
              };
          };
  Sleep 0.001;
};
if ( alive _target ) then
  {
      _deadfirst = false;
  }else
  {
      _deadfirst = true;
  };
sleep 0.05;
if ( _deadfirst ) exitwith
  {
      hint "Please don't tazer dead people, it's not nice";
  };
if ( !_deadfirst ) then
  {
      _target playmove "AdthPercMstpSnonWnonDnon_3";
      _target setmimic "surprised";
  };
if ( player == _target ) then
  {
      hint format [ "You just got tasered by %1", ( name _gunner ) ];
  };
if ( player == _gunner ) then
  {
      hint format [ "You have sucessfully tasered %1", ( name _target ) ];
  };
if ( ( _target == _gunner ) && ( player == _gunner ) ) then
  {
      hint format [ "Well done %1, you tasered yourself :(", ( name _gunner ) ];
  };
_i = 0;
_i2 = 0;
while {( _gunner distance _target ) > 5 || _i <= 40}do
{
  if ( _i2 < 25 && ( player == _target ) ) then
      {


          titleText [ " ", "WHITE IN" ];
      };
      _target setdir ( getdir _target + 1 );
      sleep 0.04;
      if ( _i2 < 25 && ( player == _target ) ) then
          {
              titleText [ " ", "BLACK OUT" ];
          };
          _target setdir ( getdir _target - 1 );
          _i = _i + 1;
          _i2 = _i2 + 1;
          sleep 0.025;
};
_i = 0;
_i2 = 0;
_num = ( random 3 ) + 3;
sleep _num;
if ( player == _target ) then
  {
      titleText [ " ", "BLACK IN" ];
  };
_target switchmove "AidlPpneMstpSrasWrflDnon02";
_target setdammage ( getdammage _target + 0.15 );
sleep 1;
if ( alive _target ) then
  {
      _deadfirst = false;
  }else
  {
      _deadfirst = true;
  };
if ( !alive _target ) then
  {
      hint format [ "You killed %1 with your taser. It is meant to be used as a non lethal weapon only", name _target ];
  };
if ( _deadfirst ) then
  {
      hint "Please don't tazer dead people, it's not nice";
  };

Spooner helped in Ofpec but still I'm a bit :o

OFPEC.com

Also in BI forum but still no reply BI forums

This post was edited by Foxhound (2008-09-07 11:49, ago)


Author Message

Dead3yez  

I am evil


Posts: 3113
Rank:


Level: Member

Country: en
Location: North Yorkshire
Occupation: dead3yez
Age: 28
In-game name: dead3yez

 
#2 Posted at 2008-09-07 10:55        
     
class stuncharge: BulletBase
{
  hit = 16;
  indirectHit = 0;
  indirectHitRange = 0;
  model = "\ca\Weapons\shell";
  cartridge = "FxCartridge_Small";
  visibleFire = 0.01;
  audibleFire = 0.01;
  visibleFireTime = 1;
  cost = 1;
  deflecting = 10;
  typicalSpeed = 350;
};

hit = 0;

won't kill now. :)


Advertisement


Author Message


Posts: 231
Rank:


Level: Member

Country: en
Location:
Occupation: Project Manager
Age: 37
In-game name: I3lueVein

 
#3 Posted at 2008-09-07 11:34        
     
lol, cheers mate, should of seen that but a fresh set of eyes is all it neds some times :dozingoff


Author Message


Posts: 231
Rank:


Level: Member

Country: en
Location:
Occupation: Project Manager
Age: 37
In-game name: I3lueVein

 
#4 Posted at 2008-09-07 19:59        
     
Hmm, yes now it dosent kill but the script seems to not function??

Any more advice is appreciated


Author Message


Posts: 189
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 24
In-game name:

 
#5 Posted at 2008-09-08 01:44        
     
try this blue ;)
OMG this is annoying me so much!


init.sqf
player addEventHandler ["fired", {_this execVM "tase.sqf"}];

tased = false;
"tased" addPublicVariableEventHandler
{
     target = _this select 0;
     target switchMove "TestSurrender";
};


tase.sqf
bullet = "stuncharge";
a_bullet = nearestObject [player, bullet];
the_bullet = a_bullet select 0;
temp_a = [];

while {!isNull the_bullet} do
{
     target = nearestObjects [the_bullet, ["Man"], 1.8];
     a_target = target select 0;
     temp_a = [a_target];
};

t = temp_a select 0;
tased = [t];
publicVariable "tased";


and we need to test on the -CAF- Combat Server

This post was edited by DaChevs (2008-09-09 22:58, ago)


Author Message

Dead3yez  

I am evil


Posts: 3113
Rank:


Level: Member

Country: en
Location: North Yorkshire
Occupation: dead3yez
Age: 28
In-game name: dead3yez

 
#6 Posted at 2008-09-08 06:04        
     
If the hit = 0; casue the problem you could use a low value like 0.01 and test?


Author Message


Posts: 231
Rank:


Level: Member

Country: en
Location:
Occupation: Project Manager
Age: 37
In-game name: I3lueVein

 
#7 Posted at 2008-09-09 16:23        
     
Well still not working lol.

I'll have to go back to the drawing board.

I'm unsure on how the config calls the taser_init

I know its there in the line

init = "[_this select 0] execVM ""\Taser\scripts\taser_init.sqf""";

And the event handler in the mission init. But there must be a simpler way of this bullet hitting somone and they switch move on all not local.

I have been using this as insparation and changing this http://www.ofpec.com/forum/index.php?topic=32108.0 to suit my needs.

I'll keep you posted on any success I have :con


Author Message


Posts: 189
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 24
In-game name:

 
#8 Posted at 2008-09-09 22:54        
     
we have to test it on an actual server blue.


also what about this?

init.sqf
player addEventHandler ["fired", {_this execVM "tase.sqf"}];


tase.sqf
bullet = "stuncharge";
a_bullet = nearestObject [player, bullet];
stun_array = [];
p_to_hit = objNull;

while {!isNull a_bullet} do
{
     target = nearestObjects [a_bullet, ["Man"], 1.8];
     the_target = target select 0;
     stun_array = [the_target];
};

stun_target = stun_array select 0;
call compile format ["p_to_hit = %1 switchmove ""TestSurrender""", stun_target];
publicVariable "p_to_hit";

This post was edited by DaChevs (2008-09-09 23:13, ago)


Author Message


Posts: 231
Rank:


Level: Member

Country: en
Location:
Occupation: Project Manager
Age: 37
In-game name: I3lueVein

 
#9 Posted at 2008-09-09 23:35        
     
I did try it in server,

I also noticed that the event handler

player addEventHandler ["fired", {_this execVM "tase.sqf"}];

where does it know what has fired when the cfg simply has an init

init = "[_this select 0] execVM ""\Taser\scripts\taser_init.sqf""";

would this line need to be added

Fired = "[_this select 0] execVM ""\Taser\scripts\tase.sqf""";

and then

init = "[_this select 0] execVM ""\Taser\init.sqf""";

Example at the end of the config.cfg

class EventHandlers
{
init = "[_this select 0] execVM ""\Taser\init.sqf""";
Fired = "[_this select 0] execVM ""\Taser\scripts\tase.sqf""";
};

Or are you simply asking to call the code out of the addon? where i would have to remove the class EventHandlers from the cfg all together?

Cheers


Author Message


Posts: 189
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 24
In-game name:

 
#10 Posted at 2008-09-10 01:12        
     
yes ur must put the addEventhandler in the mission init.sqf


then change line too:
player addEventHandler ["fired", {_this execVM "\taser\scripts\tase.sqf"}];


Author Message


Posts: 231
Rank:


Level: Member

Country: en
Location:
Occupation: Project Manager
Age: 37
In-game name: I3lueVein

 
#11 Posted at 2008-09-12 19:33        
     
Update, This has been fixed and now working. (Thanks to Mr Peanut's kind assistance)

The scripts are being tweeked and maybe the model if IMG has time.

It will be released after we put it into our community 1st for beta testing.

Cheers also Dead3yez for the Hit damage thing :D


Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#12 Posted at 2008-09-13 17:46        
     
where can i download city life at? can someone please help me? btw i downloaded the vietnam the experience and i dont know where to save it at so i can play it.


Author Message


Posts: 231
Rank:


Level: Member

Country: en
Location:
Occupation: Project Manager
Age: 37
In-game name: I3lueVein

 
#13 Posted at 2008-09-13 20:57        
     
Hi Ironhorse :welcome to Armaholic

To install addons see this http://www.armaholic.com/plug.php?e=faq&q=18

City Life is here http://www.citylife.me.uk

Just to let you know That city life is still in BETA so if you play your bug reports are required in our forum.

A new addon pack is being made and shoul be up and ready by the end of the week end.


Author Message

vikk  



Posts: 317
Rank:


Level: Member

Country: us
Location: The American Suburbia, South Carolina
Occupation: vikk
Age:
In-game name:

 
#14 Posted at 2008-09-17 00:33        
     
ironhorse636 : where can i download city life at? can someone please help me? btw i downloaded the vietnam the experience and i dont know where to save it at so i can play it.

:welcome iron horse


this is a taser mod help topic. if you have any questions please ask here.

http://www.armaholic.com/forums.php?m=posts&p=23304#23304

but it seems they already answered your question :) just for future reference

Former Armaholic Team Member
Vikk[TG-Regular]
Killing bad guys one bullet at a time

Author Message


Posts: 189
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 24
In-game name:

 
#15 Posted at 2008-09-17 00:56        
     
Taser Finished, we are debating a public release.

TBA.





This topic is locked, new posts are not allowed.