Home   Help Search Login Register  

Author Topic: Additional EventHandlers  (Read 6525 times)

0 Members and 1 Guest are viewing this topic.

Offline Lone~Wolf

  • Mission Tools & Mods
  • Members
  • *
  • Vladimir Dmitri Mikhail Andreevich Stamenov
Re: Additional EventHandlers
« Reply #15 on: 24 Sep 2014, 13:16:48 »
Wiineri that's absolutely amazing. You're a star! Do you know if this also works with the more recent BIS games up to ArmA 3?

Now that I know I can use this, I can combine this with someone's brilliant suggestion (I'm so sorry I've forgotten who came up with it) of doing ghetto raycasting using smokeshells to check if an object intersected along a line.
With the two of them working together I can create the most incredible goremod that BIS games have ever seen! MUAHAHAHAHAHA!

Entry wound impacts, exit wound splatter, hit-location specific effects like bone fragments or brain in the ejection, blood splatter hitting walls/ceilings and dribbling down/dripping off a-la-Brutal-Doom...

Looks like I've found my programming project for this semester!  :D
Snarling creature, lurking in the background, still writing in .sqs

Offline Wiineri

  • Members
  • *
Re: Additional EventHandlers
« Reply #16 on: 30 Sep 2014, 20:41:13 »
Well, I have pretty much no experience at all of modding any ArmAs, and haven't tested this with any of them, but I don't see why this wouldn't work with them too. Propably the string "NOID krater" is something different, but otherwise I think it should work fine.

Good luck with your project!

Offline SoldierEPilot

  • Members
  • *
Re: Additional EventHandlers
« Reply #17 on: 18 Apr 2015, 12:34:52 »
Even in old Battlefield 1942 shot range affects direct damage from projectiles.
The formula is:
Hitpoints = MaterialDamage * DamageMod * AngleFalloff * DistanceMod

DistanceMod = minDamage + (1-minDamage) * (distToMinDamage - distance) / (distToMinDamage - distToStartLoseDamage)

BF community sample: for a shotgun pellet hitting at, say, 50 meters:
distance=50
minDamage=0.5
distToMinDamage=80
distToStartLoseDamage=40

DistanceMod = 0.5 + (1-0.5) * (80 - 50) / (80 - 40) = 0.875
(87.5% of the full-power hit which is occurred at ranges<40)

In OFP shots from, say, Kozlice at 5 and 105 meters are equal in power as I know.
Muzzle velocity value from config.cpp has no deal with direct damage too.

So if people want to implement some damage-modifying scripts -
here is a demo of new hit-detection system, which detects
weapon, muzzle, mode or magazine, ammo and initial position of bad boy who made this hit.

I also removed property system elements to provide maximum simplicity and performance
and optimized the scripts to work even faster in CWA.
P.S.
If someone also need to know projectile hit angles - just say a word...

--EDIT--
Hit system updated in 3 variants.  One of them combines data from 3 event handlers: shooter's "fired" EH,
victim's "hit" and "dammaged" EHs. BF 42 features are not implemented yet.
« Last Edit: 09 May 2015, 05:45:38 by SoldierEPilot »

Re: Additional EventHandlers
« Reply #18 on: 04 Jan 2018, 13:56:21 »
An eventhandler that detect which weapon that the unit is holding would be great (Only v1.96 and under you can use AnimChanged to detect it but its for 1.99 only)

Offline SoldierEPilot

  • Members
  • *
Re: Additional EventHandlers
« Reply #19 on: 06 Jan 2018, 16:05:01 »

In CWA 1.99 u can use this mod
http://www.flashpoint.ru/threads/real-cold-war-crisis-mod-v4-5.55472/

Code: [Select]
_wpn = _man call localize "fn_weapon_in_hands"
hint _wpn

In OFP 1.96 and below it can be done only 4 player
http://ofp-faguss.com/fwatch/command/mem_getplayeranim

Re: Additional EventHandlers
« Reply #20 on: 15 Jan 2018, 10:33:29 »
So there isn't a vanilla way?

Re: Additional EventHandlers
« Reply #21 on: 20 Jan 2018, 09:17:31 »
Also what about getting the current way point position of unit and also dynamically checking if resistance is friendly to east/west :D

Offline SoldierEPilot

  • Members
  • *
Re: Additional EventHandlers
« Reply #22 on: 25 Feb 2018, 10:54:24 »
 >So there isn't a vanilla way?
In 1.96 there is no good native way to check out unit's current animation.
But there is a way to check out if unit's weapons are in safe mode:
Code: [Select]
?behaviour player in ["CARELESS","SAFE"]:  player sideChat "My hands are empty"
Take note, what WW4-based mods uses patrol anims and wherefore rifles will always
be in hands till dropped.

Another limitation is what once u holster the gun, your behavior will be "safe" or "careless"
after a several seconds and this may be critical in stealth missions.
--------------------------------------------------------------------------

>Also what about getting the current way point position of unit and also dynamically checking if resistance is friendly to east/west

Current waypoint position: find all waypoints of unit, find 2 nearest of them and
second waypoint in this pair should be the current.
To find all WPs use getWPpos command and loop.

The side of resistance can be set in init.sqs:
RES_SIDE = EAST
;RES_SIDE = WEST
;RES_SIDE = sideEnemy
;RES_SIDE = sideFriendly

More universal way is to use a global array of all units,
select one unit of resistance side and use commands "reveal"
and "countEnemy" with pairs (res unit - east unit) and/or (res unit - west unit).
It's hard to do and I recommend much simpler way:

just use countEnemy command to determine if this known unit
is enemy or not for current.














Re: Additional EventHandlers
« Reply #23 on: 18 Mar 2018, 12:44:30 »
It felt like you read my mind except getting the current waypoint of a unit part your way is not that reliable

Anyways I'm probably going to release my script soon the AI taking cover script (Dynamically) stay tuned :D

Offline SoldierEPilot

  • Members
  • *
Re: Additional EventHandlers
« Reply #24 on: 18 Mar 2018, 23:05:21 »

; to get all WPs one can use DASH_Library 2.5
https://www.ofpec.com/forum/index.php?topic=36435.0

Code: [Select]
_array_of_pos=_unit call localize "f_waypoints"

; But it's often more easy to lock current WP and do what u want
Code: [Select]
_unit lockWP true
; some scripting actions
_unit lockWP false

; about RESISTANCE allies detection:
1) create 2 invis targets of East and West side
(laser type is the best) in a meter near some resistance unit
2) show 'em to him via reveal command
3) wait a second
4) use _unit countEnemy [_tgt] to see who is resistance enemy.
5) the rest of sides are friendly 2 Troska fraction.
6) remove targets

U can use SideFriendly 4 "All" and SideEnemy 4 "Nobody".

However there are only few situations where u realy need to know
RES fraction allies -  group link (infoshare) and :hmmm: ... do u know one more implementation?

>AI taking cover script
See also
\DASH_Library 2.5\Test Missions\Examples (part 2).Eden\Examples\Misc\useCover.sqs
(one unit hides from another using some big object like APC)

Re: Additional EventHandlers
« Reply #25 on: 07 Apr 2018, 11:41:42 »
https://forums.bohemia.net/forums/topic/215599-improved-ai-script-take-cover-script-v13-and-swimming-script-for-vanilla/

read this :D

Also what is the

\DASH_Library 2.5\Test Missions\Examples (part 2).Eden\Examples\Misc\useCover.sqs

link you gave me?
« Last Edit: 07 Apr 2018, 11:43:33 by Alex_Mercer_1479 »

Offline SoldierEPilot

  • Members
  • *
Re: Additional EventHandlers
« Reply #26 on: 09 Apr 2018, 22:35:24 »

It was the path to the script included in this archive
http://www.ofpec.com/forum/index.php?action=dlattach;topic=36435.0;attach=6354
An illustration how to use "f_hidden_pos" function.

Your take cover realization is rather interesting.
But the swimming without swim animation is like crawl on ice not to say worse.
Check out an addons below:

Animated vehicle-based swimming:
http://yadi.sk/d/tm8TLgUa3Mwoyx

Animated script-based swimming:
ninja_LLU.pbo (can also be found in @SLX mod)

Re: Additional EventHandlers
« Reply #27 on: 14 Apr 2018, 11:58:24 »
I wanted the swim script to work without mods just vanilla and in a random mission that you can add on yourself

There is another way for swim script to work without crawling and that is walking (but half of the body is submerged underwater of course)

Re: Additional EventHandlers
« Reply #28 on: 14 May 2018, 15:08:11 »
is there a way to detect vehicle from a unit who is also in that vehicle?

the only way i think of is nearestobjective

NEVERMIND I FOUND IT
« Last Edit: 14 May 2018, 17:59:29 by Alex_Mercer_1479 »