Home   Help Search Login Register  

Author Topic: optional parameter & setdammage prob  (Read 575 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
optional parameter & setdammage prob
« on: 05 Aug 2003, 22:00:02 »
1 Q is  an simple question, I think

I have made a script with 3 parameters :

1)Name of the group
2)number used for a delay.
3), name of the medic from that group

The script starts when the medic's dead but I want it to work when there"s no medic  at all so that second parameter become optional.


Quote
;;slow_ones_die

_grp = _this select 0
_delay = _this select 1
_med = _this select 2

_units = units _grp

_c = count _units

_t = 0

crawlagain = false
@!alive _med OR ??

#start
_who = _units select _t
?crawlagain : exit
?"alive _x" count units _grp <= 0 :exit
?!canstand _who && alive _who && _who != player : goto "killhim"
~1
_t=_t+1
?_t == _c : _t = 0
goto "start"

#killhim
~1
?crawlagain : exit
?!alive _who : goto "start"
~_delay + (random _delay)
_who setdammage 1
goto "start"


The script kills a unit that lost the ability to walk after the medic in his group is dead.  

2th Q

Infact the setdammage 1 is too drastic imo .
I want something like _who setdammage (Getdammage _who + 0.01) to simulate slow bleeding to death and delete the second parameter so can the script run faster


But when I use that setdammage line, the leader ressurect when he's shot in the legs. Somebody said me Setdammage does not maintain local dammage, the fact he was shot in the legs is forgotten.
Is there something I can do about it?







 
« Last Edit: 05 Aug 2003, 22:02:08 by Blanco »
Search or search or search before you ask.

peter

  • Guest
Re:optional parameter & setdammage prob
« Reply #1 on: 06 Aug 2003, 00:30:13 »
@ """SoldierWMedic"" == typeof _x" count units _grp == 0

... counts the SoldierWMedic - units in the group, you could also use it with a trigger to include other west-medics too ...

works only in 1.91 !
« Last Edit: 06 Aug 2003, 00:30:57 by peter »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:optional parameter & setdammage prob
« Reply #2 on: 06 Aug 2003, 00:36:02 »
1 st Q

heres da changes in da script

Code: [Select]
_grp = _this select 0
_delay = _this select 1
? (count _this > 2) :  _med = _this select 2

_units = units _grp

_c = count _units

_t = 0

crawlagain = false
? (count _this == 2) : goto "start"
@!alive _med

dat wil make it optional -

in peters way - u shud change it 2 smin like dat

@ (("{SoldierWMedic} == typeof _x" count units _grp)+("{SoldierEMedic} == typeof _x" count units _grp)) == 0

shud work like dat (4 east nd west - ull have 2 add anoder 1 4 resistance - but i cant remember watwaz da resistance medic class name (in dis case - u dont need 2 specify medics @ all

@ sec Q

WTF ? :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Blanco

  • Former Staff
  • ****
Re:optional parameter & setdammage prob
« Reply #3 on: 06 Aug 2003, 17:05:13 »
Thx, guys, i will try it soon.

smart thinkin' LCD.  :o

Peters' way work also but I want the script work with addon (medics) too and that's not the case with the typeof example.

Anyways , thx to U both, guys  ;)

About Q2 LCD, what do u main? are you suprised by the fact or don't U understand the Q?   :)




Search or search or search before you ask.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:optional parameter & setdammage prob
« Reply #4 on: 06 Aug 2003, 17:17:37 »
Quote
are you suprised by the fact or don't U understand the Q?

ill shot 4 da sec option ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Blanco

  • Former Staff
  • ****
Re:optional parameter & setdammage prob
« Reply #5 on: 06 Aug 2003, 18:58:01 »
 ;D I like that LCDish of yours, it looks a bit like Tombish

anyways, here are the exact words of that guy :

I think it is because the 'setDammage' command resets all damage to the unit, and does not maintain local damage.  So if you get shot in the legs and have a damage of .25, when you tell the computer to setdammage .26, the fact that your legs were hit is just forgotten.  This is also true for being hit in the arms.

AFAIK, there is no way to avoid this (the OFPEC blood addon had this problem, too, when you enabled bleeding to death).


I dunno what AFAIK mains, tho



 
Search or search or search before you ask.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:optional parameter & setdammage prob
« Reply #6 on: 06 Aug 2003, 21:11:16 »
As Far As I Know
Plenty of reviewed ArmA missions for you to play

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:optional parameter & setdammage prob
« Reply #7 on: 06 Aug 2003, 22:23:00 »
i think ur guy was right  :-\  :-X no way 2 heal emself - but it doesnt realy matter just give em enugh time 2 bleed out (dont have 2 reduce damg even) nd no1  il notice dat dey werent setdamaged slowly ;D (also it more logical as dey wont sudenlyget injured in deir hands nd oder places)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Blanco

  • Former Staff
  • ****
Re:optional parameter & setdammage prob
« Reply #8 on: 06 Aug 2003, 23:09:55 »
k, topic's solved;

THX for the response, boys!

Search or search or search before you ask.