Five Elite Mercenaries are send to an Island in middle of the 1980'. The Task: Find and Eliminate a local Drug Baron. Features: new Physic, real Sunmovement, Day/Night Change, Hunger/Food system, realistic (!) Weather system, Light/Dark viewing system for AI, 5 different Fractions on the Island. Complete Realistic simulation of nearly all things, including Sleep. New weapons, new Vehicles. Vehicles driving system is now exact (!) like GTA IV , FireSystem,... this mod is Heavily inspired by GTA, IGI, FarCry.

Forum Thread
  Posts  
steal health from enemies (Games : Far Cry : Mods : FarCry Operation Clearing : Forum : Technical Discussion for OP CL Devkit : steal health from enemies) Locked
Thread Options
pvcf
pvcf Germany
Nov 6 2013 Anchor

the title says all: steal health from enemies

i must know exactly in which conditions the player get health from a enemie and if this can be every enemy and if the player needs a specific weapon or something.

edit.:
pls keep in mind that the forum here does not have a emailnotification :( so its important to come here from time to time.

Edited by: pvcf

TiR
TiR
Nov 7 2013 Anchor

I asked about getting health from enemy cause I want make burning enemies. For now they die after some time. I have a simple idea when Proximity Damage attached to enemy. But if PD linked to enemy and hurting him, he is not moving until he die. Also burning enemy must hurt player. So I think about this solution: track enemy and spawn PD near him every frame while fire is burning.

pvcf
pvcf Germany
Nov 7 2013 Anchor

ah, you dont wont steal health from enemy and give it to player, correct ? that was the first thing i thought by the "getting health from enemy" formulation.
so you want to make a enemy die if he burn, but he should move and the enemy should also hurt the player if player touch him, correct?

TiR
TiR
Nov 7 2013 Anchor

Yes. If enemy burn, his health must go down, but after some time fire disappear and monster can be alive. For example: enemy has 255 health, and fire take about 200 health from him.

pvcf
pvcf Germany
Nov 7 2013 Anchor

how did u realize the fire? does the engine know that a AI is burning ? or is it done all with triggers?

TiR
TiR
Nov 7 2013 Anchor

Yep, it's all triggers :) When enemy go trough fire I switch on light and particles which linked to him.

pvcf
pvcf Germany
Nov 7 2013 Anchor

so it will work only at this special enemy, correct ?

TiR
TiR
Nov 7 2013 Anchor

Yes, only for some enemies.

pvcf
pvcf Germany
Nov 7 2013 Anchor

ok, connect a delay trigger and at every output call a mission function:

---------------pvcf-------------------------------

local _healthdecreasing = 50;   --reduce enemy health with this amount
local _allowedevents = 5;       --allow to call the healthdecreasing X times
local enemy1 = System:GetEntityByName("nameoftheenemy");   --find enemy
if enemy1 and enemy1.cnt and enemy1.cnt.health and enemy1.cnt.health > 1 then 
if not enemy1.cnt.allowedevents then enemy1.cnt.allowedevents = 0; end
   if enemy1.cnt.allowedevents <= _allowedevents then
      enemy1.cnt.allowedevents = enemy1.cnt.allowedevents +1;
      enemy1.cnt.health = enemy1.cnt.health - _healthdecreasing;
   end
end
------------

---pvcf----

for each enemy just copy that whole code in a new missionfunction and replace enemy1 with enemy2 and insert the proper name (red field) from editor.

the delaytrigger should call on every output that missionfunction and trigger self again a input. this will run in a endless loop, but the missionfunction will garant that
the health will only be decreased x times. (5 in that example, 5x50 = 250 = death )

if the delaytrigger have a delay from 2 seconds, every 2 seconds 50 hp will be reduced to the victim.

Edited by: pvcf

TiR
TiR
Nov 10 2013 Anchor

Thanks! Will try it later.

pvcf
pvcf Germany
Nov 10 2013 Anchor

faster you be you must little padawan :D

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.